Well it's on there, near the bottom.
( You can also use an image stored online, instead of storing in the resources directory)
Assuming your images are stored in a directory called "resources"
Firstly you need to read the image from the file. This should NOT be done inside the onPaint method as this would be VERY inefficient.
Declare the images you need as global variables of type BufferedImage, for example:
...
public class Main extends Script{
BufferedImage background;
@Override
public void onStart(){
}
...
}
Now we need to read the image from its file into the variable. This should be done inside onStart, as we only need to do it once:
...
public class Main extends Script{
BufferedImage background;
@Override
public void onStart(){
try{
background = ImageIO.read(Main.class.getResourceAsStream("/resources/background.png"));
} catch(IOException e){
log(e);
}
}
...
}
Now that the image has been read from its file we can draw it inside the onPaint method using g.drawImage:
public class Main extends Script{
BufferedImage background;
@Override
public void onStart(){
try{
background = ImageIO.read(Main.class.getResourceAsStream("/resources/background.png"));
} catch(IOException e){
log(e);
}
}
...
@Override
public void onPaint(Graphics2D g){
if(background != null){
g.drawImage(background, null, x, y);
}
}
}