How to start a new GUI form in IntelliJ IDEA?
IntelliJ IDEA uses a different approach to GUI forms, instead of extending JFrame, it hides all GUI code in .form files and instantiates the form in main() of Bound class.
Now for example, I have two forms in the project. Login and Page.
In any other IDE, I would have called Page.java after successful login using
Page page = new Page();
page.setVisible(true);
it works because Page extends JFrame class and thus has setVisible() method. But how do I do that in Intellij?
Please sign in to leave a comment.
Make a getter for automatically constructed JPanel from your class, then use setContentPane from the obtained JPanel for JFrame.