- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.ImageIcon;
- public class ch81
- {
- private JFrame fr;
- private JLabel la;
- private ImageIcon ii;
- ch81()
- {
- ii=new ImageIcon(ch81.class.getResource("01.jpg"));
- la=new JLabel(ii);
- la.setBounds(0, 0, 399, 300);
- fr=new JFrame("何花");
- fr.setBounds(100, 100, 405, 328);
- fr.setVisible(true);
- fr.setResizable(false);
- fr.setLayout(null);
- fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- fr.add(la);
-
- }
- public static void main(String[] args)
- {
- ch81 app=new ch81();
- }
- }
複製代碼 |