📜  java 添加监听按钮 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:09.408000             🧑  作者: Mango

代码示例1
JButton button = new JButton("Do Something");
button.addActionListener( new ActionListener()
{
    @Override
    public void actionPerformed(ActionEvent e)
    {
        System.out.println("Do Something Clicked");
    }
});