• Post Reply Bookmark Topic Watch Topic
  • New Topic

adding JDesktopPane to JPanel  RSS feed

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've added a JDesktopPane to a JPanel, and nothing is showing up. Just a big line. What i have is a Panel covering the entire frame. Then a couple panels thrown onto of the mainpanel. i also wanted to add a JDesktopPane in there. But its not looking to good. any ideas?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the desktopPane needs to have a preferredSize specified, or set a layoutManager
for the panel where the desktopPane will occupy all of the space
new JPanel(new BorderLayout());//default = CENTER
or
new JPanel(new GridLayout(1,1));
 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i was using gridbaglayout for the layout manager. The problem seems to be that its not resizing, nor is anyone of the rest of the application resizing. Yet when i take off the jdesktopPane everything resizes again. any ideas?

thanks in advance,
chris dancy
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gridbaglayout = post your code
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!