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;
}
}
Aggregations