Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jpanel not displayed

 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

in a class i do



code of this class


nothing is displayed... any idea?

thanks
 
Moojid Hamid
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need a "Top-Level Container"
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and you also need to add the tabbedPane to its container (the class TestPanel)
 
mark smith
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok so every jpanel need to be added in a jframe?
 
Rob Spoor
Sheriff
Pie
Posts: 20606
60
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or another control like a second JPanel, a JTabbedPane or a JScrollPane. But in the end, all controls must be directly or indirectly added to a (J)Frame, (J)Dialog, (J)Window or (J)Applet.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic