flash animation video tutorials

 

 

 

 

 

START LEARNING
FLASH NOW

Get instant access to over
45 minutes of FREE Flash tutorials on video
 and our newsletter.

Name:
E-Mail:

.

.

.

 
Web video-animation.com

.

.

flash tutorials flash tutorials flash tutorials flash tutorials

Java Basic Button Action

import java.applet.*;
import java.awt.*;
import java.awt.event.*;

public class ClickButton extends Applet implements ActionListener{
	// declare a textfield and Button
	TextField text1;
	Button button1;
	// initialise the applet
	public void init(){
		// set the textfield to 30 characters
		text1 = new TextField(30);
		// add the textfield to the applet
		add(text1);
		// initialise button and set its label
		button1 = new Button(" click me");
		// add button to the applet
		add(button1);
		// set the actionlistener to the button
		button1.addActionListener(this);
	}
	// methods needed for actionlistener Interface
	public void actionPerformed(ActionEvent e){
		// declare and initialise a string to be shown
		String message = " You clicked the button. woo hoo";
		// if the source of the action is the button 
		// ie if the button is clicked
		if(e.getSource() == button1){
			// set the text of the textfield to our message
			text1.setText(message);
		}
	}
}
  
 

Flash Tutorials in Video Format - Watch them now at LearnFlash.com  

And here is the html code to run it, just as a reminder.

 <html>
<body>
<applet code="ClickButton.class" width="300" height="300">
</applet>
</body>
</html>
 

flash 8
.