• Post Reply Bookmark Topic Watch Topic
  • New Topic

Glasspanes and tooltips

 
Per Pettersson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm having a problem with components' tooltips not being rendered correctly when those components are on a glass pane.

What I want to accomplish is this:

I have a JFrame, full of different components. (A huge GUI really.)
On top of this, I want to put a glass pane with a transparent black background.
On the glass pane, I want to show a JPanel with some stuff on it, e.g. JButtons with tooltips.

More or less, I want it to work the same way as a modal dialog, except being a little sexier.

It all works fine, except for the tooltips. It appears that they are rendered beneath the glass pane. I of course want them to show up as if the panel displayed on the glasspane was in its own frame - meaning above everything else.

Is there any way I can make this work the way I want to?

The following code captures the essence of what I'm doing:
tooltip.png
[Thumbnail for tooltip.png]
The tooltip is rendered beneath the glass pane.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try adding the indicated line


 
Per Pettersson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the tip (heh), but I'm afraid it doesn't help very much.
It makes a little bit of difference though: with heavyweight tooltips, they seem to be rendered above the translucent black background (good), but it's still behind the panel I place on the glass pane (bad).
tooltip2.png
[Thumbnail for tooltip2.png]
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
worked fine for me, java 1.6 vista

 
Per Pettersson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, sorry for not replying for so long.

I thought I got around the problem by using a layered pane instead of a glass pane, but that has introduced another problem I'm not able to find my way around (at least not yet). But that's a different issue.

What flavour of Vista and what Java version do you have? I also use Vista (Business 32-bit SP1) and Java 1.6.0 update 15, and the heavyweight hack doesn't work for me. It works for colleague of mine though, who's running XP and the same Java version as I. So... it really seems quite unpredictable! Maybe the behavior isn't defined and we really can't expect it to work?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> What flavour of Vista and what Java version do you have?

vista home premium, java 1.6.0_15
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!