• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to idientify that the contents of JDialog window are changed

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic