[Java] 窗体 →→→→→进入此内容的聊天室

来自 , 2020-05-21, 写在 Java, 查看 151 次.
URL http://www.code666.cn/view/d8211837
  1. package example17_1;
  2. import java.awt.FlowLayout;
  3.  
  4. import javax.swing.*;
  5. public class example17_1 extends JFrame{
  6. public static void main(String[] args) {
  7.         example17_1 frame = new example17_1();
  8.         frame.setVisible(true);
  9. }
  10. public example17_1(){
  11.         super();
  12.         setTitle("窗体");
  13.         setBounds(100,100,500,375);
  14.         getContentPane().setLayout(null);
  15.         setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  16.        
  17.        
  18.         ImageIcon usIcon = new ImageIcon("pic/3.gif");
  19.         ImageIcon caIcon = new ImageIcon("pic/1.gif");
  20.         ImageIcon ukIcon = new ImageIcon("pic/2.gif");
  21.        
  22.         JButton jbt = new JButton("Click it",usIcon);
  23.         jbt.setBounds(110,110,25,25);
  24.         jbt.setPressedIcon(caIcon);
  25.         jbt.setRolloverIcon(ukIcon);
  26.        
  27.         getContentPane().add(jbt);
  28. }
  29. }
  30.  

回复 "窗体"

这儿你可以回复上面这条便签

captcha