1BufferedImage image = ImageIO.read(getClass().getResourceAsStream("/bilder/demo.png"));
1try {
2 Image image = ImageIO.read(new FileInputStream("Bilder/demo.png")) ;
3
4 JLabel imageLabel= new JLabel(new ImageIcon(image));
5 imageLabel.setBounds(0, 0, 10, 10);
6 add(imageLabel);
7 imageLabel.setVisible(true);
8 } catch(Exception e) {
9 JOptionPane.showMessageDialog(this, "Fehler" + "\n" + e);
10 }