wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Good design or should I try something else Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Good design or should I try something else" Watch "Good design or should I try something else" New topic

Good design or should I try something else

David Patrzeba

Joined: Jun 08, 2010
Posts: 14
Is this a good way of creating the window or is there a different design I should try. I like breaking everything up for organization but that means that I need to create all the containers as static variables.

David Newton

Joined: Sep 29, 2008
Posts: 12617

It only means that because that's how you've coded it; you could also be returning a menu, or returning menu items, etc.
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

As far as everything having to be static, I would recommend rewriting your code to look like this:

Now that you have an object of the Snippet29 class, you can call its methods (which are the formerly static methods of the class) and use its variables (which are the formerly static variables).
jQuery in Action, 2nd edition
subject: Good design or should I try something else
Similar Threads
Problem in Menu, from RHE
Shell keeps popping up when creating a menu tray
SWT: app close when trying to change text.setText()
Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access
How to access functions within a thread?