This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

During creation, getting original value from javabean  RSS feed

 
Eric Braun
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTextField and I added a PropertyChangeListener to listen for changes to my Java Bean. This is working great.
However, I need to set the original value in the text field when the form is loaded. I cannot use the PropertyChangeListener, because it hasn't changed. I am making a customized JTextField that will have my listner and all of my field objects will be extending this one. So, I cannot hardcode my getter.
Is there a way to fire my PropertyChangeListener on intialization? How do I go about getting the value out of my JavaBean? Do I need to do reflection?
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!