0

So my assignment wants me to create an applet but as an extra I'm supposed to use the paint method to draw a string, for example:

  public void paint(Graphics g){
           g.drawString("name, name name", 400,100);
    }

My problem is that this pretty much prevents the rest of my app from painting.

  • Just place it with the rest of the paint instructions. – Carcigenicate Jun 21 '15 at 03:23
  • 2
    Call `super.paint`, but the next question is, why are you using `paint` and not `paintComponent`? – MadProgrammer Jun 21 '15 at 03:25
  • Sorry MadProgrammer, this is the first time I've ever even heard of paint or worked with graphics. Thank you though, that did work. –  Jun 21 '15 at 03:40
  • Then you might like to take a look at [Painting in AWT and Swing](http://www.oracle.com/technetwork/java/painting-140037.html) and [Performing Custom Painting](http://docs.oracle.com/javase/tutorial/uiswing/painting/) – MadProgrammer Jun 21 '15 at 03:52

0 Answers0