Example usage for javax.swing JTabbedPane add

List of usage examples for javax.swing JTabbedPane add

Introduction

In this page you can find the example usage for javax.swing JTabbedPane add.

Prototype

public void add(Component component, Object constraints) 

Source Link

Document

Adds a component to the tabbed pane.

Usage

From source file:org.jfree.chart.demo.JFreeChartAppletDemo.java

/**
 * Constructs the demo applet./*  w ww. j  a  va2s.  c o  m*/
 */
public JFreeChartAppletDemo() {

    final JTabbedPane tabs = new JTabbedPane();

    final XYDataset data1 = DemoDatasetFactory.createTimeSeriesCollection1();
    final JFreeChart chart1 = ChartFactory.createTimeSeriesChart("Time Series", "Date", "Rate", data1, true,
            true, false);
    final ChartPanel panel1 = new ChartPanel(chart1, 400, 300, 200, 100, 400, 200, true, false, false, false,
            true, true);
    tabs.add("Chart 1", panel1);

    final CategoryDataset data2 = DemoDatasetFactory.createCategoryDataset();
    final JFreeChart chart2 = ChartFactory.createBarChart("Bar Chart", "Categories", "Value", data2,
            PlotOrientation.HORIZONTAL, true, true, false);
    final ChartPanel panel2 = new ChartPanel(chart2, 400, 300, 200, 100, 400, 200, true, false, false, false,
            true, true);
    tabs.add("Chart 2", panel2);

    getContentPane().add(tabs);

}

From source file:de.dal33t.powerfolder.ui.information.stats.StatsInformationCard.java

/**
 * Build the ui component pane.//from   w  w  w .j a va  2  s. co m
 */
private void buildUIComponent() {

    FormLayout layout = new FormLayout("3dlu, fill:pref:grow, 3dlu", "3dlu, fill:pref:grow, 3dlu");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    CellConstraints cc = new CellConstraints();
    JTabbedPane tabbedPane = new JTabbedPane();

    builder.add(tabbedPane, cc.xy(2, 2));

    JPanel usedPanel = getUsedPanel();
    tabbedPane.add(usedPanel, Translation.getTranslation("stats_information_card.used_graph.text"));
    tabbedPane.setToolTipTextAt(0, Translation.getTranslation("stats_information_card.used_graph.tip"));

    JPanel averagePanel = getAveragePanel();
    tabbedPane.add(averagePanel, Translation.getTranslation("stats_information_card.percentage_graph.text"));
    tabbedPane.setToolTipTextAt(1, Translation.getTranslation("stats_information_card.percentage_graph.tip"));

    uiComponent = builder.getPanel();
}

From source file:com.sigma.applet.GraphsApplet.java

public void init() {
    final JTabbedPane tabs = new JTabbedPane();

    XYDataset data1 = createTimeSeriesCollection1(1.1);
    JFreeChart chart1 = ChartFactory.createTimeSeriesChart("Time Series", "Date", "Rate", data1, true, true,
            false);//from   w  w w  .ja va2 s .  c  om
    ChartPanel panel1 = new ChartPanel(chart1, 400, 300, 200, 100, 400, 200, true, false, false, false, true,
            true);
    tabs.add("Chart 1", panel1);

    XYDataset data2 = createTimeSeriesCollection1(0.8);
    JFreeChart chart2 = ChartFactory.createTimeSeriesChart("Time Series", "Date", "Rate", data2, true, true,
            false);
    ChartPanel panel2 = new ChartPanel(chart2, 400, 300, 200, 100, 400, 200, true, false, false, false, true,
            true);
    tabs.add("Chart 2", panel2);

    this.getContentPane().add(tabs);
}

From source file:net.schweerelos.parrot.CombinedParrotApp.java

