• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Swing GUI class architecture  RSS feed

 
Rancher
Posts: 110
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Water proof donuts! Eat them while reading this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!