title: When using JFrame, where does the add() method come from?
body: <p>I've been roaming the Internet looking for an answer to this question, but have come up rather empty handed.   </p>
  
  <p>I'm following a JFrame practical from university, and using my lecture notes and the advice on the practical guidance sheet I have this basic code:    </p>
  
  <pre><code>public HelloFrameMenu()
  {
      message = "Hello, World!";
      label = new JLabel(message);
      label.setFont(new Font("Serif", Font.PLAIN, DEFAULT_SIZE));
      add(label, BorderLayout.CENTER);
      createSouthPanel();
  
      setSize(FRAME_WIDTH, FRAME_HEIGHT);
  }
  </code></pre>
  
  <p>This creates a text message on my JPanel and executes the createSouthPanel() method which works fine and adds some menu lists to the JFrame.</p>
  
  <p>My question is regarding the add function. I don't understand what this is part of. I thought if it was a static method, its class name would precede it. As it doesn't, I assumed it was part of the JFrame package or one of the classes automatically loaded by Java, but I can't find the method in either.</p>
  
  <p>Where does this method come from?<br>
  Why is it not preceded by anything?<br>
  What other methods can be used like this?   </p>