This example has a fruits menu and a JLabel in the JFrame. The fruit menu contains four Radio button menu items and the user can pick only one among them. In the JLabel, the example displays what menu item is picked by the user. Now, let us create this example.
Tag Archive for ‘JMenuBar’
This example has a JMenuBar with two JMenu in it. The menus are File and Edit. File Menu has 4 MenuItems which include a JSeparator. This separator is separating Open, Save menu items with the Exit menu items. When you click Open MenuItem under the File Menu, a dialog will be displayed. This helps us to learn how to respond to the Menu Item click event. The Edit menu has 3 Menu Items. Now let us code this example.