private void ensureCurrentLayout(){
  if (!tabPane.isValid()) {
    tabPane.validate();
  }
  if (!tabPane.isValid()) {
    TabbedPaneLayout layout=(TabbedPaneLayout)tabPane.getLayout();
    layout.calculateLayoutInfo();
  }
}

private void ensureCurrentLayout ( ) { if ( ! tabPane . isValid ( ) ) { tabPane . validate ( ) ; } if ( ! tabPane . isValid ( ) ) { TabbedPaneLayout layout = ( TabbedPaneLayout ) tabPane . getLayout ( ) ; layout . calculateLayoutInfo ( ) ; } }
make sure we have laid out the pane with the current layout .
