- import javax.swing.JFrame;
- import javax.swing.ImageIcon;
- import javax.swing.JLabel;
- import javax.swing.JLayeredPane;
- public class Ch110 {
- private JFrame f;
- private JLabel lb1,lb2,lb3,lb4,lb5,lb6;
- private JLayeredPane ly;
- Ch110()
- {
- lb1=new JLabel(new ImageIcon(Ch110.class.getResource("pic/baby.png")));
- lb1.setBounds(355, 220, 101, 141);
- lb2=new JLabel(new ImageIcon(Ch110.class.getResource("pic/clock.png")));
- lb2.setBounds(420, 15, 106, 106);
- lb3=new JLabel(new ImageIcon(Ch110.class.getResource("pic/girl.png")));
- lb3.setBounds(3-5, 125, 199, 335);
- lb4=new JLabel(new ImageIcon(Ch110.class.getResource("pic/room.jpg")));
- lb4.setBounds(0, 0, 576, 407);
- lb5=new JLabel(new ImageIcon(Ch110.class.getResource("pic/sofa.png")));
- lb5.setBounds(150, 238, 410, 193);
- lb6=new JLabel(new ImageIcon(Ch110.class.getResource("pic/window.jpg")));
- lb6.setBounds(30, 20, 317, 210);
- ly=new JLayeredPane();
- ly.setBounds(0,0,576,407);
- ly.add(lb4,new Integer(1));
- ly.add(lb6,new Integer(2));
- ly.add(lb2,new Integer(3));
- ly.add(lb5,new Integer(4));
- ly.add(lb1,new Integer(5));
- ly.add(lb3,new Integer(6));
- f=new JFrame("\ufcdf\ufede\uc0d8\u098c\u00ff");
- f.setVisible(true);
- f.setResizable(false);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- f.setLayout(null);
- f.setBounds(100, 100,580, 435);
- f.add(ly);
- }
- public static void main(String[] args)
- {
- new Ch110();
- }
- }
複製代碼 |