Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

layered Pane issues  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm trying to set one JPanel into JLayered Pane. I've tried everything I found in google but still no working. I want this new JPanel to be added to the JLayered Pane when the useres click a JMenu. Can someone give me some tips to get this done? Thanks in advance for your help
 
Marshal
Posts: 60124
188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch
We usually discuss that sort of question in our Swing forum. Moving.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you adding the JPanel? Have you set the depth? If not please go though this http://java.sun.com/docs/books/tutorial/uiswing/components/layeredpane.html
If yes, can you please show us your code where you are adding the JPanel?
 
Marco Salazar
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm creating my GUI using the drag &drop option from netbeans and it generates the code automatically. Btw, the Jpanel I'm trying to add is from other class.
Here is the code I have, thnx a lot for all your help. Also I try the link you gave me but it didn't work.

 
Sheriff
Posts: 21458
96
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Marco Salazar wrote:I'm creating my GUI using the drag &drop option from netbeans and it generates the code automatically.


Quit doing that immediately. You'll learn absolutely nothing that way, and the code created by your IDE is usually quite horrendous to read.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!