private void initGUI(Properties properties) {
    try {/*  w  ww  .  j av  a 2s.  co  m*/
        this.setTitle(APP_TITLE);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                for (MainViewComponent mainViewComponent : mainViews) {
                    if (mainViewComponent instanceof ParrotStateListener) {
                        ((ParrotStateListener) mainViewComponent).parrotExiting();
                    }
                }
            }
        });
        setSize(920, 690);

        getContentPane().setLayout(new BorderLayout());

        UserInterfaceManager uiManager = new UserInterfaceManager(properties);
        navigators = new ArrayList<NavigatorComponent>(4);

        // main view
        listView = uiManager.createMainViewComponent(Style.TABLE);
        graphView = uiManager.createMainViewComponent(Style.GRAPH);
        mainViews.add(listView);
        mainViews.add(graphView);

        final JTabbedPane mainPanel = new JTabbedPane();
        mainPanel.add(graphView.getTitle(), graphView.asJComponent());
        mainPanel.add(listView.getTitle(), listView.asJComponent());

        mainPanel.setSelectedIndex(0);
        activeMainView = graphView;
        mainPanel.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                if (e.getSource() != mainPanel) {
                    return;
                }
                int selectedIndex = mainPanel.getSelectedIndex();
                if (selectedIndex == 0) {
                    activeMainView = graphView;
                } else if (selectedIndex == 1) {
                    activeMainView = listView;
                } else {
                    Logger logger = Logger.getLogger(CombinedParrotApp.class);
                    logger.warn("unknown tab index selected: " + selectedIndex);
                }
            }
        });

        add(mainPanel, BorderLayout.CENTER);

        // navigators
        JToolBar navigatorsBar = new JToolBar(JToolBar.HORIZONTAL);
        navigatorsBar.setMargin(new Insets(0, 11, 0, 0));
        navigatorsBar.setFloatable(false);
        getContentPane().add(navigatorsBar, BorderLayout.PAGE_START);

        // timeline
        NavigatorComponent timelineNavigator = uiManager.createTimelineNavigationComponent();
        navigators.add(timelineNavigator);

        JFrame timelineFrame = new JFrame(timelineNavigator.getNavigatorName() + "  " + APP_TITLE);

        timelineFrame.getContentPane().add(timelineNavigator.asJComponent());
        timelineFrame.pack();
        Point preferredLocation = new Point(0, 0);
        preferredFrameLocations.put(timelineFrame, preferredLocation);

        if (timelineNavigator.hasShowHideListener()) {
            timelineFrame.addComponentListener(timelineNavigator.getShowHideListener());
        }
        timelineFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

        JToggleButton timelineButton = setupNavigatorButton(timelineNavigator.getNavigatorName(),
                timelineNavigator.getAcceleratorKey(), timelineNavigator);
        navigatorsBar.add(timelineButton);

        // map      
        NavigatorComponent mapNavigator = uiManager.createMapNavigationComponent();
        navigators.add(mapNavigator);

        JFrame mapFrame = new JFrame(mapNavigator.getNavigatorName() + "  " + APP_TITLE);

        mapFrame.getContentPane().add(mapNavigator.asJComponent());
        mapFrame.pack();
        preferredLocation = new Point(0,
                Toolkit.getDefaultToolkit().getScreenSize().height - mapFrame.getHeight());
        preferredFrameLocations.put(mapFrame, preferredLocation);

        if (mapNavigator.hasShowHideListener()) {
            mapFrame.addComponentListener(mapNavigator.getShowHideListener());
        }
        mapFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

        JToggleButton mapButton = setupNavigatorButton(mapNavigator.getNavigatorName(),
                mapNavigator.getAcceleratorKey(), mapNavigator);
        navigatorsBar.add(mapButton);

        // search      
        NavigatorComponent searchNavigator = uiManager.createSearchComponent();
        navigators.add(searchNavigator);

        JFrame searchFrame = new JFrame(searchNavigator.getNavigatorName() + "  " + APP_TITLE);

        searchFrame.getContentPane().add(searchNavigator.asJComponent());
        searchFrame.pack();
        preferredLocation = new Point(
                Toolkit.getDefaultToolkit().getScreenSize().width - searchFrame.getWidth(), 0);
        preferredFrameLocations.put(searchFrame, preferredLocation);

        if (searchNavigator.hasShowHideListener()) {
            searchFrame.addComponentListener(searchNavigator.getShowHideListener());
        }
        searchFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);

        JToggleButton searchButton = setupNavigatorButton(searchNavigator.getNavigatorName(),
                searchNavigator.getAcceleratorKey(), searchNavigator);
        navigatorsBar.add(searchButton);

        // connections
        NavigatorComponent chainNavigator = uiManager.createChainNavigationComponent();
        navigators.add(chainNavigator);

        if (chainNavigator instanceof PickListener) {
            for (MainViewComponent mainViewComponent : mainViews) {
                mainViewComponent.addPickListener((PickListener) chainNavigator);
            }
        }

        if (chainNavigator.hasShowHideListener()) {
            chainNavigator.asJComponent().addComponentListener(chainNavigator.getShowHideListener());
        }

        JToggleButton connectionsButton = setupNavigatorButton(chainNavigator.getNavigatorName(),
                chainNavigator.getAcceleratorKey(), chainNavigator);
        navigatorsBar.add(connectionsButton);

        add(chainNavigator.asJComponent(), BorderLayout.PAGE_END);
        chainNavigator.asJComponent().setVisible(false);
    } catch (RuntimeException e) {
        e.printStackTrace(System.err);
        System.exit(1);
    } catch (UnknownStyleException e) {
        e.printStackTrace(System.err);
        System.exit(1);
    }
}

