public void paint(Graphics g) { Graphics2D g2 = (Graphics2D) g; line.setLine(); g2.draw(line.getLine()); } // end paint method