• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Swing GUI class architecture

 
Rancher
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic