This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

about JMenu

 
Lei Xiaowen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I have definite a JMenu,it have three JMenuItem.Each JMenuItem has a
Listener.
My question is how to write the code of Listener?
 
Constanze Michaelis
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
which Listener do you use?

regards
Constanze
 
Lei Xiaowen
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
//
1. JMenu menuInfo=new JMenu();
2.mainMenu.add(menuInfo);

3. JMenuItem itemShow=new JMenuItem("信息综合管理");
4. itemShow.addItemListener(ItemListener I);
5. menuInfo.add(itemShow);

at line 4 "add ItemListener "is wrong,why?
the correct code is what?
thanks a million!
 
Constanze Michaelis
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
does your class implement the ItemListener?
in my menu i took the ActionListener, because MenuItems fires Action Events.
here having example what i would write


hope this helps
regards
Constanze
[ July 12, 2005: Message edited by: Constanze Michaelis ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic