I want to link button on a card(JPanel) in a cardLayout to another card(JPanel) in the same Layout.
components
i Have 2 Panel class = 1. welcome.class , snacks.class
and 1 jframe class = kiosk.class
Already i can switch through view using the flowLayout but i want to link a button from one card to the other
Purpose
What i want to achieve is how to use a button on welcome panel and navigate to the snack panel within a cardLayout
This is what i tried
KIOSK CLASS(JFRAME CONTAINING VIEWS)
WELCOME.CLASS(JPANEL FORM)
The main connection is highlighted in dark red
What i was trying to do is to define a
new kiosk in my welcome class and reference the
switchPanel method which takes a parameter of
(Container container, String plName)
but anytime i try to run i get this error