Reputation: 564
I am new to Java and Netbeans, and want to write a Swing project to learn by.
Naturally I want to separate the "guts" of the code from the GUI class. How should I go about it, best practice ?
Should I:
Create instances, or use classes statically ? And what of this invokeLater business ?
[ some little code samples would be lovely ]
Thanks. Anthony.
Upvotes: 1
Views: 174
Reputation: 83577
Three: Put main()
in its own class and intitialize all objects as needed.
Upvotes: 3
Reputation: 347334
I'd create a Main
class or other entry class that contains main
. This would be responsible for preparing the system, initialising common library elements and general house keeping.
As to which element needs to be "started" will depend on the structure of your code and your implementation of the MCV
Upvotes: 3