Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPopupMenu Questions  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 questions.
1. Is there a way to put some HEADER text at the top of a JPopupMenu?
2. I need to adjust my mouseListener so that if I right click on an item in my list, it selects the item. Does anyone know how to do this?
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, got the Right Click selection part of my question.

[ November 21, 2002: Message edited by: Gregg Bolinger ]
[ November 21, 2002: Message edited by: Gregg Bolinger ]
 
Bill Liteplo
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use JMenu.add(Component c) to add any component to a Menu. Create a JPanel with a label, set up the sizes/colors, and ther you go.
Bill
p.s. Here you go: aeiou(y)
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!