Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPopupMenu - setSelected(JMenuItem)  RSS feed

 
Julie de Wet
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create a JPopupMenu - menu, add two JMenuItems - a and b, and then set b to be selected i.e. menu.setSelected(b), but when I call menu.show(...), a is always shown as being selected, even though when I call menu.getSelectionModel.getSelectedIndex() it returns 1 !!
What am I doing wrong ?
 
John Wetherbie
Rancher
Posts: 1449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Julie BBBB,
Please change your displayed name to follow the <a href="http://www.javaranch.com/name.jsp" target="_blank">JavaRanch naming policy</a>. You can do this <a href="http://www.coderanch.com/forums/user/edit" target="_blank">here</a>.
Thanks.
BTW, posting your code will probably help people to help you with your problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!