title: Rendering a GUI button in a JPanel
body: <p>Consider that I have written "File" at the top left corner and then how can I add  a button at the top right corner?</p>
  
  <pre><code>public class FileViewer extends JPanel
  {
      private static final long serialVersionUID = 1L;
  
      public void paintComponent(Graphics g)
      {
          Graphics2D graphic = (Graphics2D)g;
          graphic.drawString("HTML File:", 14, 15);
      }
  }
  </code></pre>