简体   繁体   中英

Initialize GUI components in IntelliJ

I'm currently building my first GUI with IntelliJ. I arranged all my components in the GUI Designer unisng a Grid-Bag-Layout. My problem is that in the bound class, no code gets generated to make the application actually look like what I designed, there are only declarations of the different components. According to this tutorial said code should be automatically generated when compiling the project and processed to the .class file. But that doesn't seem to happen, as I only get an empty window when compiling and running my project.

Alright I figured it out. Apparently the JPanel which contains all the components doesn't get added to the JFrame by default. So I had to manually call add(panel) in my constructor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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