Ik wil graag op de achtergrond van een java applicatie een plaatje weergeven. Ik heb van alles geprobeerd, maar hij wordt niet weergegeven. Ik heb begrepen dat je het met een JLabel kunt doen, maar hoe moet ik die dan plaatsen in het volgende stuk code:
public class diRoute extends JFrame
implements ActionListener
{
public diRoute() {
Container contentPane = this.getContentPane();
SpousePanel2 spousePanel = new SpousePanel2();
// add the panel
contentPane.add("Center", spousePanel);
// handle clicking the quit box
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
// define the reactions to button clicks
public void actionPerformed(ActionEvent e) {
}
// create the toplevel window (JFrame) and start the program
public static void main(String[] args) {
diRoute window = new diRoute();
window.setTitle("diRoute");
window.setSize(550,750);
window.setVisible(true);
}
}
Kan iemand mij helpen
public class diRoute extends JFrame
implements ActionListener
{
public diRoute() {
Container contentPane = this.getContentPane();
SpousePanel2 spousePanel = new SpousePanel2();
// add the panel
contentPane.add("Center", spousePanel);
// handle clicking the quit box
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
// define the reactions to button clicks
public void actionPerformed(ActionEvent e) {
}
// create the toplevel window (JFrame) and start the program
public static void main(String[] args) {
diRoute window = new diRoute();
window.setTitle("diRoute");
window.setSize(550,750);
window.setVisible(true);
}
}
Kan iemand mij helpen