aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Changing JButton positions relative to screen size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Changing JButton positions relative to screen size" Watch "Changing JButton positions relative to screen size" New topic
Author

Changing JButton positions relative to screen size

Andy Powell
Greenhorn

Joined: Apr 18, 2010
Posts: 20
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

Joined: Jun 09, 2003
Posts: 4632
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

Joined: Apr 18, 2010
Posts: 20
Thank you very much. That is very helpful
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Changing JButton positions relative to screen size