返回列表 發帖
  1. import javax.swing.JFrame;
  2. import javax.swing.JLabel;
  3. import javax.swing.ImageIcon;
  4. public class A90 {
  5.         private JFrame fm;
  6.         private ImageIcon ii;
  7.         private JLabel lb;
  8.         A90(){
  9.                 ii=new ImageIcon(A90.class.getResource("pic/01.jpg"));
  10.                
  11.                 lb=new JLabel(ii);
  12.                 lb.setBounds(0,0,399,300);
  13.                 fm=new JFrame("ImageIcon類別");
  14.                 fm.setBounds(100,100,405,328);
  15.                 fm.setVisible(true);
  16.                 fm.setResizable(false);
  17.                 fm.setLayout(null);
  18.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  19.                 fm.add(lb);
  20.         }
  21.                               
  22.         public static void main(String[] args) {
  23.                  new A90();

  24.         }
複製代碼

TOP

返回列表