Is it possible to read the content of a JPanel
?
In my situation, I've got a main JPanel that I called container
, and 3 other JPanels inside it: p1
, p2
and p3
.
I've also created a class that extends JPanel
for a little virtual keyboard (26 buttons) and this implements ActionListener
.
The p1
is to display the title of the game, p2
is the virtual keyboard and p3
should display the value of the button I clicked on.
My class VirtualKeyboard
has a constructor that accepts an object of type JPanel
(to get the container and hopefully its contents).
Many thanks for your answers.