davenzeng
public static void main(String[] args) throws IOException {
        JFrame frame = new JFrame("demo");
        JPanel panel = new JPanel();
        JLabel label = new JLabel();
        label.setIcon(new ImageIcon("D:\\Deeplearn\\data\\nv.jpg"));
        panel.add(label);
        //多图多label
        JLabel label1 = new JLabel();
        label1.setIcon(new ImageIcon("D:\\Deeplearn\\data\\nv.jpg"));
        panel.add(label1);
        frame.add(panel);
        //自适应窗口?
        frame.pack();
        //设置窗口可见,构造初始化是不可见的
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

  效果:

 

分类:

技术点:

相关文章:

  • 2021-07-20
  • 2022-01-01
  • 2021-08-06
  • 2021-09-01
  • 2021-12-21
  • 2021-09-12
  • 2021-07-13
  • 2021-11-05
猜你喜欢
  • 2021-07-31
  • 2021-09-26
  • 2021-09-12
  • 2022-01-01
  • 2021-08-15
  • 2022-01-06
  • 2021-06-05
相关资源
相似解决方案