| Author |
How add JLabels as headers for JPopupMenu's menuitem sections?
|
Dan Bizman
Ranch Hand
Joined: Feb 25, 2003
Posts: 387
|
|
I know that menuitems in a JPopupmenu can be separated by addSeparator(), but I also want to be able to set headers/titles for those sections. So you'd get something like: FILE OPTIONS - Open File - Delete File PROPERTY OPTIONS - Rename - View Properties Is there a way to do this?
|
 |
Dan Bizman
Ranch Hand
Joined: Feb 25, 2003
Posts: 387
|
|
|
Is this possible? Or do I have to extend JPopupMenu
|
 |
Gregg Bolinger
Ranch Hand
Joined: Jul 11, 2001
Posts: 15230
|
|
|
I don't know of anyway of going that without rolling your own, other than possibly adding a JMenuItem that doesn't have an action attached to it.
|
 |
Tim LeMaster
Ranch Hand
Joined: Aug 31, 2006
Posts: 226
|
|
You mean like this?
|
 |
 |
|
|
subject: How add JLabels as headers for JPopupMenu's menuitem sections?
|
|
|