Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5044

Re: Problems with BasicComboBoxEditor

From "John B. Matthews" <nospam@nospam.invalid>
Newsgroups comp.lang.java.gui
Subject Re: Problems with BasicComboBoxEditor
Date 2012-02-18 21:44 -0500
Organization The Wasteland
Message-ID <nospam-DC823D.21441618022012@news.aioe.org> (permalink)
References <87k43pw2dq.fsf@bitburger.home.felix> <nospam-B28283.22151714022012@news.aioe.org> <238cc9c0-c79b-4909-9f04-3a8a6fdf11bc@k6g2000vbz.googlegroups.com>

Show all headers | View raw


In article 
<238cc9c0-c79b-4909-9f04-3a8a6fdf11bc@k6g2000vbz.googlegroups.com>,
 fnatter <fnatter@gmx.net> wrote:

> > 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...)

Excellent, but they're the ones who told me!

<http://docs.oracle.com/javase/tutorial/uiswing/components/border.html>

Looking a little closer, I see that only Nimbus includes a two pixel 
inset; the remaining L&Fs on my platform default to zero. Are you seeing 
something else? There's a screenshot here:

<http://stackoverflow.com/a/7605780/230513>

> > 2. Recycling the UI delegate's color(s) seems reasonable, but I'd urge
> > minimal tinkering and maximal testing.

Up-thread, you commented on the dilemma between uniformity and 
readability. I tend to favor the UI implementer's choice, particularly 
regarding color, but altering the margin seems safe.

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

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