private void filebuttonActionPerformed(java.awt.event.ActionEve nt evt) {
// TODO add your handling code here:
String memname1="";
String selmem1="";
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new File(".."));
chooser.setFileFilter(new javax.swing.filechooser.FileFilter() {
public boolean accept(File f) {
return f.getName().toLowerCase().endsWith(".txt")
|| f.isDirectory();
}
public String getDescription() {
return "All Files";
}
});
int r = chooser.showOpenDialog(new JFrame());
if (r == JFileChooser.APPROVE_OPTION) {
// String name = chooser.getSelectedFile().getName();
File file = chooser.getSelectedFile();
memname1=file.toString();
selmem1=file.getName();
System.out.println("selmem1" +":" +selmem1);
System.out.println("memname" + ":"+ memname1);
filetext.setText(memname1);
}
}
dear sir,
this is the test to select a file using jfilechooser.my problem is jfilechooser took 1 minute to open dialogbox on my machine and in another machine took
2 secs . i am uisng ide is netbeans 6.5.can anybody solve my problem pls its urgent .
thanks
santhosh babu
thanks
santhosh babu