title: Displaying Class Which Extends JScrollPane
body: <p>I'm still relatively new to Swing and GUI programming in general, so I'm probably making some very simple mistake here, but:</p>
  
  <p>I have a class called <code>TilePanel</code> which extends <code>JScrollPane</code>. The purpose of this class is to contain another custom class of mine, <code>TileMap</code>, which itself extends <code>JPanel</code>. The problem I have is that the <code>TilePanel</code> never displays.</p>
  
  <p>This seems exceedingly weird to me, because, before creating the <code>TilePanel</code> class,   I ran a test where I used a normal <code>JScrollPane</code>  in its place, and added the <code>TileMap</code> to it. This displayed normally for me, and I was able to successfully scroll my <code>TileMap</code>. The code in my <code>TilePanel</code> class doesn't really change much about the <code>JScrollPane</code> yet, so I can see no reason why this should not be working.</p>
  
  <p>Here is the code for the <code>TilePanel</code> class:</p>
  
  <pre><code>import javax.swing.JScrollPane;
  
  public class TilePanel extends JScrollPane
  {
      TileMap map;
  
      public TilePanel(int rows, int cols)
      {
          super(VERTICAL_SCROLLBAR_NEVER, HORIZONTAL_SCROLLBAR_NEVER);
  
          map = new TileMap(rows, cols, 9, 9);
          map.addBorder(Tile.EMPTY, 9);
          this.add(map);
      }
  }
  </code></pre>
  
  <p><code>TileMap</code> uses a <code>GridLayout</code> for its default layout, if that effects anything.</p>
  
  <p>From my searches both on here, and elsewhere, I have not found anyone having a similar problem, unless I'm just really bad at searching. I found a few people who had problems with adding stuff to the <code>JScrollPane</code> itself, but not anyone who had a problem displaying a class which extended <code>JScrollPane</code>.</p>
  
  <p>If more information is needed, I'll be happy to add it.</p>