aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JLayeredPane does not show up in JPanel with GridBagLayout Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JLayeredPane does not show up in JPanel with GridBagLayout" Watch "JLayeredPane does not show up in JPanel with GridBagLayout" New topic
Author

JLayeredPane does not show up in JPanel with GridBagLayout

Ruchi Kumctr
Greenhorn

Joined: May 18, 2012
Posts: 8
I am trying to place a loading circle (Image in a JLabel (lblImage)) on top of an image (Image in a JLabel (lblDndImage)) in a JPanel with GridBagLayout (panelTop). lblImage and lblDndImage are both set elsewhere. When I change the panelTop (JPanel) to a BoxLayout, both images show up, but in the GridBagLayout, they do not show up. What am I doing wrong or missing? I have even tried placing the JlayeredPane in a Jpanel with BoxLayout, and placing that in my final JPanel (panelTop), but it does not work.

Basic code is:

Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
just tried the code, added necessary labels, and frame extras, and all worked fine.

problem might be in something not posted.
Ruchi Kumctr
Greenhorn

Joined: May 18, 2012
Posts: 8
Not sure if it makes a difference, but JPanel (panelTop) is in a JSplitPane.
Ruchi Kumctr
Greenhorn

Joined: May 18, 2012
Posts: 8
Nevermind. My JLayeredPane height was bigger than the actual JPanel height so it did not show up.

Thanks for the help.
 
Don't get me started about those stupid light bulbs.
 
subject: JLayeredPane does not show up in JPanel with GridBagLayout