Results 1 to 3 of 3
Thread: ActionListener in main
- 05-15-2012, 06:56 PM #1
Senior Member
- Join Date
- Jan 2012
- Posts
- 142
- Rep Power
- 0
-
Re: ActionListener in main
That's an anonymous inner class. And while this can be done, and I have no issue with using an anonymous inner class here, you have other problems with your example -- you would not want to expose your variables in this way, nor should they be static. Better that the ok variable not be public, and not be static. Better to give the App a public method that will allow you to do this with an App instance variable.
Last edited by Fubarable; 05-15-2012 at 07:02 PM.
- 05-15-2012, 07:00 PM #3
Re: ActionListener in main
Could you provide a concrete example in the form of an SSCCE?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
Exception in thread main java.lang.nosuchmethoderror main
By prikesh_joshi7 in forum Java AppletsReplies: 3Last Post: 01-26-2012, 04:19 PM -
Exception in thread “main.java,lang.NoSuchMethodError:main
By femily in forum New To JavaReplies: 1Last Post: 11-23-2011, 05:52 AM -
Making an object of main and running a thread in main
By Grimmjow in forum New To JavaReplies: 1Last Post: 01-23-2011, 05:19 PM -
[SOLVED] Why main() in java is declared as public static void main?
By piyu.sha in forum New To JavaReplies: 5Last Post: 10-06-2008, 12:11 AM -
exception in thred main java.lang.nosuchmethoderror: main
By fernando in forum Java AppletsReplies: 1Last Post: 08-06-2007, 09:11 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks