Menu Bar, Menus, Menu Items and Listeners

This chapter provides tutorial notes and example codes on menu bar, menus and menu items. Topics include introduction to JMenuBar, JMenu, and JMenuItem classes; test programs of menu bar, menus and menu items; using radio button and check box menu items; using menu, item, and action listeners; using mnemonics and accelerators on keyboard.

JMenuBar, JMenu, and JMenuItem Classes

JMenuBarTest.java - Menu Bar Test Program

JMenuTest.java - Menu Test Program

JMenuItemTest.java - Menu Item Test Program

JRadioButtonMenuItemTest.java - Radio Button Menu Item Test Program

JCheckBoxMenuItemTest.java - Check Box Menu Item Test Program

javax.swing.event.MenuListener - Menu Listener Interface

MenuItemActionListenerTest.java - Menu Item Action Listener Test

Item Listener on Radio Button Menu Items

Item Listener on Check Box Menu Items

javax.swing.event.MenuKeyListener - Menu Key Listener Interface

setMnemonic() - Setting Keyboard Mnemonics on Menu Items

setAccelerator() - Setting Keyboard Accelerators on Menu Items

setMnemonic() - Setting Keyboard Mnemonics on Menus

Table of Contents

 About This Book

 Introduction of Java Swing Package

 Graphics Environment of the Local System

 JFrame - Main Frame Class

 JLabel - Swing Label Class

 JButton - Swing Button Class

 JRadioButton - Swing Radio Button Class

 JTextField - Swing Text Field Class

Menu Bar, Menus, Menu Items and Listeners

 Creating Internal Frames inside the Main Frame

 Layout of Components in a Container

 LookAndFeel and UIManager

 Option Dialog Boxes

 JEditorPane - The Editor Pane Class

 SwingWorker - The Background Task Worker

 References

 PDF Printing Version