title: Drawing a graph with Graphics2D using WindowBuilder
body: <p>So I have a JPanel called <em>displayPane</em> and I want to make it a drawing area for a graph (I am making a graphing calculator). I am using WindowBuilder and this is the generated code for the JPanel:</p>
  
  <pre><code>JPanel displayPane = new JPanel();
  displayPane.setBackground(Color.WHITE);
  displayPane.setBounds(173, 33, 455, 432);
  frame.getContentPane().add(displayPane);
  </code></pre>
  
  <p>After that I want to draw the axis of the graph but I have no idea how.
  I've searched everywhere about it but everyone constructs a member class or something in the main class and adds the paintComponent(Graphics g) but that confuses me. What is that trying to accomplish ? Or just give me your way of doing it I don't really care as long as I understand it.
  Any help is appreciated :)</p>