简体   繁体   English

GUI源IntelliJ Idea

[英]GUI source IntelliJ Idea

IntelliJ Idea GUI designer doesn't provide source code of generated JForm. IntelliJ Idea GUI设计器不提供生成的JForm的源代码。 I tried with File>Settings>GUI Designer> Java source Code, but there's no effect. 我尝试使用文件>设置> GUI设计器> Java源代码,但没有效果。 What I get is something like this, and it looks different than on a preview. 我得到的是这样的,它看起来与预览不同。

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();

Also there is error warnings "cannot resolve symbol 'intellij'" How to fix it? 还有错误警告“无法解析符号'intellij'”如何解决?

The source generated by IDEA (as will be stated by a lot of the comments also output) isn't something that is meant to be edited. IDEA生成的源(许多注释也会输出)也不是要编辑的内容。

It's unclear what was meant in your question regarding what looks different: Did you mean from how you think it should look given what the preview looks like? 目前还不清楚你的问题中关于什么看起来不同的意思:你的意思是你认为应该如何看待预览的样子? Or that the resultant gui that the code produces does look different ... if the later - please provide all source code to enable us to take a deeper look. 或者代码产生的结果gui看起来不同......如果是后者 - 请提供所有源代码以使我们能够更深入地了解。

The warnings are because the classes (such GridLayoutManager) are not visible to the IDE/compiler until runtime. 警告是因为类(如GridLayoutManager)在运行时之前对IDE /编译器不可见。 However, if the program is run from IDEA - it should execute just fine since the forms_rt.jar (that contains this and other useful classes) will be present in the classpath. 但是,如果程序是从IDEA运行的 - 它应该执行得很好,因为forms_rt.jar(包含this和其他有用的类)将出现在类路径中。

Please see http://www.jetbrains.com/idea/webhelp/gui-designer.html for more details. 有关更多详细信息,请参阅http://www.jetbrains.com/idea/webhelp/gui-designer.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM