We would like to know how to add click event handler with Lambda to JButton.
// www . j a v a 2 s . c o m import javax.swing.JButton; import javax.swing.JOptionPane; public class Main { public static void main(final String args[]) { JButton button = new JButton("Test"); button.addActionListener(e->System.out.println("Button pressed")); JOptionPane.showMessageDialog(null, button); } }