标签:visible col panel ram npe class ack nts override
package 事件处理; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class Xiu implements ActionListener { JFrame f; JPanel p; JButton b; public Xiu() { f=new JFrame(); p=new JPanel(); b=new JButton("单击"); b.addActionListener(this); f.setSize(400,450); f.add(p); p.add(b); f.setVisible(true); } public static void main(String[] args) { new Xiu(); } @Override public void actionPerformed(ActionEvent arg0) { p.setBackground(Color.BLUE); } }
标签:visible col panel ram npe class ack nts override
原文地址:https://www.cnblogs.com/angst18/p/11137524.html