Hopefully this would help to everybody
PHP Code:
/* this is assuming that you want to add actionListener to button, but applies anywhere */
JButton button = new JButton("ProgrammersTalk");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
// what do you want to do when the button is clicked
}
});
as you see, the code is not that much. There's another way to do this, which I think is just adding more line of codes. I like this way better though. the rest are just going to be your logic. Hopefully this help! Add rep pls..
