• 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 ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Question about generic swing JFrame structure

Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a number of JFrames within an application and I'm to promote re usability by being easily able to add panels to these JFrames to cause the least disruption to users. There is a common panel across all JFrames and it is the bottom panel with a connect and exit button. I have a problem though. Say within a JFrame, I have 2 panels, 1 with a number of textfields that must be validated and the other panel is the bottom panel. I perform my validation in the bottom panel using the start and stop buttons. I tried to make the bottom panel generic and place the validation code in the textsfields panel. But when I called the validation code from the bottom panel which resided in the textfields panel, the validation code knew nothing about changes to the textfields, therefore at this stage, I presume the validation code must reside in the Jframe itself. What I would like to know now is, if I make a panel within JFrame(s) generic, how can I call the validation code from the generic JPanel which resides in the JFrame and is this my only possibility. This is just a private project, any help appreciated.
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Too long / comblicated explanation makes me sleepy, but

If I get this right the main problem here is the validation... how to do it properly and make it easy.

I Had problems with validation...
I was uncertain that how the validation progress is done properly and I shall share my experience and search on it... which is short

- Text Field Auto Tab - by Rob Camick, you get the picture from SizeDocumentFilter to do similar filters and using them as chains.
- Building a Swing Validation Package with InputVerifier - old but you get the message and modify it for your needs.

And I combined a bit of these two great examples i.e. bringing WantsValidationStatus to Rob's example etc.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic