I will suggest you some things.
1. Draw the GUI in constructor.
2. And then add an actionevent to the button, you want to.
3. Make an object of GUI class in your main and set it to visible.
Type: Posts; User: Mr.777
I will suggest you some things.
1. Draw the GUI in constructor.
2. And then add an actionevent to the button, you want to.
3. Make an object of GUI class in your main and set it to visible.
Well, it's saying you coz i guess you are drawing buttons in your main() method, am i right?
If so, remember, main() is a static method and you can't reference the object from static context like...
What does event.getSource() returns???
Why don't you try casting it?