ola obrigado pela resposta, o problema é que o repaint esta funcionando, le não esta é pedindo uma nova carta, ou seja o repaint acaba por nao fazer nada
E porque deveria? Seu actionListener deveria pedir para lançar uma nova carta, não para repintar a tela:
ActionListener one = new ActionListener() {
public void actionPerformed(ActionEvent e) {
test1.setIcon(myDeckOfCards.giveCardPlayer1().getImage());
}
});
[quote=ViniGodoy]E porque deveria? Seu actionListener deveria pedir para lançar uma nova carta, não para repintar a tela:
ActionListener one = new ActionListener() {
public void actionPerformed(ActionEvent e) {
test1.setIcon(myDeckOfCards.giveCardPlayer1().getImage());
}
});[/quote]
ola, muito obrigado pela ajuda ViniGodov
acontece o seguinte, que é eu nao conseguir acede ao test1 e o myDeckOfCards pedir para ser final
fica o output
test1 cannot be resolved
Cannot refer to a non-final variable myDeckOfCards inside an inner class defined in a different method
test1 cannot be resolved to a variable
[code]ActionListener one = new ActionListener() {
public void actionPerformed(ActionEvent e) {
test1.setIcon(myDeckOfCards.giveCardPlayer1().getImage());
}
};
final JLabel test1 = new JLabel(myDeckOfCards.giveCardPlayer1().getImage());
ActionListener one = new ActionListener() {
public void actionPerformed(ActionEvent e) {
test1.setIcon(anotherIcon);
}
};