Thread: Dumb Netbeans Q
View Single Post
  #3 (permalink)  
Old 05-23-2008, 12:13 PM
Eku Eku is offline
Senior Member
 
Join Date: May 2008
Location: Makati, Philippines
Posts: 228
Eku is on a distinguished road
here is some hints

1. Add a ActionListener
2. Get the return value of the JFilechooser (it can be OK or the Cancel button)
Sample in getting the return value:
Code:
int RT = fileChooser.showOpenDialog(this);
3. Compare the return value to your desired value
Another Sample:
Code:
if (RT == JFileChooser.APPROVE_OPTION){ //do your thing here for Yes or Ok button } else if (RT == JFileChooser.CANCEL_OPTION){ //here is for Cancel or No button }
__________________
Mind only knows what lies near the heart, it alone sees the depth of the soul.
Reply With Quote