Hi, I have a JFrame that has a BottomPanel (a class I made that extends JPanel) inside it. And inside that JPanel is another JPanel called DicePanel(that again extends JPanel).
In DicePanel there is a button called 'End Turn' that when clicked should end the players current turn for the board game the program is based on. I want to somehow listen for the buttonClicked event from DicePanel from inside my JFrame.
How do I do this?
Edit: Right now I have
for (Player p : f.playerList) {
int diceRoll = dice.roll();
System.out.println(p.move(diceRoll));
System.out.println(p.getCurrentCell());
System.out.println(diceRoll);
f.bottomPanel.dice.setDice(dice.getDice1(), dice.getDice2());
while (true) {
try {
break;
System.out.println("Waiting");
Thread.sleep(2000);
} catch (Exception e) {
}
}
}