• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reset All Fields in Add User Screen  RSS feed

 
Steven Wong
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a screen (say Add User), containing text field components and Jtable as well.
Is there a function (like the reset button) which I can trigger to reset all the
values to empty when I click on it?
currently, I am calling a function which sets all the values to null manually, as below :
public void resetFields(){
jTextField1.setText(null);
jTextField2.setText(null);
jTextField3.setText(null);
resetTables() // more manually codes implemented by calling deleteRow(int x);
}
Thanks, any help is much appreciated.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No magical way for the JTextFields. I gues you could assign a new empty model to the table. Ponder if it is worthwhile.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!