View Single Post
  #2 (permalink)  
Old 07-31-2007, 07:56 AM
hardwired hardwired is online now
Senior Member
 
Join Date: Jul 2007
Posts: 1,193
hardwired is on a distinguished road
Here you are drawing on the image
Code:
Graphics2D g2 = (Graphics2D)image.getGraphics(); g2.drawString(textString, lastX, lastY);
To draw on the JPanel, use the panels graphic context,
not the graphic context of the image as you did above.
Code:
protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D)g; g2.drawString(textString, lastX, lastY);
Reply With Quote