Closed. This question needs to be more focused。它当前不接受答案。
                        
                    
                
            
        
            
        
                
                    
                
            
                
                    想改善这个问题吗?更新问题,使其仅通过editing this post专注于一个问题。
                
                    3天前关闭。
            
        

    

因此,我已使用我的绘图项目绘制了此图像,但不知道如何将其保存到目录中。
enter image description here

你能帮我一下吗。

最佳答案

如果我理解正确,可以将图片拖放到IDE中,首先可以创建一个新文件夹(按右键单击项目,然后按new然后source folder,这是针对Eclipse的),然后查看我使用的内容(如果使用的是Swing):

 JLabel label = new JLabel("");
        Image img = new ImageIcon(this.getClass().getResource("imageName.jpg")).getImage();
        label.setIcon(new ImageIcon(img));
        label.setBounds(15, -228, 688, 391);
        frame.getContentPane().add(label);

09-30 17:45
查看更多