• ARCHIVES 
  • » Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [sp

Pages: 1

Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [sp

princez_aiya15
» n00b
FTalk Level: zero
24
0
1969-12-31

Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [sp

Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [spoiler]import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.ButtonGroup; import javax.swing.JMenuItem; public class MenuExp extends JFrame { public MenuExp() { setTitle("Menu Example"); setSize(150, 150); // Define and add two drop down menu to the menubar JMenu fileMenu = new JMenu("File"); // Create and add simple menu item to one of the drop down menu JMenuItem newAction = new JMenuItem("New"); JMenuItem openAction = new JMenuItem("Open"); JMenuItem exitAction = new JMenuItem("Exit"); // Create a ButtonGroup and add both radio Button to it. Only one radio // button in a ButtonGroup can be selected at a time. ButtonGroup bg = new ButtonGroup(); fileMenu.add(newAction); fileMenu.add(openAction); fileMenu.add(exitAction); // Add a listener to the New menu item. actionPerformed() method will // invoked, if user triggred this menu item newAction.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { System.out.println("You have clicked on the new action"); } }); } public static void main(String[] args) { MenuExp me = new MenuExp(); me.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); me.setVisible(true); } }[/spoiler]
nanix84
» SuperFTalker
FTalk Level: zero
7847
0
1969-12-31

Re: Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [sp

Have you tried any IDE like Netbeans? or JBuilder? It's soo easy to generate a code using an IDE :xixi: it was like using a cheat on a game :lol3: jk
  • ARCHIVES 
  • » Please help.. I need to have a Menu Applet using Java codes.. Still a beginner and as to now I can't get a better result using tutorials on such sites.. Thanks a lot to those who'll help.. ^^ [sp

Pages: 1

Board footer

© 2025 F Talk

Current time is 04:24

[ 10 queries - 0.007 second ]
Privacy Policy