Forums
Teamfair Developer for all Hobby coders. :: Forums :: Programming and Protocol :: Java
 
<< Previous thread | Next thread >>
test2
Moderators: NeiSep, b_w_johan, Rajeev
Author Post
b_w_johan
Thu Jan 12 2006, 04:17PM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
import java.awt.*;
import javax.swing.*;

/**
* A basic extension of the javax.swing.JApplet class
*/
public class JApplet1 extends JApplet
{
public void init()
{
// Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
symantec.itools.lang.Context.setApplet(this);

// This line prevents the "Swing: checked access to system event queue" message seen in some browsers.
getRootPane().putClientProperty("defeatSystemEventQueueCheck", Boolean.TRUE);

// This code is automatically generated by Visual Cafe when you add
// components to the visual environment. It instantiates and initializes
// the components. To modify the code, only use code syntax that matches
// what Visual Cafe can generate, or Visual Cafe may be unable to back
// parse your Java file into its visual environment.
//{{INIT_CONTROLS
getContentPane().setLayout(null);
setSize(426,266);
getContentPane().add(textArea1);
textArea1.setBounds(12,12,304,217);
getContentPane().add(tekstveld);
tekstveld.setBounds(12,240,302,20);
button1.setLabel("button");
getContentPane().add(button1);
button1.setBackground(java.awt.Color.lightGray);
button1.setBounds(324,12,94,28);
button2.setLabel("button");
getContentPane().add(button2);
button2.setBackground(java.awt.Color.lightGray);
button2.setBounds(324,48,87,29);
//}}

//{{REGISTER_LISTENERS
SymMouse aSymMouse = new SymMouse();
button1.addMouseListener(aSymMouse);
button2.addMouseListener(aSymMouse);
//}}
}
String waarde="";

//{{DECLARE_CONTROLS
java.awt.TextArea textArea1 = new java.awt.TextArea();
java.awt.TextField tekstveld = new java.awt.TextField();
java.awt.Button button1 = new java.awt.Button();
java.awt.Button button2 = new java.awt.Button();
//}}

class SymMouse extends java.awt.event.MouseAdapter
{
public void mouseClicked(java.awt.event.MouseEvent event)
{
Object object = event.getSource();
if (object == button1)
button1_MouseClicked(event);
else if (object == button2)
button2_MouseClicked(event);
}
}

void button1_MouseClicked(java.awt.event.MouseEvent event)
{
// to do: code goes here.
String invoer;
String waarde="";
invoer = tekstveld.getText();
waarde = waarde + invoer;
textArea1.setText(waarde);

}

void button2_MouseClicked(java.awt.event.MouseEvent event)
{
// to do: code goes here.
String invoer;
invoer = tekstveld.getText();
waarde = waarde + invoer;
textArea1.setText(waarde);

}
}


have fun, btw remove comment lines if you use in school exercise
Back to top
MagicShroom
Sat Jan 14 2006, 06:30AM

Registered Member #56
Joined: Sat Dec 31 2005, 12:40PM
Posts: 1
Sounds like afrikaans
Back to top
Rajeev
Wed Jan 25 2006, 02:06AM

Registered Member #47
Joined: Sat Dec 24 2005, 01:09AM
Posts: 41
yo buddy magicshroom.. by any chance u from holland??? hehe
Back to top
Rajeev
Wed Jan 25 2006, 02:08AM

Registered Member #47
Joined: Sat Dec 24 2005, 01:09AM
Posts: 41
johan did u write this code? ehhe cozz then it would be nice to know u r from holland hehe :D
Back to top
b_w_johan
Thu Aug 03 2006, 11:39PM

Registered Member #7
Joined: Fri Jul 08 2005, 03:31PM
Posts: 154
its my code duh ;-) yeah im from netherlands ;-)
ik wist niet dat jij ook nederlander was ;-)

maar dit java gedoe is eigenlijk bullshit gewoon dingetjes voor school kunnen klasgenoten gewoon kopieren plakken en voldoende halen haha
Back to top
 

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System
This site is powered by e107, which is released under the terms of the GNU GPL License.