package chat1; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class chat1{ public chat1(){ JFrame jf = new JFrame(); jf.setLayout(null); jf.setSize(280,560); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton logn = new JButton("logn"); JButton out = new JButton("out"); logn.setBounds(170,480,80,30); // 参数分别为坐标,控件的规格 out.setBounds(15,480,80,30); jf.add(logn); jf.add(out); jf.setVisible(true); } public static void main(String[] args){ chat1 frame = new chat1(); } }
时间: 2024-10-08 12:23:56