Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing JButton positions relative to screen size

 
Andy Powell
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm fairly new to the GUI stuff in java but I'm wondering how I can get positions of JButtons within a frame to change with the screen size so that
they are always in the same place relative to the sizes. If you get what I mean, I'm finding it hard to explain.

At the moment i've just got 2 buttons on a frame next to each other. When I make it fullscreen the buttons are way over to the left.

Thanks in advance
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sounds like you are using absolute postioning, or null layout, or perhaps an IDE generated layoutManager

study the various layoutMangers, and use the one best suited to your requirements

http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html
 
Andy Powell
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. That is very helpful
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic