The glass pane, which is used in Java, is useful, when you want to be able to catch events or paint over an area that already contains one or more components.
Questions tagged [glasspane]
101 questions
3
votes
1 answer
JRootpane - setting glasspane to visible doesnt intercept mouse events
I have a JFrame and a JPanel hierarchy inside it, i want to implement an inner panel that i can make it look "disabled"(while other panels dont change), that is, to cover it by a semi transparent gray layer and intercept all mouse and perhaps even…

Ofek Ron
- 8,354
- 13
- 55
- 103
3
votes
1 answer
Why is paintComponent() continuously and asynchronously being called without explicit repaint() call?
So this question has two parts, which I think may be related, and it's mostly abstract. Briefly, here's what I'm doing:
I have a JFrame with a JPanel and some child JPanels each with 3 JButtons on it. I also created a JComponent called glassPanel…

Alex Silverman
- 183
- 1
- 5
- 18
3
votes
3 answers
How to click through JGlassPane With MouseListener to UI behind it
I have a JFrame and a bunch of JComponents on top of the JFrame.
I need to make use of the JGlassPane and I used this implementation to set it up.
JPanel glass = new JPanel();
frame.setGlassPane(glass);
glass.setVisible(true);
…

Sammy Guergachi
- 1,986
- 4
- 26
- 52
3
votes
4 answers
Showing GlassPane before entering loop
(In my applicaton with Swing GUI) I want to display GlassPane during some work performed in a loop or method, which is called after clicking JButton.
For example:
(action performed after clicking a button)
if (item.equals(button)) {
…

TV.
- 232
- 1
- 3
- 14
3
votes
3 answers
GlassPane is not showing up on JFrame
I have been trying to implement a GlassPane for my games' in-game HUD, but right now I cant seem to get the JFrame to set my GlassPane as its own i;ve used setGlassPane() and Ive been reading up a few examples trying to find my mistake, but nothing.…

David Kroukamp
- 36,155
- 13
- 81
- 138
2
votes
2 answers
Java Glass Pain (that wasn't a typo)
I had a different problem first, so I made this post:
Java JPanel mouse listener doesn't work over its components
The answers led me to arrive at a java GlassPane. I saw the other posts on SO about this and they all point to this…

Ozzy
- 8,244
- 7
- 55
- 95
2
votes
3 answers
For glasspane purposes, why are input elements in Swing seemingly not considered part of a JPanel?
By input elements I mean things like JSpinners and JComboxBoxes. My glasspane is passed a JPanel containing JSpinners, JComboBoxes and for the most part, JLabels. The glasspane has a MouseListener attached. The surprising thing is that mouseEntered…

Arvanem
- 1,043
- 12
- 22
2
votes
1 answer
Java GUI, creating piano keys using JButton
I'm trying to create a simple piano application using Java, and I'm stuck at creating the keys.
So what I have is a bunch of (Black) JButtons on top of (White) JButtons, but whenever I click the white buttons, it covers the black buttons.
So my…

Kevin D.
- 1,500
- 1
- 18
- 41
2
votes
2 answers
Creating glasspane
I have a question. Can I create glasspane in body MousePressed ? If yes anyone can write me how? I mean that I press mouse button and glass pane is visible and I can painting on him.
EDIT
Ok I have now what I want. My glass pane is creating when I…

edi233
- 3,511
- 13
- 56
- 97
2
votes
0 answers
GlassPane dispatch mouse events correctly
I am using a GlassPane to move elements in my frame. When there is no element dragged all mouse events are dispatched by the normal way
public class MainFrame implements MouseListener {
private JFrame frame;
public MainFrame()
{
frame = new…

Thallius
- 2,482
- 2
- 18
- 36
2
votes
3 answers
Get Location of JTable Header in JFrame
Here is an image of my application:
As you can see, there is a JTable in there. I need to get the location of the headers of the JTable relative to the JFrame that it is in.
Why might I be doing this? I am adding a help feature that explains what…

user489041
- 27,916
- 55
- 135
- 204
2
votes
1 answer
GlassPane behaves weird
I created a JPanel inside it i put a JCheckBox and two buttons:
when checkbox is checked a glassPane with transparent color (alpha = 100) is showed above the panel and contains a label displaying the String "Loading...", the problem is that the…

Naruto Biju Mode
- 2,011
- 3
- 15
- 28
2
votes
1 answer
What kind of voodoo is necessary to get the glassPane visible and valid for an JInternalFrame?
I have a project where I use JDesktopPane for the main application and a bunch of JInternalFrames for a series of independent analyses.
Certain bits of the analyses are time-consuming thus I run them on SwingWorkers, but I would like to both…

posdef
- 6,498
- 11
- 46
- 94
2
votes
1 answer
Why doesn't GlassPane work with JDIC's WebBrowser?
I have the following program to test GlassPane, but it doesn't work with JDIC's WebBrowser. Does anyone know what I did wrong and how to make it work?
import org.jdesktop.jdic.browser.*;
import java.awt.*;
import java.awt.event.*;
import…

Frank
- 30,590
- 58
- 161
- 244
2
votes
2 answers
Secure Desktop Mode effect for java application
Does anyone now how to achieve a "Secure-Desktop Mode" (effect) such as one gets from the Windows Vista/7 UAC consent-blocks?
I assume it is some function which will remove pixels here-and-there (and possibly graying them) and then finally drawing…

Aiden Strydom
- 1,198
- 2
- 14
- 43