import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.border.TitledBorder;
public class LabelDelTest extends JFrame implements ActionListener {
JLabel label;
JButton button;
public LabelDelTest() {
label = new JLabel("新建标签陆桥"派培,JLabel.CENTER);
label.setBorder(new TitledBorder(""));
button = new JButton("删尘悉唯除标签");
button.addActionListener(this);
add(label,"North");
add(button,"South");
setTitle("标签删除");
setBounds(200,100,500,300);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new LabelDelTest();
}
public void actionPerformed(ActionEvent e) {
remove(label);
this.repaint();
}
}
你是要隐藏吗?用jquery中的hide()行吗?