返回列表 發帖
  1. mport javax.swing.JFrame;
  2. import javax.swing.JLabel;
  3. import javax.swing.ImageIcon;
  4. public class Ch0a{
  5.         JFrame fm;
  6.         JLabel lb;
  7.         
  8.         Ch0a()
  9.         {
  10.                 lb=new JLabel(new ImageIcon(Ch0a.class.getResource("pic/1.jpg")));
  11.                 lb.setBounds(0,0, 300, 300);
  12.                
  13.                 fm=new JFrame("馬里苟斯!!!");
  14.                 fm.setBounds(100, 100, 305,325);
  15.                 fm.setResizable(false);
  16.                 fm.setVisible(true);
  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 Ch0a();
  24.         }
複製代碼

TOP

返回列表