Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Area of a JFrame  RSS feed

 
Tom Collins
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know how to find the size of the actual viewable area of a JFrame. I'm adding various components to a JPanel without the help of a Layout Manager (long story), and I need to size my buttons relative to the viewable panel area, not to the size of the frame or the user's monitor.

I could really use some help on this.

Thanks.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Container method getInsets for your JFrame.
JFrame dimensions = contentPane dimensions + frame insets

edit: add line 2
[ March 31, 2006: Message edited by: Craig Wood ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!