标签:dem stat for add imp http form image inf
package Demo;
import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
public class chuangkou implements ActionListener{
JFrame f;
JPanel p;
JButton b;
JLabel l;
public chuangkou() {
f=new JFrame();
p=new JPanel(null);
b=new JButton("确定");
l=new JLabel();
b.addActionListener(this);
f.add(p);
p.add(b);
p.add(l);
f.setVisible(true);
f.setSize(400,400);
l.setBounds(50,120,50,50);
b.setBounds(150,150,80,80);
}
public static void main(String[] args) {
new chuangkou();
}
public void actionPerformed(ActionEvent e) {
p.setBackground(Color.pink);
l.setText("嘿嘿嘿嘿嘿");
b.setBounds(250,50,80,80);
}
}
标签:dem stat for add imp http form image inf
原文地址:https://www.cnblogs.com/xiaoqiuyueming/p/10831025.html