REg : DateExComboBox - Color Issue & Min Date and Max Date

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.

REg : DateExComboBox - Color Issue & Min Date and Max Date

Postby dineshddk » Mon Jul 02, 2012 6:40 am

Hi Team,

1. I am using the "Date Ex Combo Box" sample. I'm unable set the Foreground and Background Color for Combo box "down arrow button". Please refer the attached screenshot.


2. I attached the sample program extending the "Date Ex Combo Box" class.
If I set the "Minimum Date" & "Maximum Date" for the Date Model but it fails to set Max and Min Limit. (But the arrow buttons are still Enable to select behind / beyond the date).


FYI: If the class is not extended, the date limits are working fine.

But I'm unable to set the user defined color for the date 1-31, week column and other colors as extended in user defined class.

Could you please suggest is there any method to set the user defined color for the date and down arrow buttons, minimum / maximum date. ?
Attachments
ExtendJideDateExcomboTest.java
Extended class of Date Ex Combo Box
(2.3 KiB) Downloaded 1981 times
DateExComboBoxTest.java
Main Class Which uses the Extended class of Date Ex Combo Box
(3.65 KiB) Downloaded 1939 times
Screen_Shot_01.PNG
How to Set the Foreground and Background color for the Date Ex Combo Box.
Screen_Shot_01.PNG (2.95 KiB) Viewed 19037 times
dineshddk
 
Posts: 1
Joined: Mon Jul 02, 2012 4:43 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby JIDE Support » Mon Jul 02, 2012 9:54 am

1, Please delegate the getDateModel() to DateChooserPanel so that the DateChooserPanel could know the min/max date setting in the DateModel. The modified class is attached FYI.
2, Please create the button by overriding DateExComboBox#createButtonComponent() so that you could get full control of the foreground/background of the button. The modified code is also included in the attached classes FYI.

Thanks,
Attachments
DateExComboBoxTest.java
(3.92 KiB) Downloaded 2052 times
ExtendJideDateExcomboTest.java
(3.3 KiB) Downloaded 2008 times
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby mervege » Tue Nov 30, 2021 1:20 am

Hello,

Also, I have an issue about ExCombobox's background. I need to set background for ListExCombobox, TreeExCombobox, MonthExCombobox, ...

Could you please help me? I've tried combobox.setBackground(Color.x); however, it doesn't work.

Thank you!
Attachments
ExCombo.png
ExCombo.png (13.26 KiB) Viewed 10632 times
mervege
 
Posts: 4
Joined: Wed Nov 24, 2021 3:39 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby JIDE Support » Tue Nov 30, 2021 6:04 pm

Code: Select all
        ExComboBox comboBox = ...
        comboBox.setEditable(true);

You can set the editorComponent color. However I believe Windows uses native code to draw the text field so you can't set the background. Foreground works but not background.
Code: Select all
        fontComboBox.getEditor().getEditorComponent().setForeground(Color.GREEN);
        fontComboBox.getEditor().getEditorComponent().setBackground(Color.RED);
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby mervege » Tue Nov 30, 2021 11:23 pm

Thank you for your concern. I tried and as you said I can just be able to change foreground color. Instead of this solution, I tried to set UI. I can change the color of combos. However, this time when I clicked them, "Exception in thread "AWT-EventQueue-0" java.lang.NegativeArraySizeException" exception appears.
Attachments
excombo2.png
excombo2.png (12.35 KiB) Viewed 10611 times
mervege
 
Posts: 4
Joined: Wed Nov 24, 2021 3:39 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby JIDE Support » Wed Dec 01, 2021 9:21 am

What did you do exactly? The complete code?
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: REg : DateExComboBox - Color Issue & Min Date and Max Da

Postby mervege » Thu Dec 02, 2021 1:13 am

I was trying to change UI. Finally, I solved the problem. Colors are changed, also panels are working well.
The code was like this;

"UIDefaults defaults = UIManager.getDefaults();
defaults.put("ExComboBoxUI", "com.jidesoft.plaf.basic.BasicExComboBoxUI");"

Thank you for your support! Best regards.
Attachments
comboFinal.png
comboFinal.png (11.06 KiB) Viewed 10574 times
mervege
 
Posts: 4
Joined: Wed Nov 24, 2021 3:39 am


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

Who is online

Users browsing this forum: Google [Bot] and 10 guests

cron