I want to position my image which I have placed inside a JLabel. Here is my code:
public Main() {
setLayout (new FlowLayout());
image = new ImageIcon(getClass().getResource("title.gif"));
image1 = new JLabel(image);
image1.setAlignmentX(400);
image1.setAlignmentY(400);
add(image1);
}
It displays the image, but the lines
image1.setAlignmentX(400);
image1.setAlignmentY(400);
Do not do anything. I'm new to Java, any help appreciated.
(I would appreciate an example.)