2. Using JMenu With JFrame
javax.swing.JMenuBar
• JMenuBar()
• JMenu add(JMenu)
• JMenu getMenu(int) //index
• int getMenuCount()
javax.swing.JMenu
• JMenu()
• JMenu(String) //caption
• void add(JMenuItem) //appends at end
• void addSeparator()
• JMenuItem insert(JMenuItem, int)//position
• void setMnemonic(int) // mnemonic from a to z and A to Z
Instructor: Tanzila Kehkashan
2
3. Using JMenu With JFrame
javax.swing.JMenuItem
• JMenuItem()
• JMenuItem(String) //text
• JMenuItem(String, int) //caption text, keyboard mnemonic from A to Z
• JMenuItem(String, ImageIcon)
• JMenuItem addActionListener(component)
• void setMnemonic(int) // mnemonic
java.awt.event.KeyEvent (Mnemonics integer constants)
• For reference ;open Lecture # 12, Slide # 4
Instructor: Tanzila Kehkashan
3