From source file:be.fedict.eid.tsl.tool.TslInternalFrame.java

private void addServiceProviderTab(JTabbedPane tabbedPane) {
    JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    tabbedPane.add("Service Providers", splitPane);

    DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("Service Providers");
    this.tree = new JTree(rootNode);
    this.tree.addTreeSelectionListener(this);
    for (TrustServiceProvider trustServiceProvider : this.trustServiceList.getTrustServiceProviders()) {
        DefaultMutableTreeNode trustServiceProviderNode = new DefaultMutableTreeNode(
                trustServiceProvider.getName());
        rootNode.add(trustServiceProviderNode);
        for (TrustService trustService : trustServiceProvider.getTrustServices()) {
            MutableTreeNode trustServiceNode = new DefaultMutableTreeNode(trustService);
            trustServiceProviderNode.add(trustServiceNode);
        }/* www .  java2  s  .  c o m*/
    }
    this.tree.expandRow(0);

    JScrollPane treeScrollPane = new JScrollPane(this.tree);
    JPanel detailsPanel = new JPanel();
    splitPane.setLeftComponent(treeScrollPane);
    splitPane.setRightComponent(detailsPanel);

    initDetailsPanel(detailsPanel);
}

From source file:org.freeinternals.javaclassviewer.ui.JSplitPaneClassFile.java

private void createAndShowGUI(JFrame top) {

    // Construct class file viewer
    final JTreeClassFile jTreeClassFile = new JTreeClassFile(this.classFile);
    jTreeClassFile.addTreeSelectionListener(new TreeSelectionListener() {
        @Override/*www.  j  a  v a2s.  co m*/
        public void valueChanged(final javax.swing.event.TreeSelectionEvent evt) {
            jTreeClassFileSelectionChanged(evt);
        }
    });
    final JPanelForTree panel = new JPanelForTree(jTreeClassFile, top);

    final JTabbedPane tabbedPane = new JTabbedPane();

    // Construct binary viewer
    this.binaryViewer = new JBinaryViewer();
    this.binaryViewer.setData(this.classFile.getClassByteArray());
    this.binaryViewerView = new JScrollPane(this.binaryViewer);
    this.binaryViewerView.getVerticalScrollBar().setValue(0);
    tabbedPane.add("Class File", this.binaryViewerView);

    // Construct opcode viewer
    this.opcode = new JTextPane();
    this.opcode.setAlignmentX(Component.LEFT_ALIGNMENT);
    // this.opcode.setFont(new Font(Font.DIALOG_INPUT, Font.PLAIN, 14));
    this.opcode.setEditable(false);
    this.opcode.setBorder(null);
    this.opcode.setContentType("text/html");
    tabbedPane.add("Opcode", new JScrollPane(this.opcode));

    // Class report
    this.report = new JTextPane();
    this.report.setAlignmentX(Component.LEFT_ALIGNMENT);
    this.report.setEditable(false);
    this.report.setBorder(null);
    this.report.setContentType("text/html");
    tabbedPane.add("Report", new JScrollPane(this.report));

    this.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    this.setDividerSize(5);
    this.setDividerLocation(280);
    this.setLeftComponent(panel);
    this.setRightComponent(tabbedPane);

    this.binaryViewerView.getVerticalScrollBar().setValue(0);
}

