返回列表 發帖
本帖最後由 劉得恩 於 2016-3-26 17:49 編輯
  1. import javax.swing.*;
  2. public class Ch87 {
  3.         private JFrame fm;
  4.         private JLabel lb;
  5.        
  6.         Ch87()
  7.         {
  8.                 fm=new JFrame("dfsdf");
  9.                 lb=new JLabel( new ImageIcon(Ch87.class.getResource("pic/Koala.jpg")) );
  10.                 fm.setVisible(true);
  11.                 fm.setResizable(false);
  12.                 fm.setLayout(null);
  13.                 lb.setBounds(0,0,399,300);
  14.                 fm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  15.                 fm.setBounds(100,100,405,328);
  16.                 fm.add(lb);
  17.         }
  18.         public static void main(String[] args) {
  19.                 new Ch87();

  20.         }
  21. }
複製代碼

TOP

返回列表