Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to set the size of a form in java
How to set the size of a form in java
//The code is as follows:

******************************************************

//ButtonTest.java

Import? Java . awt . flow layout;

Import? javax . swing . jbutton;

Import? javax . swing . jframe;

Public? Class? ButtonTest? Extension? JFrame? {

Public? ButtonTest()? {

This.setLayout (new? FlowLayout());

For what? (int? Me? =? 1; ? Me? & lt=? 1 1; ? i++)? {

This.add (new? JButton ("button"? +? I));

}

this.setBounds(200,? 100,? 300,? 200);

this . set visible(true);

this . setdefaultcloseoperation(JFrame。 EXIT _ ON _ CLOSE);

}

Public? Static electricity Invalid? main(String[]? args)? {

ButtonTest? bt? =? New? button test();

}

}

******************************************************

The operation interface is as follows: