Monday, 9 June 2014

How to center a jFrame on Screen - NetBeans

If you run your application it will display on upper-left corner on your screen(Default). You can set the center positions on source code, but here I'll show you the simple method to center it.

First go to the properties window of your jFrame.
Select Code view.

In code view Form size policy settings default value is Generate pack().



Select Generate Resize Code.



Now bellow settings will be changed.



Tick the Generate Center option, it will unchecked the Generate Position option.

Close the properties window and run the application.


Enjoy coding!...
If you have any questions pls feel free to ask :)







No comments:

Post a Comment