From source file:edu.clemson.cs.nestbed.client.gui.MoteDetailFrame.java

private JPanel buildBottomPane() {
    JPanel panel = new JPanel();
    JTabbedPane tabbedPane = new JTabbedPane();

    panel.setLayout(new BorderLayout());
    panel.add(tabbedPane, BorderLayout.CENTER);

    tabbedPane.add("Symbol Profiling", new JScrollPane(symbolTable));
    tabbedPane.add("Message Profiling", new JScrollPane(messageTable));

    return panel;
}

From source file:com.tascape.qa.th.android.driver.App.java

/**
 * The method starts a GUI to let an user inspect element tree and take screenshot when the user is interacting
 * with the app-under-test manually. Please make sure to set timeout long enough for manual interaction.
 *
 * @param timeoutMinutes timeout in minutes to fail the manual steps
 *
 * @throws Exception if case of error//from   w  w  w .j  a v a2s.  c  o  m
 */
public void interactManually(int timeoutMinutes) throws Exception {
    LOG.info("Start manual UI interaction");
    long end = System.currentTimeMillis() + timeoutMinutes * 60000L;

    AtomicBoolean visible = new AtomicBoolean(true);
    AtomicBoolean pass = new AtomicBoolean(false);
    String tName = Thread.currentThread().getName() + "m";
    SwingUtilities.invokeLater(() -> {
        JDialog jd = new JDialog((JFrame) null, "Manual Device UI Interaction - " + device.getProductDetail());
        jd.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);

        JPanel jpContent = new JPanel(new BorderLayout());
        jd.setContentPane(jpContent);
        jpContent.setPreferredSize(new Dimension(1088, 828));
        jpContent.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

        JPanel jpInfo = new JPanel();
        jpContent.add(jpInfo, BorderLayout.PAGE_START);
        jpInfo.setLayout(new BorderLayout());
        {
            JButton jb = new JButton("PASS");
            jb.setForeground(Color.green.darker());
            jb.setFont(jb.getFont().deriveFont(Font.BOLD));
            jpInfo.add(jb, BorderLayout.LINE_START);
            jb.addActionListener(event -> {
                pass.set(true);
                jd.dispose();
                visible.set(false);
            });
        }
        {
            JButton jb = new JButton("FAIL");
            jb.setForeground(Color.red);
            jb.setFont(jb.getFont().deriveFont(Font.BOLD));
            jpInfo.add(jb, BorderLayout.LINE_END);
            jb.addActionListener(event -> {
                pass.set(false);
                jd.dispose();
                visible.set(false);
            });
        }

        JLabel jlTimeout = new JLabel("xxx seconds left", SwingConstants.CENTER);
        jpInfo.add(jlTimeout, BorderLayout.CENTER);
        jpInfo.add(jlTimeout, BorderLayout.CENTER);
        new SwingWorker<Long, Long>() {
            @Override
            protected Long doInBackground() throws Exception {
                while (System.currentTimeMillis() < end) {
                    Thread.sleep(1000);
                    long left = (end - System.currentTimeMillis()) / 1000;
                    this.publish(left);
                }
                return 0L;
            }

            @Override
            protected void process(List<Long> chunks) {
                Long l = chunks.get(chunks.size() - 1);
                jlTimeout.setText(l + " seconds left");
                if (l < 850) {
                    jlTimeout.setForeground(Color.red);
                }
            }
        }.execute();

        JPanel jpResponse = new JPanel(new BorderLayout());
        JPanel jpProgress = new JPanel(new BorderLayout());
        jpResponse.add(jpProgress, BorderLayout.PAGE_START);

        JTextArea jtaJson = new JTextArea();
        jtaJson.setEditable(false);
        jtaJson.setTabSize(4);
        Font font = jtaJson.getFont();
        jtaJson.setFont(new Font("Courier New", font.getStyle(), font.getSize()));

        JTree jtView = new JTree();

        JTabbedPane jtp = new JTabbedPane();
        jtp.add("tree", new JScrollPane(jtView));
        jtp.add("json", new JScrollPane(jtaJson));

        jpResponse.add(jtp, BorderLayout.CENTER);

        JPanel jpScreen = new JPanel();
        jpScreen.setMinimumSize(new Dimension(200, 200));
        jpScreen.setLayout(new BoxLayout(jpScreen, BoxLayout.PAGE_AXIS));
        JScrollPane jsp1 = new JScrollPane(jpScreen);
        jpResponse.add(jsp1, BorderLayout.LINE_START);

        JPanel jpJs = new JPanel(new BorderLayout());
        JTextArea jtaJs = new JTextArea();
        jpJs.add(new JScrollPane(jtaJs), BorderLayout.CENTER);

        JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jpResponse, jpJs);
        jSplitPane.setResizeWeight(0.88);
        jpContent.add(jSplitPane, BorderLayout.CENTER);

        JPanel jpLog = new JPanel();
        jpLog.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
        jpLog.setLayout(new BoxLayout(jpLog, BoxLayout.LINE_AXIS));

        JCheckBox jcbTap = new JCheckBox("Enable Click", null, false);
        jpLog.add(jcbTap);
        jpLog.add(Box.createHorizontalStrut(8));

        JButton jbLogUi = new JButton("Log Screen");
        jpResponse.add(jpLog, BorderLayout.PAGE_END);
        {
            jpLog.add(jbLogUi);
            jbLogUi.addActionListener((ActionEvent event) -> {
                jtaJson.setText("waiting for screenshot...");
                Thread t = new Thread(tName) {
                    @Override
                    public void run() {
                        LOG.debug("\n\n");
                        try {
                            WindowHierarchy wh = device.loadWindowHierarchy();
                            jtView.setModel(getModel(wh));

                            jtaJson.setText("");
                            jtaJson.append(wh.root.toJson().toString(2));
                            jtaJson.append("\n");

                            File png = device.takeDeviceScreenshot();
                            BufferedImage image = ImageIO.read(png);

                            int w = device.getDisplayWidth();
                            int h = device.getDisplayHeight();

                            BufferedImage resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
                            Graphics2D g2 = resizedImg.createGraphics();
                            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                    RenderingHints.VALUE_INTERPOLATION_BILINEAR);
                            g2.drawImage(image, 0, 0, w, h, null);
                            g2.dispose();

                            JLabel jLabel = new JLabel(new ImageIcon(resizedImg));
                            jpScreen.removeAll();
                            jsp1.setPreferredSize(new Dimension(w + 30, h));
                            jpScreen.add(jLabel);

                            jLabel.addMouseListener(new MouseAdapter() {
                                @Override
                                public void mouseClicked(MouseEvent e) {
                                    LOG.debug("clicked at {},{}", e.getPoint().getX(), e.getPoint().getY());
                                    if (jcbTap.isSelected()) {
                                        device.click(e.getPoint().x, e.getPoint().y);
                                        device.waitForIdle();
                                        jbLogUi.doClick();
                                    }
                                }
                            });
                        } catch (Exception ex) {
                            LOG.error("Cannot log screen", ex);
                            jtaJson.append("Cannot log screen");
                        }
                        jtaJson.append("\n\n\n");
                        LOG.debug("\n\n");

                        jd.setSize(jd.getBounds().width + 1, jd.getBounds().height + 1);
                        jd.setSize(jd.getBounds().width - 1, jd.getBounds().height - 1);
                    }
                };
                t.start();
            });
        }
        jpLog.add(Box.createHorizontalStrut(38));
        {
            JButton jbLogMsg = new JButton("Log Message");
            jpLog.add(jbLogMsg);
            JTextField jtMsg = new JTextField(10);
            jpLog.add(jtMsg);
            jtMsg.addFocusListener(new FocusListener() {
                @Override
                public void focusLost(final FocusEvent pE) {
                }

                @Override
                public void focusGained(final FocusEvent pE) {
                    jtMsg.selectAll();
                }
            });
            jtMsg.addKeyListener(new KeyAdapter() {
                @Override
                public void keyPressed(java.awt.event.KeyEvent e) {
                    if (e.getKeyCode() == java.awt.event.KeyEvent.VK_ENTER) {
                        jbLogMsg.doClick();
                    }
                }
            });
            jbLogMsg.addActionListener(event -> {
                Thread t = new Thread(tName) {
                    @Override
                    public void run() {
                        String msg = jtMsg.getText();
                        if (StringUtils.isNotBlank(msg)) {
                            LOG.info("{}", msg);
                            jtMsg.selectAll();
                        }
                    }
                };
                t.start();
                try {
                    t.join();
                } catch (InterruptedException ex) {
                    LOG.error("Cannot take screenshot", ex);
                }
                jtMsg.requestFocus();
            });
        }
        jpLog.add(Box.createHorizontalStrut(38));
        {
            JButton jbClear = new JButton("Clear");
            jpLog.add(jbClear);
            jbClear.addActionListener(event -> {
                jtaJson.setText("");
            });
        }

        JPanel jpAction = new JPanel();
        jpContent.add(jpAction, BorderLayout.PAGE_END);
        jpAction.setLayout(new BoxLayout(jpAction, BoxLayout.LINE_AXIS));
        jpJs.add(jpAction, BorderLayout.PAGE_END);

        jd.pack();
        jd.setVisible(true);
        jd.setLocationRelativeTo(null);

        jbLogUi.doClick();
    });

    while (visible.get()) {
        if (System.currentTimeMillis() > end) {
            LOG.error("Manual UI interaction timeout");
            break;
        }
        Thread.sleep(500);
    }

    if (pass.get()) {
        LOG.info("Manual UI Interaction returns PASS");
    } else {
        Assert.fail("Manual UI Interaction returns FAIL");
    }
}

