有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java无法将JLabel添加到JPanel

我有这个密码:

  ImageIcon ii = new ImageIcon("https://c1.staticflickr.com/9/8384/8682624224_4e44bf947d_h.jpg"); 
  subStream.add(new JLabel(ii));

它的意思是将带有照片的JLabel添加到名为subStreamJPanel中。 但它不起作用,没有错误或任何东西。为什么

enter image description here

图片应该出现在第三个JPanel中,就在按钮上方


共 (0) 个答案