class MyControl{ String status = "Move"; Button bmove; //three buttons Button brotate; Button bscale; MyControl(){ bmove = new Button("Move"); //create the buttons brotate = new Button("Rotate"); bscale = new Button("Scale"); add(bmove); //add them to the screen add(brotate); add(bscale); //make the buttons inteactive bmove.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { status = bmove.getLabel(); println("button = " + bmove.getLabel()); } } ); brotate.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { status = brotate.getLabel(); println("button = " + brotate.getLabel()); } } ); bscale.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { status = bscale.getLabel(); println("button = " + bscale.getLabel()); } } ); } }