Calendar icon instead of arrow icon in DateComboBox?

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Calendar icon instead of arrow icon in DateComboBox?

Postby atkalla » Tue Jan 17, 2012 8:54 am

I wonder if there is an easy way to switch the standard "down arrow" icon in the DateComboBox into a calendar icon of personal choice?
atkalla
 
Posts: 10
Joined: Mon Jan 09, 2012 6:03 am

Re: Calendar icon instead of arrow icon in DateComboBox?

Postby JIDE Support » Tue Jan 17, 2012 9:29 am

Please try to use the following code and dynamically set the icon of the _button field.
Code: Select all
        DateComboBox comboBox = new DateComboBox() {
            JButton _button;
            @Override
            public AbstractButton createButtonComponent() {
                JButton dateButton = new JButton(IconsFactory.getImageIcon(ValueEditor.class, "icons/date.png"));
                dateButton.setMargin(new Insets(3, 3, 3, 3));
                _button = dateButton;
                return dateButton;
            }
        };
       comboBox.setButtonOnly(true)

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Calendar icon instead of arrow icon in DateComboBox?

Postby atkalla » Tue Jan 17, 2012 11:03 am

[PLEASE IGNORE]
atkalla
 
Posts: 10
Joined: Mon Jan 09, 2012 6:03 am

Re: Calendar icon instead of arrow icon in DateComboBox?

Postby JIDE Support » Tue Jan 17, 2012 11:08 am

Please try to invoke the following code to let the button not focusable.
Code: Select all
        button.setRequestFocusEnabled(false);
        button.setFocusable(false);

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 14 guests

cron