具有這些測試爲selectedFile的奇怪問題我在使用的JFileChooser在JFileChooser中
package sandbox;
import java.io.File;
import javax.swing.JFileChooser;
/**
*
* @author yccheok
*/
public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
final JFileChooser chooser = new JFileChooser();
chooser.setAcceptAllFileFilterUsed(false);
// STRANGE! Using "TEST", when dialog box pop up, you see empty in file name field.
// However, using other name like "TESTX", when dialog box pop up, you see "TESTX" in file name field.
//chooser.setSelectedFile(new File("TESTX"));
chooser.setSelectedFile(new File("TEST"));
chooser.showOpenDialog(null);
}
}
這是我的機器的問題面臨以下奇怪的問題?或者你們也都面臨同樣的問題?爲了您的信息,我正在使用Vista。
它也顯示爲我 – Telcontar 2009-10-08 13:27:41