• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

General Question on setting JFrame size

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??:

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79506
379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This woiuld fit better in our GUIs forum: moving.

Have you read the Java™ Tutorials section?
 
reply
    Bookmark Topic Watch Topic
  • New Topic