Java SWT Download and resize images for viewing or editing with dynamic

Click the button to open the FileDialog window and select any image to display on a specific label.
The ImageLoader class is used to load images and save images to a file or stream.
ImageData strong> class - device-independent image descriptions
The SWT Image class can be used to display images in a graphical interface.
package rcp_demo.Editor; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.ImageData; import org.eclipse.swt.graphics.ImageLoader; public class ProductEditor extends EditorPart { public static final String ID="rcp_demo.Editor.product"; private Text text; private CLabel lbl_image_text; private static final String[] FILTER_NAMES = { "Images(*.jpg)","Images(*.jpeg)","Images(*.png)","All Files (*.*)"};
The CLabel class provides some additional Label class features. This class can display both a text label and an image label.
lbl_image_text.setText("Welcome"); lbl_image_text.setImage(SWTResourceManager.getImage("Image Path"));
source share