function initializeTabPanel(h)

import java.awt.*;
import javax.swing.*; 
import com.mathworks.mwswing.*;

% -------------------------------------------------------------------------
%% Build timeseries naming tab control and its contents
% -------------------------------------------------------------------------
h.Handles.PNLtab = uipanel('Parent',h.Figure,'Units','Pixels','BackgroundColor',h.DefaultPos.FigureDefaultColor,'Position', ...
    [h.DefaultPos.leftoffsetpnl h.DefaultPos.bottomoffsetTabpnl h.DefaultPos.widthpnl h.DefaultPos.heightTabpnl]);
% create MJava Panel for single timeseries
tabSingle=MJPanel(GridLayout(2,2,h.DefaultPos.tabGridOffset,h.DefaultPos.tabGridOffset));
tabSingle.setBorder(BorderFactory.createEmptyBorder(h.DefaultPos.tabGridBorder, ...
    h.DefaultPos.tabGridBorder,h.DefaultPos.tabGridBorder,h.DefaultPos.tabGridBorder));
set(tabSingle,'Background',h.DefaultPos.FigureDefaultColor);
h.Handles.RADIOSingleNEW=MJRadioButton('Create a new time series with the name of');
set(h.Handles.RADIOSingleNEW,'Background',h.DefaultPos.FigureDefaultColor);
h.Handles.RADIOSingleIMPORT=MJRadioButton('Import data into an existing time series');
set(h.Handles.RADIOSingleIMPORT,'Background',h.DefaultPos.FigureDefaultColor);
btngrpSingle = ButtonGroup;
btngrpSingle.add(h.Handles.RADIOSingleNEW)
btngrpSingle.add(h.Handles.RADIOSingleIMPORT)
h.Handles.TXTSingleNEW=MJTextField();
h.Handles.COMBSingleIMPORT=MJComboBox();
%populate combobox with current timeseries objects in the base workspace
tsgui = tstool;
alltsobjects = get(tsgui.Tsnode.getChildren,{'Timeseries'});
for i=1:length(alltsobjects)
    awtinvoke(h.Handles.COMBSingleIMPORT,'addItem',java.lang.String(alltsobjects{i}.Name));
end
tabSingle.add(h.Handles.RADIOSingleNEW);
tabSingle.add(h.Handles.TXTSingleNEW);
tabSingle.add(h.Handles.RADIOSingleIMPORT);
tabSingle.add(h.Handles.COMBSingleIMPORT);
% create Matlab Java Panel for multiple timeseries
tabMultiple=MJPanel(GridLayout(2,2,h.DefaultPos.tabGridOffset,h.DefaultPos.tabGridOffset));
tabMultiple.setBorder(BorderFactory.createEmptyBorder(h.DefaultPos.tabGridBorder, ...
    h.DefaultPos.tabGridBorder,h.DefaultPos.tabGridBorder,h.DefaultPos.tabGridBorder));
set(tabMultiple,'Background',h.DefaultPos.FigureDefaultColor);
h.Handles.RADIOMultipleHEAD=MJRadioButton('Name the timeseries after the heading in Row ');
set(h.Handles.RADIOMultipleHEAD,'Background',h.DefaultPos.FigureDefaultColor);
h.Handles.RADIOMultipleSUFFIX=MJRadioButton('Name the timeseries using a numeric suffix ');
set(h.Handles.RADIOMultipleSUFFIX,'Background',h.DefaultPos.FigureDefaultColor);
btngrpMultiple = ButtonGroup;
btngrpMultiple.add(h.Handles.RADIOMultipleHEAD);
btngrpMultiple.add(h.Handles.RADIOMultipleSUFFIX);
h.Handles.TXTMultipleHEAD=MJTextField();
h.Handles.TXTMultipleSUFFIX=MJTextField();
tabMultiple.add(h.Handles.RADIOMultipleHEAD);
tabMultiple.add(h.Handles.TXTMultipleHEAD);
tabMultiple.add(h.Handles.RADIOMultipleSUFFIX);
tabMultiple.add(h.Handles.TXTMultipleSUFFIX);
% create a MJava tab pane
tmpPane = MJTabbedPane;
set(tmpPane,'Background',h.DefaultPos.FigureDefaultColor);
tmpPane.addTab('Single Time Series Object',tabSingle);
tmpPane.addTab('Multiple Time Series Objects',tabMultiple);
% creat a javacomponent
% the following three line are used only for unfixed geck 232843
tmpJPanel=MJPanel(GridLayout(1,1));
tmpJPanel.setOpaque(true);
set(tmpPane,'Parent',tmpJPanel);
[h.Handles.jComponent, h.Handles.jPNLtab] = javacomponent(tmpJPanel);
set(h.Handles.jPNLtab,'Parent',h.Handles.PNLtab,'Position',[h.DefaultPos.tabOffset h.DefaultPos.tabOffset ...
    h.DefaultPos.widthpnl-2*h.DefaultPos.tabOffset h.DefaultPos.heightTabpnl-2*h.DefaultPos.tabOffset]);
% set initial radio button position
awtinvoke(h.Handles.RADIOSingleNEW,'setSelected',true);
awtinvoke(h.Handles.RADIOMultipleHEAD,'setSelected',true);
