void (boolean vertical) { setOrientation(vertical); myPanel.remove(myToolbar.getComponent()); myToolbar.setOrientation(vertical ? SwingConstants.HORIZONTAL : SwingConstants.VERTICAL); myToolbarInsets.right = !vertical ? scale(1) : 0; myToolbarInsets.bottom = vertical ? scale(1) : 0; myPanel.add(vertical ? BorderLayout.NORTH : BorderLayout.WEST, myToolbar.getComponent()); updatePreview(); }