my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes Customising JToolTip / using JFrame? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Customising JToolTip / using JFrame?" Watch "Customising JToolTip / using JFrame?" New topic

Customising JToolTip / using JFrame?

Trisha Murphy

Joined: Sep 19, 2002
Posts: 13
Hi I have a Java Application and I want to create a tooltip similar to what you see on some windows applications when you click on a link. It looks like a tooltip but the box doesn't go away until you click on an area outside it or if you press the x button in the top right corner.

Can someone put me in the right direction please? I had a look into Tooltips but couldn't see anything other than changing the background / foreground and multiline tips.
Should I use a JFrame and have a mouselistener on the application?
How do I make it look more like a tooltip than a Frame? i.e. remove the title bar and the minimise / maximise buttons?

all suggestions appreciated!

Tommy Greenberg

Joined: Jul 30, 2004
Posts: 15
The only other thing I can think of is a JPanel. You might want to start there. I am not sure what your trying to do with the whole tool tip thing, but the JPanel is a blank panel with no min, max, or close buttons. Also, i am not sure if you know this but all the extend classes of JComponent have a setToolTip() method, which is probably a lot eaiser than writing one yourself.
clio katz
Ranch Hand

Joined: Apr 30, 2004
Posts: 101
two suggestions:

(1) have you looked at Sun's JavaHelp? I haven't used it, it looks involved, but might work if you need a heavy-duty/long-term solution.

(2) Daniel Brookshier wrote an interesting approach to "Building a Status-Bar Help Bean". It's interesting reading even if you don't go that route. The design could be adapted for another component like a Dialog...

Good Luck!
I agree. Here's the link:
subject: Customising JToolTip / using JFrame?
It's not a secret anymore!