saplingPro
saplingPro

Reputation: 21329

how to use setResizable method here

enter image description here I am using netbeans as an IDE. how can i set setResizable(false) on JFrame.I dont see the object of JFrame in netbeans.

Upvotes: 1

Views: 4620

Answers (3)

Luigi Plinge
Luigi Plinge

Reputation: 51109

Assuming you've extended JFrame, the easiest way is in the Properties window - there is a property "resizable" in "Other Properties" where you can just untick the box.

Or, in the Source view you will have a constructor - put it there. e.g. if your class name is MyFrame

public class MyFrame extends javax.swing.JFrame {

    /** Creates new form MyFrame */
    public MyFrame() {
        initComponents();
        setResizable(false); // insert this line
    }

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240996

Generally we entend JFrame to create a Frame.

  • Check in your code if it extends , then just call setResizable(false);

Upvotes: 1

Prince John Wesley
Prince John Wesley

Reputation: 63708

Just call setResizable(false); in non static methods of the class. From the image

setDefaultCloseOperation(javax.swing.WindowConstants.ExIT_ON_CLOSE);

It is a clear indication that you have already extends the JFrame class.

Upvotes: 2

Related Questions