title: Override createToolTip() method of JPanel in java swing
body: <p>I have a <code>ListCellRenderer</code> which extends <code>JPanel</code>. Now I try to override its <code>createToolTip()</code>. But it seems like method is not getting overridden. What could be the reason?</p>
  
  <p>My Code:</p>
  
  <pre><code>public class MyRender extends JPanel implements ListCellRenderer {
  
      @Override
      public Component getListCellRendererComponent(JList list, Object value,
              int index, boolean isSelected, boolean cellHasFocus) {
          if (value != null) {
              removeAll();
  
              // -- add data to JPanel.
  
              setToolTipText("hi");
              return this;
          }
          return null;
      }
  
      @Override
      public JToolTip createToolTip() {
          System.out.println("Success");
          return new MyToolTip();
      }
  }
  </code></pre>
  
  <p>It doesn't even prints "Success".</p>