| Author |
NetBeans SingleFrameApplication size and loction
|
Saeed Anwar
Greenhorn
Joined: Nov 17, 2008
Posts: 5
|
|
How can I fix size and location (center on screen) for a swing application developed using Netbeans 6.1 This is a SingleFrameApplication. Frame view at runtime is different than that I see in design view. Thanks a lot for your help.
|
 |
Vadiraj Deshpande
Ranch Hand
Joined: Aug 16, 2000
Posts: 78
|
|
HI Saeed, You have to center your JFrame programmatically. At the end of the JFrame constructor use this code : This code uses the java.awt.Toolkit to get the screensize and adjusts the location of the JFrame to align the midpoints of JFrame with screen midpoints. -Vadiraj.
|
 |
Saeed Anwar
Greenhorn
Joined: Nov 17, 2008
Posts: 5
|
|
Hi Vadiraj, Thanks a lot for the help. Code you provided works fine. However, I found another way as following which does not require any awt components and also provides a way for fixing window size. Thanks a lot for your help.
|
 |
Martin Modl
Greenhorn
Joined: Dec 07, 2010
Posts: 1
|
|
|
.
|
 |
 |
|
|
subject: NetBeans SingleFrameApplication size and loction
|
|
|