Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Fixed with/heigth ratio for Swing frame ?  RSS feed

 
Michael Boehm
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a quick or "automatic" way to ensure that the ratio height/width for a JFrame is kept constanting after a user resizes the frame or do I have to handcode ?
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there is. Why do you need to keep aspect ratio, if you don't mind me asking?
 
Michael Boehm
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Martin Vanyavchich wrote:I don't think there is. Why do you need to keep aspect ratio, if you don't mind me asking?


I am making a boardgame and thought it would be nice that the ratio always equalled the ratio for the size of a real life board for the game
I think I know how to do it, so no problem anymore.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our GUIs forum.

And please tell us what the solution is, so others can learn. And maybe somebody can improve your solution
 
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!