nish
1
Q:

java add listent to button

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

New to Communities?

Join the community