What is the advantage of writing the button as a seperate class.

private class button implements ActionListener
 public void actionPerformed (ActionEvent e){


Modularity. That way you can use it in many places without having duplicate code.
It also keeps your classes small, which makes the code easier to read and maintain.

em.. i not really sure the advantage..
i juz noe.. it will mix up wif the other coding in e same class.. makin the whole process beta?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.