Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Displaying a GUI

$
0
0

I know this seems like it should be very simple. and it should be. However I can't figure out how to do it in IntelliJ..

 

So I have my main class that creates a new instance of the gui using this code:         gui mainGui = new gui();
I would think this should be all I need, but the gui never shows up.. I have the gui built(the layout anyways, I don't have any listeners yet) and here is the bound class code:

package client; import javax.swing.*; publicclass gui {    private JPanel mainPanel;    private JTextField textField1;    private JTextArea textArea1;    private JButton sendButton;     publicstaticvoid main(String[] args) {        JFrame frame = new JFrame("gui");        frame.setContentPane(new gui().mainPanel);        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);        frame.pack();        frame.setVisible(true);    }}

 

So I can't figure out why it doesn't display the gui, any help is appreciated


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>