import java.awt.*;
import java.awt.event.*;
public class MoveExample {
public static void main (String args [])
{
new Hua_Rong_Road() ;
}
}
class Person extends Button implements FocusListener
{
int number ;
Color c = new Color(255, 245 ,170);
Person (int number ,String s )
{
super (s);
setBackground (c);
this.number = number ;
c = getBackground();
addFocusListener(this);
}
public void focusGained (FocusEvent e )
{
setBackground (Color .red);
}
public void focusLost(FocusEvent e )
{
setBackground (c);
}
}
class Hua_Rong_Road extends Frame implements MouseListener,KeyListener,ActionListener
{
Person person [] = new Person [10];
Button left,right ,above,below ;
Button restart = new Button ("ÖØпªÊ¼");
public Hua_Rong_Road ()
{
init();
setBounds(100,100,320,360);
setVisible(true);
validate ();
addWindowListener (new WindowAdapter ()
{
public void windowClosing (WindowEvent e )
{
System.exit (0);
}
}
);
}
public void init ()
{
setLayout(null);
add(restart);
restart.setBounds(100,320,120,25);
restart.addActionListener(this);
String name [] = {"²Ü²Ù" ,"¹ØÓð", "ÕÅ·É","Áõ±¸","ÕÔÔÆ", "»ÆÖÒ","±ø" ,"±ø","±ø","±ø"};
for (int k = 0; k < name.length;k++)
{
person[k] = new Person(k,name[k]);