Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #5007
| From | Biagio <software@notario.it> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: JDateChooser setEnabled Color |
| Date | 2011-06-06 02:15 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <6c952213-9fbe-4bff-8771-6cb8349354ed@28g2000yqu.googlegroups.com> (permalink) |
| References | <543b5b7c-b7f7-4445-91fb-8f65391a8c68@n11g2000yqf.googlegroups.com> <nospam-DF21D0.13292205062011@news.aioe.org> |
On 5 Giu, 19:29, "John B. Matthews" <nos...@nospam.invalid> wrote: > In article > <543b5b7c-b7f7-4445-91fb-8f65391a8...@n11g2000yqf.googlegroups.com>, > > Biagio <softw...@notario.it> wrote: > > I'm using the powerfull JDateChooser JCalendar library 1.3.3. > > I assume you mean com.toedter.calendar.JDateChooser, found here: > > <http://www.toedter.com/en/jcalendar/> > > > Unfortunately, when the component is setEnabled (false) the color of > > date is a gray almost unreadable. > > The color has nothing to do with JDateChooser; it is specified by the > user interface default, which varies for each look and feel. > > > I tried to change color, but when the component is disabled is not > > possibile, it is always gray. > > > I would like to get a look like JTextField.setEditable (false). > > > Does anyone have any suggestions? > > Because JDateChooser has a com.toedter.calendar.JTextFieldDateEditor, a > subclass of javax.swing.JFormattedTextField, you can set the disabled > color of any particular instance: > > JDateChooser jdc = new JDateChooser(); > jdc.setEnabled(false); > ((JTextFieldDateEditor)jdc.getDateEditor()) > .setDisabledTextColor(Color.darkGray); > > Alternatively, you can change the UI manager's default, but I'd be wary > of veering too far from the familiar interface; it may be worthwhile to > choose a color derived from the expected value. > > String name = "FormattedTextField.inactiveForeground"; > ColorUIResource color = (ColorUIResource) UIManager.get(name); > UIManager.put(name, color.darker()); > > As an aside, I was recently critical of the demo's layout: > > <http://groups.google.com/group/comp.lang.java.programmer/msg/39c807ad...> > > Line 132 in com.toedter.calendar.demo.JCalendarDemo is the problem: > > splitPane.setDividerLocation(190); > > Simply remove it to allow pack() to do the right thing. > > -- > John B. Matthews > trashgod at gmail dot com > <http://sites.google.com/site/drjohnbmatthews> Thanks !!!! Biagio
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
JDateChooser setEnabled Color Biagio <software@notario.it> - 2011-06-05 00:52 -0700
Re: JDateChooser setEnabled Color "John B. Matthews" <nospam@nospam.invalid> - 2011-06-05 13:29 -0400
Re: JDateChooser setEnabled Color Tom <tom400f@gmail.com> - 2011-06-05 21:39 +0000
Re: JDateChooser setEnabled Color "John B. Matthews" <nospam@nospam.invalid> - 2011-06-06 00:02 -0400
Re: JDateChooser setEnabled Color Tom <tom400f@gmail.com> - 2011-06-06 19:53 +0000
Re: JDateChooser setEnabled Color Biagio <software@notario.it> - 2011-06-06 02:15 -0700
Re: JDateChooser setEnabled Color Roedy Green <see_website@mindprod.com.invalid> - 2011-06-06 19:27 -0700
csiph-web