private void configurePopupButton() { Side side = this.datePicker.getComponentOrientation().isLeftToRight() ? Side.LEFT : Side.RIGHT; this.substancePopupButton.putClientProperty( SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY, side); // this.substancePopupButton.putClientProperty( // SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, side); // this.substancePopupButton.putClientProperty( // SubstanceLookAndFeel.FLAT_PROPERTY, Boolean.TRUE); this.substancePopupButton.setRolloverEnabled(true); }
public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
@Override public void layoutContainer(Container parent) { Insets insets = datePicker.getInsets(); int width = datePicker.getWidth() - insets.left - insets.right; int height = datePicker.getHeight() - insets.top - insets.bottom; int popupButtonWidth = popupButton != null ? popupButton.getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds(ltr ? insets.left : insets.left + popupButtonWidth, insets.top, width - popupButtonWidth, height); if (popupButton != null) { popupButton.setBounds(ltr ? width - popupButtonWidth + insets.left : insets.left, insets.top, popupButtonWidth, height); } }
public void layoutContainer(Container parent) { int popupButtonWidth = substancePopupButton != null ? substancePopupButton .getPreferredSize().width : 0; boolean ltr = datePicker.getComponentOrientation().isLeftToRight(); datePicker.getEditor().setBounds( ltr ? layoutInsets.left : layoutInsets.left + popupButtonWidth, layoutInsets.top, datePicker.getWidth() - popupButtonWidth - layoutInsets.left - layoutInsets.right, datePicker.getHeight() - layoutInsets.top - layoutInsets.bottom); if (substancePopupButton != null) { if (ltr) { substancePopupButton.setBounds(datePicker.getWidth() - popupButtonWidth, 0, popupButtonWidth, datePicker .getHeight()); } else { substancePopupButton.setBounds(0, 0, popupButtonWidth, datePicker.getHeight()); } } } }