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

Resolution and Swing  RSS feed

 
Anderson Adolfs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm developing a gui to an application in 1280x1024; but the user can execute the application using 1024x768, or 1400x1150. I'am using null layout to place the components. I wanna know if there any kind of pattern, anyway, to solve this problem ?
Thanks.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution: Use Layout Managers.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wholeheartedly agree with Gregg: the null Layout is evil (as is Borland's XYLayout...).
 
Serghei Jelauc
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be I did not understand your question correctly, but may be it will help:



Now your application does not depend of the user's screen resolution.
[ May 09, 2005: Message edited by: Serghei Jelauc ]
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Surely that still leaves a problem if he is using null layout. The size of the JFrame might change according to the users screen size, but if the components are placed absolutely it still isn't guaranteed to look right.
 
arunkumar sundar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes Better go for gridbag

Thanks
Arunkumar
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by arunkumar sundar:
yes Better go for gridbag


Totally!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!