• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to idientify that the contents of JDialog window are changed  RSS feed

 
Priya Sri
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a JDialog window which may contain some text fields and JTable, check box etc

I have OK and Cancel button for that JDialog. I need to identify whether any value of textbox or jtable or checkbox is changed, then on click of OK button, i need to do some task if some values got changed.

How can i identify that JDialog is changed by the user?

Thanks in Adavance..
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Priya Sri:
Hi all,

I have a JDialog window which may contain some text fields and JTable, check box etc

I have OK and Cancel button for that JDialog. I need to identify whether any value of textbox or jtable or checkbox is changed, then on click of OK button, i need to do some task if some values got changed.

How can i identify that JDialog is changed by the user?

Thanks in Adavance..


1)Create a panel
2)Set a suitable layout
3)Add required components (textfield, checkbox, table etc) to the panel.
4)Use one of the JOptionPane.showXXX methods and pass the panel as the message argument.
5)When the user clicks OK, you still have a reference to the components you added, so you can look up the values and process them accordingly.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!