Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 ...
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Adding multiple JPanels  RSS feed

Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good Evening Everyone, I hope this is a simple question for everyone. I am creating an application using the tabbed pane. Each Tab will have multiple panels. I have successfully produced multiple panels on my first tab within my main java file using a constructor with no problems. Yet, with the complexity of the GUI, I would rather create a more organized way of writing and reading this code then listing all the GUI in one file. I want to create separate classes - one class for each tab, yet I can't seem to add them to my tab in the first file.

my first tab, called Overview, I created a class file:

Inside my main java file, I created an overviewPanel object:

Finally I added it to the tabbed pane inside my constructor:

Yet, now I can't get the panels inside the overviewPanel class to show on the tab. I am expecting something simple I am missing, but I just can't seem to find it. Can someone help me out?

Posts: 59726
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you seen the appropriate Java™ Tutorials section?
Why are you subclassing JPanel? That is usually not necessary.There are all sorts of things you haven't told us. Are you adding anything else to those panels? Remember that a panel doesn't look like anything until you add something to it, or draw something on it, which would necessitate subclassing JPanel. What layout are you using? Please supply more details, so we can actually help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!