It's difficult to tell from your question how you're trying to draw the lines and circles so I am not sure if this is going to help you, but here's a sample app that does draw stuff:
package com.test;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import javax.swing.JFrame;
public class Program extends JFrame {
public Program() {
setSize(320, 200);
setBackground(Color.WHITE);
setForeground(Color.WHITE);
}
@Override
public void paint(Graphics g) {
Graphics2D graphics = (Graphics2D) g;
graphics.setPaint(Color.RED);
Rectangle2D.Double rectangle = new
Rectangle2D.Double(64, 64, 60, 30);
graphics.drawRect((int)rectangle.x, (int)rectangle.y,
(int)rectangle.width, (int)rectangle.height);
graphics.setPaint(Color.GREEN);
graphics.drawArc(120, 120, 32, 32, 0, 360);
}
public static void main(String[] args) throws Exception {
Program program = new Program();
program.setVisible(true);
System.in.read();
}
}
Hope this helps,
Fredrik Bornander