protected void updateLayout() { if (bar.getOrientation() == SwingConstants.HORIZONTAL) { bar.setLayout(new PercentLayout(PercentLayout.HORIZONTAL, 2)); } else { bar.setLayout(new PercentLayout(PercentLayout.VERTICAL, 2)); } }
@Override public Dimension getPreferredSize(JComponent c) { JButtonBar b = (JButtonBar) c; Dimension preferred = b.getLayout().preferredLayoutSize(c); if (b.getOrientation() == SwingConstants.HORIZONTAL) { return new Dimension(preferred.width, 53); } else { return new Dimension(74, preferred.height); } }