JComponent () { JPanel panel = new JPanel(new MigLayout("fillx, ins 0, gap 10, flowy")); JSlider hSlider = new JSlider(SwingConstants.HORIZONTAL){ @Override public void updateUI() { setUI(DarculaSliderUI.createUI(this)); updateLabelUIs(); } }; JSlider vSlider = new JSlider(SwingConstants.VERTICAL){ @Override public void updateUI() { setUI(DarculaSliderUI.createUI(this)); updateLabelUIs(); } }; JSlider hSliderBase = new JSlider(SwingConstants.HORIZONTAL); JPanel pane1 = new JPanel(new MigLayout("fillx, debug, ins 0, gap 5")); pane1.add(new JLabel("A color key and IntelliJ: "), "baseline"); pane1.add(hSliderBase, "baseline"); setupSlider(hSlider); setupSlider(vSlider); setupSlider(hSliderBase); panel.add(wrap((hSlider)), "growx"); panel.add(wrap(hSliderBase), "growx"); panel.add(wrap(vSlider)); return panel; }