Public feed #891656

Mine

public text v1 · immutable
Raw Edit
·published 2008-02-04 20:35 UTC
rendered paste body
/*
	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);
		setSize(426,266);
		button1.setLabel("Ja");
		add(button1);
		button1.setBackground(java.awt.Color.lightGray);
		button1.setBounds(60,168,60,40);
		button2.setLabel("nee");
		add(button2);
		button2.setBackground(java.awt.Color.lightGray);
		button2.setBounds(300,168,60,36);
		label1.setText("Thomas is een goede honkballer");
		add(label1);
		label1.setBounds(144,60,204,60);
		//}}
	
		//{{REGISTER_LISTENERS
		SymMouse aSymMouse = new SymMouse();
		button2.addMouseListener(aSymMouse);
		SymAction lSymAction = new SymAction();
		button1.addActionListener(lSymAction);
		//}}
	}
	
	//{{DECLARE_CONTROLS
	java.awt.Button button1 = new java.awt.Button();
	java.awt.Button button2 = new java.awt.Button();
	java.awt.Label label1 = new java.awt.Label();
	//}}

	class SymMouse extends java.awt.event.MouseAdapter
	{
		public void mouseEntered(java.awt.event.MouseEvent event)
		{
			Object object = event.getSource();
			if (object == button2)
				button2_MouseEntered(event);
		}
	}

	void button2_MouseEntered(java.awt.event.MouseEvent event)
	{
		int xPos = Math.random() *200;
		button2.setBounds(xPos,int,int,int);
	}

	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)
	{
		label2.setText("Dankje");
		add(label2);
		label2.setBounds(12,12,144,60);
	}
}