Ich habe ein Bild:
Und ich will dass WENN ich acuh dem BILD KLICKE, etwas passiert.
Was muss ich hinzufügen? und wie springe ich? (in Ansi C mit goto a
Code:
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setLayout(new FlowLayout());
URL resource1 = null;
try {
resource1 = new URL("http://www.battleofkings.de/game/img/gr_1.gif");
} catch (MalformedURLException e1) {
e1.printStackTrace();
}
final Icon Feld = new ImageIcon(resource1);
final JLabel label1 = new JLabel(Feld);
frame.add(label1);
frame.pack();
frame.setVisible(true);
frame.setBounds(0, 0, 220, 265);
Und ich will dass WENN ich acuh dem BILD KLICKE, etwas passiert.
Was muss ich hinzufügen? und wie springe ich? (in Ansi C mit goto a