Basically I am fairly new to java still and imported a simple png over another, It's a proof of concept for myself and I would assume is very informal coding. None the less I don't know how to move the second png as it puts it self at (0,0,0)
in the top left once the application opens.
public class DisplayImage extends JFrame {
public DisplayImage() {
initUI();
}
private ImageIcon loadImage() {
ImageIcon ii = new ImageIcon("/Users/980057130/Desktop/pixil-frame-0.png");
return ii;
}
private ImageIcon loadImage1() {
ImageIcon iii = new ImageIcon("/Users/980057130/Desktop/Dynamic-Dungeon.png");
return iii;
}
private void initUI() {
ImageIcon ii = loadImage();
ImageIcon iii = loadImage1();
JLabel label = new JLabel(iii);
JLabel label1 = new JLabel(ii);
createLayout(label);
createLayout(label1);
label = new JLabel();
Container contentPane = getContentPane();
contentPane.add(new JScrollPane(label), "Center");
setTitle("Dynamic Dungeon");
setLocationRelativeTo(null);
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
}
Any help is greatly appreciated.