This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How to idientify that the contents of JDialog window are changed

 
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..
 
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!