Feb 11, 2012

[Netbeans] center a JFrame window

1. JFrame properties (right click on JFrame --> properties)
2. code tab  -->  Form size policy --> Generate resize code
3. be sure "Generate center" is checked.
4. close

without GUI,

    private static void createAndShowGUI() {
        //Create and set up the window.
        JFrame frame = new BabyZoo();

        //Display the window.
frame.setLocationRelativeTo(null);   //center the window


  1. I have read your blog its very attractive and impressive. I like it your blog.

    Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

    Java Online Training Java Online Training Core Java 8 Training in Chennai Core java 8 online training JavaEE Training in Chennai Java EE Training in Chennai

  2. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post I would like to read this
    Data Science Training in Chennai
    Data Science course in anna nagar
    Data Science course in chennai
    Data science course in Bangalore
    Data Science course in marathahalli
    Data science course in bangalore