/*
A basic extension of the java.applet.Applet class
*/
import java.awt.*;
import java.applet.*;
public class Applet1 extends Applet
{
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 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
setLayout(null);
setBackground(java.awt.Color.red);
setSize(488,339);
labelOverhoor.setText("Overhoorprogramma");
add(labelOverhoor);
labelOverhoor.setBackground(java.awt.Color.white);
labelOverhoor.setFont(new Font("Dialog", Font.PLAIN, 30));
labelOverhoor.setBounds(96,12,299,55);
labelEngels.setText("Engels");
add(labelEngels);
labelEngels.setBackground(java.awt.Color.orange);
labelEngels.setFont(new Font("Dialog", Font.PLAIN, 20));
labelEngels.setBounds(24,72,144,36);
labelNederlands.setText("Nederlands");
add(labelNederlands);
labelNederlands.setBackground(java.awt.Color.orange);
labelNederlands.setFont(new Font("Dialog", Font.PLAIN, 20));
labelNederlands.setBounds(288,72,144,36);
add(woordveld);
woordveld.setBounds(24,108,144,36);
add(invoer);
invoer.setBounds(288,108,144,36);
button1.setLabel("Nieuw Woord");
add(button1);
button1.setBackground(java.awt.Color.lightGray);
button1.setBounds(96,168,120,38);
button2.setLabel("Controleer");
add(button2);
button2.setBackground(java.awt.Color.lightGray);
button2.setBounds(240,192,120,38);
//}}
}
//{{DECLARE_CONTROLS
java.awt.Label labelOverhoor = new java.awt.Label();
java.awt.Label labelEngels = new java.awt.Label();
java.awt.Label labelNederlands = new java.awt.Label();
java.awt.TextField woordveld = new java.awt.TextField();
java.awt.TextField invoer = new java.awt.TextField();
java.awt.Button button1 = new java.awt.Button();
java.awt.Button button2 = new java.awt.Button();
//}}
class SymAction implements java.awt.event.ActionListener
{
public void actionPerformed(java.awt.event.ActionEvent event)
{
Object object = event.getSource();
if (object == button1)
button1_ActionPerformed(event);
}
}
void button1_ActionPerformed(java.awt.event.ActionEvent event)
{
double random;
random = Math.random();
int worp;
worp = (int)(10*random)+1;
String worp1;
worp1 = String.valueOf(worp);
int inv;
inv = worp;
if (inv == 10 ) worp1 = "love";
else if (inv == 9 ) worp1 = "ablaze";
else if (inv == 8 ) worp1 = "mate";
else if (inv == 7 ) worp1 = "attention";
else if (inv == 6 ) worp1 = "feeling";
else if (inv == 5 ) worp1 = "strong";
else if (inv == 4 ) worp1 = "appealing";
else if (inv == 3 ) worp1 = "zest";
else if (inv == 2 ) worp1 = "utterly";
else if (inv == 1 ) worp1 = "reconcile";
invoer.setText(worp1);
invoer.setEditable(false);
}
}