I'm trying to make a hello world form in Intellij. I've created the form, but the question now is what code to make in main() to make the form run and show up?
PS: all the tutorials around seem to only focus on "how to do forms on intellij" not in "how to actually make it run, then".
Thanks
Create a new Android project Launch IntelliJ IDEA. On the Welcome screen, click New Project. If you already have a project open, from the main menu select File | New | Project. In the New Project wizard, select Android on the left.
Press the keyboard shortcut for "Generate". It's Ctrl+N on Mac OS X, Alt+Ins on Windows. Alternatively, from the menu, select menu Code → Generate.
Select "Form main()".
Now the main method is written and inserted for you. It will look something like this:
public static void main(String[] args) { JFrame frame = new JFrame("MyForm"); frame.setContentPane(new MyForm().mainPanel); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With