JLabel setLocation not working?
问题 Here is the code I have written: 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); } 回答1: That is correct. The layout manager is responsible for setting the location of a component based on the rules of the layout manager. So in