wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JPopup That Looks Like ToolTip Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPopup That Looks Like ToolTip" Watch "JPopup That Looks Like ToolTip" New topic
Author

JPopup That Looks Like ToolTip

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Has anyone been able to or seen a Tooltip that you can click on like a JPopup Menu, or has anyone been able to make a JPopup Menu look like a Tooltip?
I hope that makes sense.


GenRocket - Experts at Building Test Data
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
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
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

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.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

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?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Chantal Ackermann
Ranch Hand

Joined: Sep 28, 2000
Posts: 508
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPopup That Looks Like ToolTip
 
Similar Threads
Jlist on Popupmenu
Tool Tips
JTooltip works on 2000Pro but not 2000Server or XP
Pop up a message
JPopUp