Return to Snippet

Revision: 4117
at October 25, 2007 12:08 by mehlam2


Initial Code
public void setMnemonics(){

   String []menuTitle = {"File","Edit","Search","Tools","Help"};
   char[] mnemonic = {'F','E','S','T','H'};
   JMenu []menu = new JMenu[menuTitle.length];
   for(int i=0; i<menuTitle.length; i++){
      menu[i] = new JMenu(menuTitle[i]); 
      menu[i].setMnemonic(mnemonic[i]);
      menu[i].setBackground(darkerBlue);
      add(menu[i]);
   }
}

Initial URL

                                

Initial Description

                                

Initial Title
MenuBar Mnemonics

Initial Tags
java

Initial Language
Java