Search in sources :

Example 1 with IconEditor

use of com.github.weisj.darklaf.components.iconeditor.IconEditor in project darklaf by weisJ.

the class IconEditorDemo method createComponent.

@Override
public JComponent createComponent() {
    IconEditor editor = new IconEditor(AllIconsDemo.loadIcons(16, false).stream().map(p -> new Pair<>(p.getFirst(), p.getSecond())).collect(Collectors.toList()));
    DemoPanel panel = new DemoPanel(editor, new BorderLayout(), 0);
    JPanel controls = panel.addControls();
    controls.add(new JCheckBox("Show add/remove controls") {

        {
            setSelected(editor.isShowEditorAddRemoveControls());
            addActionListener(e -> editor.setShowEditorAddRemoveControls(isSelected()));
        }
    });
    return panel;
}
Also used : java.awt(java.awt) DemoExecutor(com.github.weisj.darklaf.ui.demo.DemoExecutor) Pair(com.github.weisj.darklaf.util.Pair) IconEditor(com.github.weisj.darklaf.components.iconeditor.IconEditor) DarklafOnly(com.github.weisj.darklaf.core.test.DarklafOnly) BaseComponentDemo(com.github.weisj.darklaf.ui.demo.BaseComponentDemo) DemoPanel(com.github.weisj.darklaf.ui.DemoPanel) Collectors(java.util.stream.Collectors) javax.swing(javax.swing) DemoPanel(com.github.weisj.darklaf.ui.DemoPanel) IconEditor(com.github.weisj.darklaf.components.iconeditor.IconEditor)

Aggregations

IconEditor (com.github.weisj.darklaf.components.iconeditor.IconEditor)1 DarklafOnly (com.github.weisj.darklaf.core.test.DarklafOnly)1 DemoPanel (com.github.weisj.darklaf.ui.DemoPanel)1 BaseComponentDemo (com.github.weisj.darklaf.ui.demo.BaseComponentDemo)1 DemoExecutor (com.github.weisj.darklaf.ui.demo.DemoExecutor)1 Pair (com.github.weisj.darklaf.util.Pair)1 java.awt (java.awt)1 Collectors (java.util.stream.Collectors)1 javax.swing (javax.swing)1