Processing lets you draw shapes, set line thickness and colors, display images and perform many other drawing functions in Java. It can be used it as a Java library and integrated into a Swing app.
Here's some sample Processing code:
void setup() {
size(400, 400); // set window size to 400 x 400 pixels
PImage lungImg = loadImage("https://i.stack.imgur.com/gwyp0.jpg");
image(lungImg, 0, 0);
}
void draw() {
}
void mousePressed() {
noFill(); // no fill color for the circle
stroke(255, 0, 0); // set pen color to red
strokeWeight(5); // set line thickness to 5 pixels
// draw ellipse at mouse position, 50 pixels height & width (i.e. a circle)
ellipse(mouseX, mouseY, 50, 50);
}
This will run on its own in the Processing IDE, which also adds some syntactic sugar. It is 'real' Java underneath; the methods in the above code can be found in the PApplet class.
Clicking places a red circle. Here's the resulting app:
