【问题标题】:GUI source IntelliJ IdeaGUI 源码 IntelliJ Idea
【发布时间】:2014-06-24 22:08:41
【问题描述】:

IntelliJ Idea GUI 设计器不提供生成的 JForm 的源代码。我尝试使用 File>Settings>GUI Designer> Java source Code,但没有任何效果。我得到的是这样的东西,它看起来与预览不同。

private void $$$setupUI$$$() {
    panel1 = new JPanel();
    panel1.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    tabbedPane1 = new JTabbedPane();
    panel1.add(tabbedPane1, new com.intellij.uiDesigner.core.GridConstraints(0, 0, 1, 1, com.intellij.uiDesigner.core.GridConstraints.ANCHOR_CENTER, com.intellij.uiDesigner.core.GridConstraints.FILL_BOTH, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_SHRINK | com.intellij.uiDesigner.core.GridConstraints.SIZEPOLICY_CAN_GROW, null, new Dimension(200, 200), null, 0, false));
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new com.intellij.uiDesigner.core.GridLayoutManager(1, 1, new Insets(0, 0, 0, 0), -1, -1));
    tabbedPane1.addTab("Log In", panel2);
    final JPanel panel3 = new JPanel();

还有错误警告“无法解析符号'intellij'” 如何解决?

【问题讨论】:

    标签: java swing intellij-idea layout-manager


    【解决方案1】:

    IDEA 生成的源代码(正如许多 cmets 输出的那样)不是用来编辑的东西。

    不清楚您的问题中关于什么看起来不同的含义:您的意思是根据预览的样子,您认为它应该是什么样子?或者代码生成的结果 gui 看起来确实不同......如果是后者 - 请提供所有源代码,以便我们更深入地了解。

    警告是因为类(如 GridLayoutManager)在运行时对 IDE/编译器不可见。但是,如果程序是从 IDEA 运行的 - 它应该执行得很好,因为 forms_rt.jar(包含这个和其他有用的类)将出现在类路径中。

    更多详情请查看http://www.jetbrains.com/idea/webhelp/gui-designer.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-15
      • 1970-01-01
      • 1970-01-01
      • 2015-05-31
      • 2020-03-01
      • 2011-08-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多