GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Swing GUI class architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing GUI class architecture" Watch "Swing GUI class architecture" New topic
Author

Swing GUI class architecture

Matthew Taylor
Rancher

Joined: Jun 13, 2004
Posts: 110
I'm in the process of constructing my first really involved GUI in Java Swing. As I go along, I find myself creating a lot of custom Swing Components, like JPanels that take user input and are reused in different areas.

Since I don't work with anyone in my office that programs in Java, I'd like some input on how Java programmers organize their GUI views. Not on the screen as executable output, but behind the scenes. I have a folder called 'view' (I'm using MVC pattern) that contains all my Swing component classes I use. But I'm not really sure how I'm going to organize things further down the directory tree.

I will have one primary JFrame that contains a JTabbedPane of many other JPanels filled with user options. These JPanels will contain lots of other Swing components with specialized functions. I'm thinking about creating a subdirectory under 'view' for every JTabbedPane tab that contains all the specialized JPanels, and then probably another one that contains those components I might reuse on all the panels.

Does anyone have any suggestions or ideas on the underlying class architecture of Swing GUI's?


Grails Consultant
http://dangertree.net
Warren Dew
blacksmith
Ranch Hand

Joined: Mar 04, 2004
Posts: 1332
    
    2
Matthew Taylor:

I will have one primary JFrame that contains a JTabbedPane of many other JPanels filled with user options. These JPanels will contain lots of other Swing components with specialized functions. I'm thinking about creating a subdirectory under 'view' for every JTabbedPane tab that contains all the specialized JPanels, and then probably another one that contains those components I might reuse on all the panels.

That sounds reasonable to me. For an application with multiple windows, I do something similar, with one package for each window. Stuff that's used in more than one window goes in a 'common' package.
 
GeeCON Prague 2014
 
subject: Swing GUI class architecture