Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5043
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!k6g2000vbz.googlegroups.com!not-for-mail |
|---|---|
| From | fnatter <fnatter@gmx.net> |
| Newsgroups | comp.lang.java.gui |
| Subject | Re: Problems with BasicComboBoxEditor |
| Date | Sat, 18 Feb 2012 10:45:37 -0800 (PST) |
| Organization | http://groups.google.com |
| Lines | 62 |
| Message-ID | <238cc9c0-c79b-4909-9f04-3a8a6fdf11bc@k6g2000vbz.googlegroups.com> (permalink) |
| References | <87k43pw2dq.fsf@bitburger.home.felix> <nospam-B28283.22151714022012@news.aioe.org> |
| NNTP-Posting-Host | 217.232.93.16 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1329591150 25857 127.0.0.1 (18 Feb 2012 18:52:30 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Sat, 18 Feb 2012 18:52:30 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | k6g2000vbz.googlegroups.com; posting-host=217.232.93.16; posting-account=4ixPYgoAAAA9lsnRH1ASc6YpR2tZ2Gvk |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-Header-Order | HUALESNKRC |
| X-HTTP-UserAgent | Mozilla/5.0 (X11; Linux i686; rv:9.0.1) Gecko/20100101 Firefox/9.0.1 Iceweasel/9.0.1,gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.gui:5043 |
Show key headers only | View raw
On 15 Feb., 04:15, "John B. Matthews" <nos...@nospam.invalid> wrote:
> In article <87k43pw2dq....@bitburger.home.felix>,
> Felix Natter <fnat...@gmx.net> wrote:
>
>
>
>
>
>
>
>
>
> > I am using an editable ComboBox with BasicComboBoxEditor
> > (minimal example attached) with GTK or Nimbus L&Fs:
>
> > JComboBox comboBox = new JComboBox();
> > comboBox.setEditable(true);
> > comboBox.setEditor(new BasicComboBoxEditor());
>
> > I am having two problems with this:
>
> > #1. the first character in the editable combobox (which uses a
> > JTextField internally) cannot show the first letter completely (too
> > few left padding, see attached minimal example)
>
> > #2. The Background color of the editable combo box is white
> > (as opposed to normal comboboxes, which are grey, depending on L&F)
>
> > #1 can be worked around by using a MetalComboBoxEditor (without using
> > metal L&F) instead of the BasicComboBoxEditor. I think this solution
> > is satisfactory, but does there happen to be a better solution?
>
> > #2: Concerning the background color issue, I managed to change the
> > background color of the JTextField:
>
> 1. One approach is to use a compound Border with a suitable left margin:
>
> public ComboBoxEditorWithBGColor() {
> Color c = UIManager.getColor("ComboBox.background");
> editor.setBackground(c);
> editor.setBorder(BorderFactory.createCompoundBorder(
> editor.getBorder(), new EmptyBorder(0, 5, 0, 0)));
> }
That is a perfect solution, don't you want to send this patch to sun/
oracle?
(the BasicComboBoxEditor seems like a real bug to me...)
> 2. Recycling the UI delegate's color(s) seems reasonable, but I'd urge
> minimal tinkering and maximal testing.
>
> Note that you don't need the defaults or a new Color each time, and
> Swing GUI objects should be constructed and manipulated only on the
> event dispatch thread:
Yes, this was just a quick+dirty program ;-)
Thanks a lot and Best Regards,
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
Problems with BasicComboBoxEditor Felix Natter <fnatter@gmx.net> - 2012-02-14 22:06 +0100
Re: Problems with BasicComboBoxEditor "John B. Matthews" <nospam@nospam.invalid> - 2012-02-14 22:15 -0500
Re: Problems with BasicComboBoxEditor fnatter <fnatter@gmx.net> - 2012-02-18 10:45 -0800
Re: Problems with BasicComboBoxEditor "John B. Matthews" <nospam@nospam.invalid> - 2012-02-18 21:44 -0500
Re: Problems with BasicComboBoxEditor Lew <lewbloch@gmail.com> - 2012-02-15 09:45 -0800
Re: Problems with BasicComboBoxEditor fnatter <fnatter@gmx.net> - 2012-02-18 10:46 -0800
csiph-web