Search code examples
javauser-interfaceintellij-ideadesigner

Java IntelliJ GUI Designer - How can I: change the window title bar and system menu icon, and go to another form when button is pressed


I'm currently learning IntelliJ's GUI designer but I'm struggling to find documentation or any guides. So far I have watch a fantastic introductory youtube series from a guy called Scott Couprie, which I really recommend to any complete beginners reading this.

I would like to do three things. If anybody has a link to documentation or guides that'd be great.

  1. Change the window title bar text.

EDIT: I have now discovered this can be changed with setTitle("Title").

enter image description here

  1. Change the system menu icon. I am using MacOS so I don't even see an icon in the preview, so I'm not even sure where the icon goes. EDIT: while I can't confirm this is working due to using MacOS, I see that you can use the following in the constructor:

    ImageIcon img = new ImageIcon("images/16x16.png"); setIconImage(img.getImage());

  2. Be able to click a button and go to another form. So far I have been able to switch panels after pressing a button, but only to other panels within the same form itself.

Thanks.

I have tried searching for related documentation or youtube videos but I'm not sure what terms to search.


Solution

  • This can be changed with:

    setTitle("Whatever you want the title to say");