• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JLayeredPane does not show up in JPanel with GridBagLayout

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just tried the code, added necessary labels, and frame extras, and all worked fine.

problem might be in something not posted.
 
Ruchi Kumctr
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if it makes a difference, but JPanel (panelTop) is in a JSplitPane.
 
Ruchi Kumctr
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevermind. My JLayeredPane height was bigger than the actual JPanel height so it did not show up.

Thanks for the help.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic