
org.fernice.reflare.ui.FlareToggleButtonUI Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fernice-reflare Show documentation
Show all versions of fernice-reflare Show documentation
CSS integration through fernice-flare in Java Swing as a LookAndFeel
The newest version!
package org.fernice.reflare.ui;
import java.awt.Cursor;
import javax.swing.AbstractButton;
import javax.swing.JComponent;
import javax.swing.JToggleButton;
import javax.swing.SwingUtilities;
import javax.swing.plaf.ComponentUI;
import org.fernice.reflare.element.ButtonElement;
import org.fernice.reflare.element.ToggleButtonElement;
import org.fernice.reflare.meta.DefinedBy;
import org.fernice.reflare.meta.DefinedBy.Api;
public class FlareToggleButtonUI extends FlareButtonUI {
@SuppressWarnings("unused")
@DefinedBy(Api.LOOK_AND_FEEL)
public static ComponentUI createUI(JComponent c) {
return new FlareToggleButtonUI();
}
@Override
protected void installDefaults(AbstractButton button) {
super.installDefaults(button);
button.setCursor(Cursor.getDefaultCursor());
SwingUtilities.invokeLater(() -> button.setBorderPainted(true));
}
@Override
protected ButtonElement createElement(AbstractButton button) {
return new ToggleButtonElement((JToggleButton) button);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy