aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 18154

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).
I agree. Here's the link:
subject: Good design or should I try something else
Similar Threads
How to access functions within a thread?
Problem in Menu, from RHE
SWT: app close when trying to change text.setText()
Shell keeps popping up when creating a menu tray
Exception in thread "AWT-EventQueue-0" org.eclipse.swt.SWTException: Invalid thread access