If you are using AWT, extend java.awt.Component and override paint() to mark the region. If you are using Swing, extend javax.swing.JComponent and override paintComponent(). In either case, use setBounds() to set the region's position and size and add a MouseListener to receive the mouse click.