标签:[] jbutton str cti com 事件 http ati round
package ck; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class chuangkou implements ActionListener{ JFrame chuangkou; JPanel m; JButton a; JLabel c; public chuangkou() { chuangkou=new JFrame("事件处理练习窗口"); a=new JButton("改变"); m=new JPanel(); c=new JLabel("单击"); a.addActionListener(this); a.setBounds(40,60,80,60); m.add(a); m.add(c); chuangkou.add(m); chuangkou.setVisible(true); chuangkou.setSize(500,600); } public void actionPerformed(ActionEvent e) { m.setBackground(Color.blue); } public static void main(String[]args) { new chuangkou(); } }
标签:[] jbutton str cti com 事件 http ati round
原文地址:https://www.cnblogs.com/Maxsh/p/10821236.html