Browse Source

Replaced explicit Box construction with provided helper method.

pull/127/head
weisj 5 years ago
parent
commit
826d090b26
  1. 2
      core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java
  2. 7
      core/src/test/java/ui/button/GroupedButtonDemo.java

2
core/src/main/java/com/github/weisj/darklaf/ui/filechooser/DarkFileChooserUI.java

@ -229,7 +229,7 @@ public class DarkFileChooserUI extends DarkFileChooserUIBridge {
}
protected Component createTopButtonArea() {
Box box = new Box(BoxLayout.LINE_AXIS);
Box box = Box.createHorizontalBox();
box.add(createUpFolderButton());
box.add(makeHorizontalSpacer());

7
core/src/test/java/ui/button/GroupedButtonDemo.java

@ -39,7 +39,7 @@ public class GroupedButtonDemo implements ComponentDemo {
@Override
public JComponent createComponent() {
Box box = new Box(BoxLayout.LINE_AXIS);
Box box = Box.createHorizontalBox();
Icon icon = IconLoader.get().getIcon("menu/listFiles.svg", 19, 19, true);
Icon iconSelected = IconLoader.get().getIcon("menu/listFilesSelected.svg", 19, 19, true);
ButtonGroup bg = new ButtonGroup();
@ -49,7 +49,8 @@ public class GroupedButtonDemo implements ComponentDemo {
b = createButton(icon, iconSelected, bg, AlignmentExt.MIDDLE_HORIZONTAL, b);
box.add(b);
}
box.add(createButton(icon, iconSelected, bg, AlignmentExt.RIGHT, b), true);
box.add(createButton(icon, iconSelected, bg, AlignmentExt.RIGHT, true, b));
return new DemoPanel(box);
}
@ -69,7 +70,7 @@ public class GroupedButtonDemo implements ComponentDemo {
if (prev != null) prev.putClientProperty(DarkButtonUI.KEY_RIGHT_NEIGHBOUR, this);
putClientProperty(DarkButtonUI.KEY_LEFT_NEIGHBOUR, prev);
setSelected(isSelected);
// bg.add(this);
bg.add(this);
}};
}

Loading…
Cancel
Save