So, first part - images. It was so trivial it hurts.
Images go to the resources
folder as usual and can be addressed then naturally by getResourceAsStream
.
Example Filetree:
/src
/main
/resources
/images
/robot.gif
Code:
public class SimpleEntryPoint implements EntryPoint {
@Override
public int createUI() {
Display display = new Display();
InputStream instr = getClass().getResourceAsStream("/images/robot.gif");
Shell shell = new Shell(display);
shell.setLayout(new GridLayout());
Label label = new Label(shell, SWT.NONE);
Image robotImage = new Image(display, instr); // tried to put "/images/robot.gif" here, but doesn't work.
label.setImage(robotImage);
shell.setSize(500, 400);
shell.open();
return 0;
}
}