Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fixed with/heigth ratio for Swing frame ?

 
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
Pie
Posts: 49776
69
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic