简体   繁体   English

在使用代码构建GUI时预览NetBeans中的GUI

[英]preview GUI in NetBeans while using code to build GUI

How do you view a JFrame GUI design if you build your frame in code from a constructor? 如果从构造函数JFrame代码构建框架,如何查看JFrame GUI设计?

(There is no design preview if you create object or extend from JFrame?) (如果创建对象或从JFrame扩展,则没有设计预览?)

I want to create a GUI by writing Java code so that I can learn more about Java GUI concepts, but it is annoying to have to run app every 5 sec to see how my buttons fit. 我想通过编写Java代码来创建GUI,以便可以了解有关Java GUI概念的更多信息,但是必须每隔5秒钟运行一次应用程序才能查看按钮的合适位置,这很烦人。

Previewing a Swing GUI in NetBeans requires the auto-generated *.form (xml) file which corresponds to the code. 在NetBeans中预览Swing GUI需要自动生成的* .form(xml)文件,该文件与代码相对应。 If you write the code by hand, you will not have the necessary xml metadata to preview it. 如果您手工编写代码,则没有必要的xml元数据来预览它。

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

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