![]() |
Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
greetings i am trying to add a button to a choice menu so that when i click on it will open the window so a user will be able to choose a selection. i can create the button and the chocie menu , but when it comes to the action() event i am not sure what to due. the program fails to complie the way it is. i have tried several public class ChoiceMenu types but still no luck. import java.awt.*; public class Menus extends java.applet.Applet { public void init() { add(new Button("Motorcycles"));
Choice c = new Choice(); c.addItem("1967 Honda NightRider"); add(c); } public boolean action(Event evt, Object arg) { void Bikes(String bname) { if (bname.equals("Motorcycles")) handleChoice(new Choice());
after i name the arg. for the button , and create the new method . i cant find a way to call the arg. i have tried replacing new choice with just arg. that didnt work , then i added (String)arg , again that didnt work. so i would greatly need any help you can give. thank you jerry
Replies: |
Sponsored Links
|