This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
hi Gregg, the point of a tooltip is, that when you click on it, it disappears?! why don't you want to use the "normal" popup menu? is it, because you don't need a menu but some other component? say a JLabel? I think this is a problem that pops up ( ) if you need a big menu where scrolling would be handy and you realize that the JPopupMenu somehow don't seem to have scrolling (or at least that was my experience). The SpeedJava plugin that comes with JEdit (= open source) has scrollable pop ups (& is fast). so this could be a good start to look for a solution (not only on scrolling but how to get any component into a popup). cheers
I don't want to use a normal JPopupMenu because it is bulky and doesn't mesh well with the rest of my application. I don't need it to scroll, I just want a slimmer, more sleak popup menu. A popup menu that LOOKS like a Tooltip would be great. Just don't know how to go about acheiving that without repainting the JPopup menu myself.
What do you mean when you say you want a JPopupMenu that looks more like a Tooltip? Do you want a smaller font? different color? Extra text that can't be clicked on?
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Joined: Sep 28, 2000
that might not be the cleanest way but... you could just use the ToolTipUI for layout out your PopupMenu in some way, like creating your own MyPopupMenuUI. Maybe it would work with some copy-pasting of source code. but first you would have to make sure what is painted by ToolTipUI and what else by JToolTip. (I only know of JTableHeader that it does more actual layouting than TableHeaderUI.) or (on second thought) you try to change the behaviour of JToolTip to that of a popup menu. cheers