java - How to use card layout with IntelliJ's form builder? -


i'm having trouble getting program switch jpanels when press nextbutton using card layout.

this looks like:

i want program switch "customersearch" jpanel. has card name & name of card2. panelcontainer has card layout. doing wrong?

public class gui { private jpanel panelcontainer; private jpanel takeoutoption; private jpanel customersearch; private jbutton nextbutton;  private cardlayout cl = (cardlayout)panelcontainer.getlayout();   public gui() {      nextbutton.addactionlistener(new actionlistener() {         @override         public void actionperformed(actionevent e) {             cl.show(panelcontainer, "card2");         }     }); } 


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -