Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I use up all white space around a JPanel?  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the BorderLayout.
When I add components to JPanels and
then add themto the JDialogs/JFrames
There are heaps of unused spaces.
I want to use them up, making
the JPanels/JComponents as tall and as wide as possible.
How do I achieve that?
Thanks
Jack
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JFrame's pack()?
 
Randall Twede
Ranch Hand
Posts: 4683
8
Java Scala
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
consider using pack()

I want to use them up, making
the JPanels/JComponents as tall and as wide as possible.


if that is really what you want, look at some of the other layouts(grid layout in particular)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!