From source file:be.fedict.eid.tsl.tool.TslInternalFrame.java

private void addSignatureTab(JTabbedPane tabbedPane) {
    GridBagLayout gridBagLayout = new GridBagLayout();
    JPanel dataPanel = new JPanel(gridBagLayout);
    JPanel signaturePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    tabbedPane.add("Signature", new JScrollPane(signaturePanel));
    signaturePanel.add(dataPanel);/* ww w.j  a  v a 2  s  .c  o  m*/

    GridBagConstraints constraints = new GridBagConstraints();

    JLabel signerLabel = new JLabel("Signer");
    constraints.anchor = GridBagConstraints.FIRST_LINE_START;
    constraints.gridx = 0;
    constraints.gridy = 0;
    constraints.ipadx = 10;
    dataPanel.add(signerLabel, constraints);
    this.signer = new JLabel();
    constraints.gridx++;
    dataPanel.add(this.signer, constraints);

    JLabel signerSha1FingerprintLabel = new JLabel("Public key SHA1 fingerprint:");
    constraints.gridx = 0;
    constraints.gridy++;
    dataPanel.add(signerSha1FingerprintLabel, constraints);
    this.signerSha1Fingerprint = new JLabel();
    constraints.gridx++;
    dataPanel.add(this.signerSha1Fingerprint, constraints);

    JLabel signerSha256FingerprintLabel = new JLabel("Public key SHA256 fingerprint:");
    constraints.gridx = 0;
    constraints.gridy++;
    dataPanel.add(signerSha256FingerprintLabel, constraints);
    this.signerSha256Fingerprint = new JLabel();
    constraints.gridx++;
    dataPanel.add(this.signerSha256Fingerprint, constraints);

    this.saveSignerCertificateButton = new JButton("Save Certificate...");
    constraints.gridx = 0;
    constraints.gridy++;
    dataPanel.add(this.saveSignerCertificateButton, constraints);
    this.saveSignerCertificateButton.addActionListener(this);
    this.saveSignerCertificateButton.setEnabled(false);

    updateView();
}

From source file:org.eumetsat.metop.visat.IasiInfoView.java

@Override
protected JComponent createControl() {
    JTabbedPane tabbedPane = new JTabbedPane();
    tabbedPane.add("Sounder Info", createInfoComponent());
    tabbedPane.add("Sounder Spectrum", createSpectrumChartComponent());
    tabbedPane.add("Radiance Analysis", createRadianceAnalysisComponent());
    tabbedPane.add("Sounder Layer", createSounderLayerComponent());

    if (getDescriptor().getHelpId() != null) {
        HelpSys.enableHelpKey(tabbedPane, getDescriptor().getHelpId());
    }/*from w w  w  .ja  va  2 s  . c o  m*/

    InternalFrameListener internalFrameListener = new InternalFrameAdapter() {

        @Override
        public void internalFrameActivated(InternalFrameEvent e) {
            final Container contentPane = e.getInternalFrame().getContentPane();
            if (contentPane instanceof ProductSceneView) {
                final ProductSceneView view = (ProductSceneView) contentPane;
                final IasiLayer layer = getIasiLayer();
                if (layer != null) {
                    modelChanged(layer);
                } else {
                    final LayerListener layerListener = new AbstractLayerListener() {
                        @Override
                        public void handleLayersAdded(Layer parentLayer, Layer[] childLayers) {
                            final IasiLayer layer = getIasiLayer();
                            if (layer != null) {
                                modelChanged(layer);
                                view.getRootLayer().removeListener(this);
                            }
                        }
                    };
                    view.getRootLayer().addListener(layerListener);
                }
            }
        }

        @Override
        public void internalFrameDeactivated(InternalFrameEvent e) {
            if (currentOverlay != null) {
                currentOverlay.removeListener(overlayListener);
            }
            updateUI(null);
            editor.setModel(null);
        }
    };

    VisatApp.getApp().addInternalFrameListener(internalFrameListener);
    if (MetopSounderVPI.isValidAvhrrProductSceneViewSelected()) {
        final IasiLayer layer = getIasiLayer();
        if (layer != null) {
            modelChanged(layer);
        }
    }

    final AbstractButton helpButton = ToolButtonFactory.createButton(UIUtils.loadImageIcon("icons/Help24.gif"),
            false);
    helpButton.setToolTipText("Help."); /*I18N*/
    helpButton.setName("helpButton");

    if (getDescriptor().getHelpId() != null) {
        HelpSys.enableHelpOnButton(helpButton, getDescriptor().getHelpId());
        HelpSys.enableHelpKey(tabbedPane, getDescriptor().getHelpId());
    }

    final JPanel containerPanel = new JPanel(new BorderLayout());
    containerPanel.add(tabbedPane, BorderLayout.CENTER);
    final JPanel buttonPanel = new JPanel(new BorderLayout());
    buttonPanel.add(helpButton, BorderLayout.EAST);
    containerPanel.add(buttonPanel, BorderLayout.SOUTH);

    return containerPanel;
}