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

General Question on setting JFrame size  RSS feed

 
Ted Schrey
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First lesson example uses the following to set JFrame size (where f is JFrame Object variable):



Is that better than a simple??:

 
ab singh
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If we use any layout manager then using setSize() method lead to expansion and contraction of the component of the Jframe and in other hand if we use SetPreferred () method just set the size of component which effect the direct container.Its all depend upon use of Layout Manager. Just try both method with Different Layouts. You will get to know the difference after resizing the JFrame
For more information refer to JFrame API
 
Campbell Ritchie
Marshal
Posts: 55680
161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This woiuld fit better in our GUIs forum: moving.

Have you read the Java™ Tutorials section?
 
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!