JDK-6409293 : JTabbedPane.setComponentAt(index, null) throws NPE
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2006-04-05
  • Updated: 2011-01-31
  • Resolved: 2006-04-06
Related Reports
Duplicate :  
Description
JTabbedPane.setComponentAt() should be allowed to replace the component with null. Currently, if you replace a valid component with null, you get a NPE:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at javax.swing.JTabbedPane.setComponentAt(JTabbedPane.java:1398)

The code tries to set visibility to true and add the component even when non-null.

Comments
EVALUATION This requires a very trivial null check and will be fixed as part of 5089436.
06-04-2006