• 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

JDialog components not refreshing  RSS feed

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all.

I have searched for an answer for the following problem and have found none.

Basically I have created a setting dialog by extending JDialog. It has some radio buttons, text fields, etc. In addition to save and cancel buttons, I also have a reset button (to display defaults).

When I open the dialog and press the defaults button, the fields are updated. I then press cancel and reopen the dialog expecting to see the original values. However, I see the default values on the GUI, but if I examine the values of the fields themselves they are correct.

What am I missing?

Thanks in advance,

SWING Newbie
 
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you should call your update (reset) code immediately before first displaying the dialog. Though without code to examine this is just a guess.
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
bob mccloud
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the example (Stuart) and hint (Craig).

A buddy of mine pointed out that my function to create the dialog components was in the wrong place (actionPerformed versus constructor). Thus, I was generating new compnents each time.
 
To do a great right, do a little wrong - shakepeare. twisted little ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!