Thread: problem in java
View Single Post
Old 03-17-2003, 09:32 PM   PM User | #6
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,234
Thanks: 4
Thanked 81 Times in 80 Posts
Spookster will become famous soon enough
Yes you must also define that method. Something like this for example:

PHP Code:

    
public void actionPerformed(ActionEvent event){
      
String menuItemName event.getActionCommand();

        if(
menuItemName.equals("Quit")){
            
System.exit(0);
        }

        else if(
menuItemName.equals("Circle")){
            
whichShape 0;
        }
        else if(
menuItemName.equals("Square")){
            
whichShape 1;
        }
        else if(
menuItemName.equals("Rectangle")){
            
whichShape 2;
        }
        else if(
menuItemName.equals("Arc")){
            
whichShape 3;
        }
    } 
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote