Window Design

Experimental procedure:

import java.awt.Font;
in javax.swing Import. * ;
 public  class JL {
 public  static  void main (String [] args) {
 // method TODO automatically generated stubs 
the JFrame Frame = new new the JFrame ( " CV " ); // Create form 
the JPanel P = new new JPanel (); // create a panel 
frame.add (p);
frame.setResizable ( to false ); // not form drag 
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
frame.setBounds(500,300,560,340);
 
Field1 JTextField = new new JTextField (); // create a text box 
p.add (Field1);
Field2 JTextField = new new JTextField (); // create a text box 
p.add (Field2);
Field3 JTextField = new new JTextField (); // create a text box 
p.add (Field3);
Field4 JTextField = new new JTextField (); // create a text box 
p.add (Field4);

L1 the JLabel = new new the JLabel ( " Name: " ); // create labels 
p.add (L1);
L2 of the JLabel = new new the JLabel ( " Gender: " );
p.add(L2);
JLabel L3=new JLabel("学院:");
p.add(L3);
L4 the JLabel = new new the JLabel ( " Birthday: " );
p.add(L4);
L5 of the JLabel = new new the JLabel ( " Professional: " );
p.add(L5);
L6 the JLabel = new new the JLabel ( " National: " );
p.add(L6);
L7 of the JLabel = new new the JLabel ( " origin: " );
p.add(L7);
R1 JRadioButton = new new JRadioButton ( " male " ); // create a single box 
JRadioButton r2 = new new JRadioButton ( " F " );
R3 JRadioButton = new new JRadioButton ( " Computer Academy " ); // create a single box 
JRadioButton r4 = new new JRadioButton ( "Economics and Management Institute " );
R5 the JRadioButton = new new the JRadioButton ( "Electrospray Institute " ); // create a single box 

the ButtonGroup named group1 = new new the ButtonGroup (); // create a group, r1 and r2 together 
the ButtonGroup group2 = new new the ButtonGroup ();
group1.add(r1);
group1.add(r2);
group2.add(r3);
group2.add(r4);
group2.add(r5);
p.add(r1);
p.add(r2);
p.add(r3);
p.add(r4);
p.add(r5);
frame.add(p);

Box1 JCheckBox = new new JCheckBox ( " Network Engineering " ); // Create a check box 
JCheckBox BOX2 = new new JCheckBox ( "physical " );
BOX3 a JCheckBox = new new a JCheckBox ( "flight attendants " );
Box4 JCheckBox = new new JCheckBox ( "Hotel Management " );
p.add(box1);
p.add(box2);
p.add(box3);
p.add(box4);
frame.add(p);
p.setLayout ( null ); // custom component position 
L1.setBounds ( 110 , 35 , 250 , 25 );
L1.setFont ( new new the Font ( " bold " , Font.BOLD, 15 )); // set assembly position 
L2.setBounds ( 110 , 60 , 90 , 30 );
L2.setFont ( new new the Font ( " bold " , Font.BOLD, 15 ));
L3.setBounds(110,170,340,35);
L3.setFont(new Font("黑体",Font.BOLD,15));
L4.setBounds(110,140,140,25);
L4.setFont ( new new the Font ( " bold " , Font.BOLD, 15 ));
L5.setBounds(100,210,140,25);
L5.setFont ( new new the Font ( " bold " , Font.BOLD, 15 ));
L6.setBounds(110,115,340,25);
L6.setFont(new Font("黑体",Font.BOLD,15));
L7.setBounds(110,90,340,25);
L7.setFont(new Font("黑体",Font.BOLD,15));
r1.setBounds(200,60,90,30);
r2.setBounds(300,60,110,30);
r3.setBounds(170,172,110,40);
r4.setBounds(280,172,115,40);
r5.setBounds(390,172,130,40);
box1.setBounds(170,210,100,25);
box2.setBounds(270,210,100,25);
box3.setBounds(370,210,100,25);
box4.setBounds(470,210,100,25);
Field1.setBounds(170,35,250,22);
Field2.setBounds(170,140,250,22);
Field3.setBounds(170,90,250,22);
Field4.setBounds(170,115,250,22);
frame.setVisible ( to true ); // set the status display window 
}
} 
Experiences: not alone in this process is complete, but still trying to

 

Guess you like

Origin www.cnblogs.com/wlyxjj/p/11073795.html