Gregg Bolinger wrote:The code confuses me in the way you have used Listeners and how you are executing listener methods in your Mainprog class. Could you explain what you think this program should do?
No worries, I'll try
Please keep in mind that i'm only learning what I can via the 'net and a couple of
Java books. Not to mention that I've only been mucking about with Java for around two weeks now. Now that I have my noob justification for crappy code out of the way here goes.
Assuming each class is a blueprint of a particular (re)usable action that I would like the application to perform.
1. I created a class for my the application interface. (Rubyframe.java)
2. I created a class to hold a actionlistener for a quit JButton belonging to the interface.(Leave.java)
3. I created another class to hold a second actionlistener for a JOptionPanel popup message.(Message.java)
4. I presumed that methods for these classes should be placed in the main Java file. (Mainprog.java)
I presumed that when Mainprog.java was executed the methods contained within were made available, which when called upon called the associated class into action.
Hope that makes sense
Cheers