Programming Examples

Are you a Programmer or Application Developer or a DBA? Take a cup of coffee, sit back and spend few minutes here :)

Tag Archive for ‘JMenu’

JCheckBoxMenuItem & Checked

Java Swing JCheckBox MenuItem Example

The example has a menu called fruits. When the user clicks the Fruits menu, they can see four Checkbox menu items along with Image Icons. At the bottom of the screen, there is a text field which reports all the checked check boxes. In the above picture, Banana & Cherry check boxes are checked and hence the text field shows Banana and Cherry in it. When the user clicks a menu item, a check mark appears in the check box, and it disappears when the user clicks it again.

Continue Reading →

JMenuBar, JMenu, JMenuItem

Java Swing JMenu, JMenuItem - Example

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.

Continue Reading →