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
Post a Comment