我试图保持行动尽可能分离,但我遇到了一个行动之前发射的问题。现在我有一个添加了两个动作侦听器的按钮。 JButton button = new JButton();
...
button.addActionListener (new Action1());
button.addActionListener (new Action2());
2正在发生之前1.如何保证订单?有没有办法触发其
这使得jbutton的大小等于frame,并且标签没有达到我想要的位置。 public class Try extends JFrame {
public Try(){
JFrame f = new JFrame("TRY");
JButton btn = new JButton(HI);
JLabel l = new JLabel("label");
我试图设置一个按下的按钮不可见,并设置其余可见。我用getComponents()方法来获得三个按钮,并改变其可见性状态,但出现问题。 @Override
public void actionPerformed(ActionEvent e) {
Component button = ((Component) e.getSource());
for (Component co