1
這裏是我寫的代碼:JLabel setLocation不工作?
super("Add contact");
setLayout(new FlowLayout());
IPAddress = new JLabel("IP Address");
IPAddress.setLocation(1000, 100);
ImageIcon ii=new ImageIcon(getClass().getResource("Add.png"));
JLabel image = new JLabel(ii);
image.setSize(100, 100);
image.setLocation(500, 100);
add(image);
add(IPAddress);
setSize(500,150);
}