0

I added a List to a Dialog. I tried all the possibilities :

dialog.getContentPane().getSelectedStyle().setPadding(0, 0, 0, 0);
dialog.getContentPane().getUnselectedStyle().setPadding(0, 0, 0, 0);
dialog.getContentPane().getStyle().setPadding(0, 0, 0, 0);
list.getUnselectedStyle().setPadding(Component.LEFT, 0, false);
list.getSelectedStyle().setPadding(Component.LEFT, 0, false);
list.getStyle().setPadding(Component.LEFT, 0, false);

but there is still a space gap at the left : the colored Label returned from getListFocusComponent of the List renderer doesn't occupy all the Dialog's horizontal space !

So how to make the Label of the getListFocusComponent() occupy all the Dialog's horizontal space : left and right ?

bharath
  • 14,283
  • 16
  • 57
  • 95

1 Answers1

0

Set the list margin to 0 as well. The best way to see which component is responsible is to assign them a line border so you can see which component contains the padding/margin. Notice that the margin resides outside of that border.

Shai Almog
  • 51,749
  • 5
  • 35
  • 65