class pictureShow{
    JFrame fr1,fr2;
    JLabel pictureLabel1,pictureLabel2;    
    JPanel pan1,pan2;
    
    pictureShow(){
        
    }
    public void Show1()
    {
        fr1=new JFrame("根据酒店地理位置分簇的展示图");
        pan1=new JPanel();
        pictureLabel1=new JLabel(new ImageIcon(".\\picture1.png"));//相对路径
        pan1.add(pictureLabel1, BorderLayout.CENTER);
        
        fr1.setContentPane(pan1);
        fr1.pack();
        fr1.setVisible(true);
    }
    public void Show2()
    {
        fr2=new JFrame("根据酒店价格分簇的展示图");
        pan2=new JPanel();
        pictureLabel2=new JLabel(new ImageIcon("D:\\Eclipse\\workbench\\zyq_kmeans\\picture2.png"));//绝对路径
        pan2.add(pictureLabel2, BorderLayout.CENTER);
        
        fr2.setContentPane(pan2);
        fr2.pack();
        fr2.setVisible(true);
    }
}

 

相关文章:

  • 2021-12-10
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2021-07-19
  • 2021-11-21
  • 2022-01-01
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2022-02-09
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
相关资源
相似解决方案