Thomas Darimont
Erfahrenes Mitglied
... ich war mal so frei deine Fehler zu korrigieren.
Gruß Tom
Gruß Tom
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
Thomas Darimont hat gesagt.:... ich war mal so frei deine Fehler zu korrigieren.
Gruß Tom
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* @author Darimont
*/
public class PanelWithImage extends JFrame {
public PanelWithImage() {
super("PanelWithImage");
setDefaultCloseOperation(EXIT_ON_CLOSE);
JLabel label = new JLabel(new ImageIcon("C:\\Dokumente und Einstellungen\\Fatih\\Desktop\\TicTacToe\\BackPicture\\ones.gif"));
JPanel panel = new JPanel();
panel.add(label);
this.getContentPane().add(panel);
pack();
setVisible(true);
}
/**
* @param args
*/
public static void main(String[] args) {
new PanelWithImage();
}
}
JPanel panel = new JPanel();
...
this.getContentPane().add(Panel);
package de.tutorials;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
/**
* @author Darimont
*/
public class PanelWithImage extends JFrame {
public PanelWithImage() {
super("PanelWithImage");
setDefaultCloseOperation(EXIT_ON_CLOSE);
JLabel label = new JLabel(
new ImageIcon(
"C:/Sonnenuntergang.jpg"));
JPanel panel = new JPanel();
panel.add(label);
this.getContentPane().add(panel);
pack();
setVisible(true);
}
/**
* @param args
*/
public static void main(String[] args) {
new PanelWithImage();
}
}