• 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 Design ideas

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am building a swing GUI. I am trying to find the best approach to meet the following requirements.

The GUI has a function dropdown at the top. There are about 15 functions. When a function is selected. A panel will be shown for dataentry which has about 20 fields. For each of the 15 functions, most of these 20 fields are needed for data entry. Some of them are not needed. So based on the function selected, I have to either hide the unwanted fields or disable them.

There are 2 options :

1. Create 15 separate panels, one for each function. This will keep the code clean (without any if then else.. etc). But will duplicate a lot of code.

2. Have only one panel that caters to all 15 functions. But involves a lot of if then else. Also, I have to consider the tab-order so that focus jumps the disabled fields, etc..

Is there any clean solution for this kind of requirement. Any design pattern etc I can look at.

Regards
Ravi
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic