Search in sources :

Example 1 with VerticalTextIcon

use of jgnash.ui.components.VerticalTextIcon in project jgnash by ccavanaugh.

the class MainViewPanel method addView.

void addView(final Container component, final String description, final String toolTip) {
    Objects.requireNonNull(description);
    Objects.requireNonNull(component);
    JXTitledPanel p = new JXTitledPanel(toolTip, component);
    component.setName(description);
    p.setName(description);
    JButton button = new Button(component, new VerticalTextIcon(description, false));
    button.addActionListener(this);
    button.setActionCommand(description);
    button.setName(description);
    if (toolTip != null) {
        button.setToolTipText(toolTip);
    } else {
        button.setToolTipText(description);
    }
    buttonPanel.addButton(button);
    if (contentPanel.getComponentCount() == 0) {
        last = component;
    }
    contentPanel.add(p, description);
    String lastComponent = pref.get(LAST_VIEW, "");
    if (lastComponent.equals(description)) {
        cardLayout.show(contentPanel, description);
        last = component;
    }
}
Also used : JXTitledPanel(org.jdesktop.swingx.JXTitledPanel) JButton(javax.swing.JButton) JButton(javax.swing.JButton) VerticalTextIcon(jgnash.ui.components.VerticalTextIcon)

Aggregations

JButton (javax.swing.JButton)1 VerticalTextIcon (jgnash.ui.components.VerticalTextIcon)1 JXTitledPanel (org.jdesktop.swingx.JXTitledPanel)1