Eclipse plugin 我必须在向导对话框上设置一个图像,类路径加载这个图像,但图像没有正确显示

Eclipse plugin 我必须在向导对话框上设置一个图像,类路径加载这个图像,但图像没有正确显示,eclipse-plugin,swt,wizard,smart-wizard,Eclipse Plugin,Swt,Wizard,Smart Wizard,我必须在swt中的向导对话框上设置一个图像,类路径加载此图像,但图像未正确显示。在我的设计中,在这个合成中创建一个合成。在这个合成之后,我想在这个合成中添加一个图像。然后,我将创建一个可运行的jar。这个jar将使用正确的图像执行。在我的实现部分,我在src文件夹中创建了一个资源(src文件夹),并在这个资源文件夹中保存了我需要的图像。请查找下面的代码 File file = new File("resources/Automatics_Logo.png"); Image image

我必须在swt中的向导对话框上设置一个图像,类路径加载此图像,但图像未正确显示。在我的设计中,在这个合成中创建一个合成。在这个合成之后,我想在这个合成中添加一个图像。然后,我将创建一个可运行的jar。这个jar将使用正确的图像执行。在我的实现部分,我在src文件夹中创建了一个资源(src文件夹),并在这个资源文件夹中保存了我需要的图像。请查找下面的代码

   File file = new File("resources/Automatics_Logo.png");
   Image image = new Image(Display.getDefault(), file.getPath());

   Label lblNewLabel_4 = new Label(composite, SWT.NONE);
  lblNewLabel_4.setImage(SWTResourceManager.getImage(CheckSystemConfigurationAndInstallation.class,image.toString()));

Image imgSWT=null;  // Image class is the SWT Image class
        ImageDescriptor imgDesc=null;
        java.net.URL imgURL = IntroductionPage.class.getResource("/Automatics_Logo.png");

        if (imgURL != null) {
            imgDesc = ImageDescriptor.createFromURL(imgURL);
            imgSWT = imgDesc.createImage();