Windows 10 个 JFileChooser

Windows 10 JFileChooser

我最近得到了 windows 10,但我在使用 JFileChooser 时遇到了问题。每当运行它的行时,它都会给我这个错误 "Qt: Untested Windows version 6.3 detected!" 我不确定是否有人问过这个问题,但我试着寻找但什么也没发现。该错误没有告诉我它发生在哪里。我感觉这可能是因为windows 10.

public class Load {
public static JFrame f = new JFrame(); 
/**
 * @wbp.parser.entryPoint
 */
public void frame(){

    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Load Game");
    fileChooser.setAcceptAllFileFilterUsed(false);
    fileChooser.setApproveButtonText("Load");
    fileChooser.setForeground(new Color(255, 255, 255));
    fileChooser.setFont(new Font("Trebuchet MS", Font.PLAIN, 12));
    f.getContentPane().add(fileChooser, BorderLayout.CENTER);}}

可能原因:

  1. 您没有正确使用 JFileChooser 组件。尝试:

    if(filechooser.showOpenDialog(帧)==JFileChooser.APPROVE_OPTION){ ... }

  2. 一个新的 Windows 10 没有适合 JFileChooser class 的 UI 参数。因此,请尝试以下一项(或两项):

    • 一个。下载并安装 KBxxxx 更新 windows 10
    • b。停止使用 UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() ); 如果您正在使用它并切换到默认的外观和感觉。