JFileChooser对话框搞砸了

时间:2016-01-20 09:05:04

标签: java swing jframe jfilechooser

JFileChooser对话框,在辅助JFrame打开后搞砸了。 我把照片发给你了。

这是JFileChooser,在打开文件按钮后打开

enter image description here

看起来很完美 - 现在我按选项按钮

$username = trim($_POST['userName'])?:'Anonymous';

JFrame,我的意思是params类实例打开完美。这应该返回一些值到主窗口。但是为了调试这个我删除了任何引用。 现在我再次打开JFileChooser,我收回了这个烂摊子。 enter image description here

这很奇怪吗?很抱歉没有发布代码,它太大了。我选择让你问你需要的代码。我希望这对你来说更方便。

1 个答案:

答案 0 :(得分:0)

我在第二个窗口中使用了不同的外观。 我改变它似乎工作正常。 那是在immibis帮助之后。非常感谢你。

现在我用

try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Reader.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Reader.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Reader.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Reader.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }

在我的主窗口和第二个窗口中打开。 固定!!

相关问题