| | |
Urgent help on Applet
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Dec 2007
Posts: 6
Reputation:
Solved Threads: 0
Hi there.This is my first post here.I need help urgently.
I getting desperate because I got a deadline for a project in 3 weeks time.I'm trying to do a 2 X 2 matrix multiplication applet that simulate systolic architecture.Should be something like the Wallace Tree Simulation. It can be seen here:
http://media.pearsoncmg.com/aw/aw_ca...sys_1/wallace/
I got little knowledge of Java but I have to finish this in 3 weeks time.
Anyone expert in Java that could help me here?
Here it is the code that I did so far:
I know...the code is a mess...!I can't figure out.
Why doesn't work?
I'm so desperate that I even thought on asking the same thing on experts-exchange but I dunno if they're going to come out with some answer, and I have to pay for it
So any help would be great guys.
Thanks
I getting desperate because I got a deadline for a project in 3 weeks time.I'm trying to do a 2 X 2 matrix multiplication applet that simulate systolic architecture.Should be something like the Wallace Tree Simulation. It can be seen here:
http://media.pearsoncmg.com/aw/aw_ca...sys_1/wallace/
I got little knowledge of Java but I have to finish this in 3 weeks time.
Anyone expert in Java that could help me here?
Here it is the code that I did so far:
java Syntax (Toggle Plain Text)
import java.applet.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.lang.Math; import java.awt.geom.*; import javax.swing.border.*; import javax.swing.event.*; import java.awt.event.MouseEvent; import java.net.*; public class MatrixMultiplication extends Applet{ Toolkit tk = Toolkit.getDefaultToolkit(); Dimension d = tk.getScreenSize(); Button continueButton = new Button("Continue"); JRadioButton two; public int size = 2; String name = new String("Matrix Multiplication: 2 x 2"); Button calculate = new Button("Calculate"); public Button About = new Button("About"); public Button Help = new Button("Help"); public void init() { this.setBackground(Color.white); Panel radioPanel = new Panel(); radioPanel.setBackground(Color.white); radioPanel.setLayout(new GridLayout(9,1)); two = new JRadioButton(" 2 x 2",true); two.setBackground(Color.white); ButtonGroup radioGroup = new ButtonGroup(); ButtonGroup radioGroup2 = new ButtonGroup(); radioGroup.add(two); JLabel label = new JLabel("<html>Matrix Multiplication</html>"); JLabel label2 = new JLabel("<html>Please click continue to simulate</html>"); radioPanel.add(label); radioPanel.add(label2); radioPanel.add(two); add(radioPanel); setLayout(new FlowLayout(FlowLayout.CENTER)); add(continueButton); Help.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { URL codeBaseURL = getCodeBase(); URL helpURL; URL aboutURL; try { helpURL = new URL( codeBaseURL.toString() + "help.html" ); getAppletContext().showDocument( helpURL, "_blank" ); aboutURL = new URL( codeBaseURL.toString() + "about.html" ); getAppletContext().showDocument( aboutURL, "_blank" ); } catch ( Exception e ) { } } }); About.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { } }); add(Help); add(About); } class AboutDialogue extends javax.swing.JFrame implements HyperlinkListener { /** Creates new form About */ public AboutDialogue() { initComponents(); this.setSize(new java.awt.Dimension(500, 350)); this.setBackground(Color.white); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); Dimension DialogSize = getSize(); Point DialogLocation = new Point( ( screenSize.width - DialogSize.width ) / 2, ( screenSize.height - DialogSize.height ) / 2 ); setLocation( DialogLocation ); } //Listens for hyperlink clicks public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { try { getAppletContext().showDocument( event.getURL(), "_blank" ); } catch ( Exception e ) { } } } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ private void initComponents() { AboutLabel = new javax.swing.JLabel(); LowerPanel = new javax.swing.JPanel(); OkButton = new javax.swing.JButton(); CentralPane = new javax.swing.JScrollPane(); MainText = new javax.swing.JEditorPane(); setTitle("About Matrix Multiplication applyed to Systolic Architecture"); setBackground(Color.white); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent evt) { exitForm(evt); } }); AboutLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); AboutLabel.setText("About Matrix Multiplication applyed to Systolic Architecture"); AboutLabel.setMaximumSize(new java.awt.Dimension(41, 55)); AboutLabel.setMinimumSize(new java.awt.Dimension(41, 55)); AboutLabel.setPreferredSize(new java.awt.Dimension(41, 35)); AboutLabel.setOpaque(false); AboutLabel.setBackground(Color.white); getContentPane().add(AboutLabel, java.awt.BorderLayout.NORTH); LowerPanel.setPreferredSize(new java.awt.Dimension(10, 45)); LowerPanel.setOpaque(false); LowerPanel.setBackground(Color.white); OkButton.setText("Ok"); OkButton.setPreferredSize(new java.awt.Dimension(100, 26)); OkButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { OkButtonActionPerformed(evt); } }); LowerPanel.add(OkButton); getContentPane().add(LowerPanel, java.awt.BorderLayout.SOUTH); CentralPane.setPreferredSize(new java.awt.Dimension(177, 150)); CentralPane.getViewport().setOpaque(false); String AboutText="<html>\n<body><b>The Matrix Multiplication Simulator</b><br><br>Copyright 2007,UK<br><br>\n"; AboutText+="Developer: Orlando Vilas Boas Dantas.\n</body></html>"; MainText.setEditable(false); MainText.setContentType("text/html"); MainText.setText(AboutText); MainText.setCaretPosition(0); //MainText.setVerticalAlignment(javax.swing.SwingConstants.TOP); MainText.setOpaque(false); MainText.setBackground(Color.white); MainText.addHyperlinkListener(this); CentralPane.setViewportView(MainText); getContentPane().add(CentralPane, java.awt.BorderLayout.CENTER); pack(); } private void OkButtonActionPerformed(java.awt.event.ActionEvent evt) { // Add your handling code here: this.hide(); } /** Exit the Application */ private void exitForm(java.awt.event.WindowEvent evt) { System.exit(0); } // Variables declaration - do not modify private javax.swing.JButton OkButton; private javax.swing.JPanel LowerPanel; private javax.swing.JLabel AboutLabel; private javax.swing.JScrollPane CentralPane; private javax.swing.JEditorPane MainText; // End of variables declaration } }
Why doesn't work?
I'm so desperate that I even thought on asking the same thing on experts-exchange but I dunno if they're going to come out with some answer, and I have to pay for it
So any help would be great guys.
Thanks
Last edited by Ancient Dragon; Feb 17th, 2008 at 9:20 pm. Reason: add code tags
•
•
Join Date: Feb 2008
Posts: 6
Reputation:
Solved Threads: 0
Well I asked if anyone could help me with some code for an animation of a data flow within a system.
I got a reply from a guy called "Phaelax" and his post was like this "You want code given to you, use google. We're not here to do your work"
WTF. I came to this forum to ask for help and not to get a rude answer from some <snipped>who can't keep his mouth shut.
I got a reply from a guy called "Phaelax" and his post was like this "You want code given to you, use google. We're not here to do your work"
WTF. I came to this forum to ask for help and not to get a rude answer from some <snipped>who can't keep his mouth shut.
Last edited by happygeek; Feb 18th, 2008 at 7:22 pm. Reason: mis-spelling used to circumvent curse filtering
![]() |
Similar Threads
- HJT log, please advise (Viruses, Spyware and other Nasties)
- I Need Help Immediately! Very Urgent! (Viruses, Spyware and other Nasties)
- field lengths (was: help urgent ) (Java)
- help!! My applet can't run... Urgent!! (Java)
- Help me... it's urgent!! (Java)
Other Threads in the Java Forum
- Previous Thread: Iris scanning
- Next Thread: Can any body help me...
| Thread Tools | Search this Thread |
Tag cloud for Java
@param add android api apple applet application arguments array arrays automation bank binary binarytree bluetooth bold chat chatprogramusingobjects class classes client code compare component coordinates database digit draw eclipse editor error event exception fractal game givemetehcodez graphics gui guidancer health html ide image input int integer integration j2me jarfile java javac javame javaprojects jmf jni jpanel julia keytool learningresources linux list loop map method methods mobile netbeans newbie nonstatic number oracle pattern print problem program programming project projectideas recursion scanner screen server set sharepoint size sms socket sort sorting sql sqlserver string swing test text-file threads time tree web windows







