Posted By


mehlam2 on 10/25/07

Tagged


Statistics


Viewed 537 times
Favorited by 0 user(s)

MenuBar Mnemonics


/ Published in: Java
Save to your folder(s)



Copy this code and paste it in your HTML
  1. public void setMnemonics(){
  2.  
  3. String []menuTitle = {"File","Edit","Search","Tools","Help"};
  4. char[] mnemonic = {'F','E','S','T','H'};
  5. JMenu []menu = new JMenu[menuTitle.length];
  6. for(int i=0; i<menuTitle.length; i++){
  7. menu[i] = new JMenu(menuTitle[i]);
  8. menu[i].setMnemonic(mnemonic[i]);
  9. menu[i].setBackground(darkerBlue);
  10. add(menu[i]);
  11. }
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.