Ich habe folgendes problem. Ich möchte mein JFrame aktualisieren. Hier der code:
public class Shop {
Inventory inv = new Inventory();
int AnzahlInt= 1;
String Anzahl= Integer.toString(PokeballAnzahlInt);
public void Frame() {
GridLayout gLayout = new GridLayout(0, 1);
JFrame frame= new JFrame();
frame.setVisible(true);
frame.setSize(100, 100);
frame.setLayout(gLayout);
JButton Mehr = new JButton("<html> <h1>^<html>");
PokeballMehr.addActionListener(newActionListener() {
public void actionPerformed(ActionEvent e) {
AnzahlInt++;
frame.repaint();
}
});
PokeballFrame.add(PokeballMehr);
PokeballFrame.add(new JLabel(PokeballAnzahl));
}
}
Bin mir nicht ganz sicher dachte das das mit repaint geht aber anscheinend nicht.