Reputation: 21329
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
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
Reputation: 240996
Generally we entend JFrame to create a Frame.
Upvotes: 1
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