Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hidden textfields

 
Dmitry Danilov
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
Does anybody know if there's a technique for storing/reading values in hidden fields on a Swing form, similarly to how hidden input fields work in HTML?
I just tried using a JTextField, which I simply set invisible by calling setVisible(false). It worked perfectly for me, but I'm just not 100% sure if this technique is clean enough and there will be no unwanted side effects etc.

Cheers,
Dmitry
[ January 20, 2006: Message edited by: Dmitry Danilov ]
 
Joe Ess
Bartender
Pie
Posts: 9264
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The architecture behind Swing is the idea of model-view-controller. The Model contains the data. The View presents one possible representation of the data. Want "hidden" fields? Code the View so that it does not show them.
Hidden fields in HTML are a kludge to preserve data because HTTP doesn't persist data between requests. They are not necessary when working with Java/Swing as it has more sophisticated functionality.
 
Dmitry Danilov
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, Joe. Gotta think it over now...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic