title: Java drawing String in JPanel
body: <p>I am complete Java noob and this question will be very easy. I did try to find answer across whole internet but, nothing was particularly what I need (if you know any tutorial pages for this subject please post link I would be very grateful.)</p>
  
  <p>Basically I am trying to draw string in my DrawPanel. I know I need to call method somewhere in order to do so but I have no idea where. My draw panel has method: </p>
  
  <pre><code>public void drawGuessWord(Graphics g){
      WordsList guessWord = new WordsList();
      String word = guessWord.pickWord();
      g.drawString(word, 20, 20);
  }
  </code></pre>
  
  <p>And I want to call that method so it would draw string inside DrawPanel.</p>
  
  <p>Just in case this is my whole DrawPanel:</p>
  
  <pre><code>import java.awt.*;
  import javax.swing.*;
  import javax.swing.border.Border;
  
  public class DrawPanel extends JPanel {
  
      DrawPanel(){
          Border raisedbevel = BorderFactory.createRaisedBevelBorder();
          Border loweredbevel = BorderFactory.createLoweredBevelBorder();
          this.setBackground(Color.WHITE);
          this.setBorder(BorderFactory.createLoweredBevelBorder());
          this.setPreferredSize(new Dimension(200,200));
      }
  
      public void drawGuessWord(Graphics g){
          WordsList guessWord = new WordsList();
          String word = guessWord.pickWord();
          g.drawString(word, 20, 20);
      }
  
  }
  </code></pre>