Java 7 JColorChooser: Disable Transparency Slider

后端 未结 5 945
说谎
说谎 2020-12-19 04:35

JDK 7 added a new transparency slider to the JColorChooser:

\"enter

The proble

5条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-19 05:12

    Java 9 adds a new property to AbstractColorChooserPanel to control these sliders:

    public void setColorTransparencySelectionEnabled(boolean b);
    public boolean isColorTransparencySelectionEnabled();
    

    There is also a new overload of the static JColorChooser.showDialog method to specify that same property:

    public static Color showDialog(Component component, String title, Color initialColor,
        boolean colorTransparencySelectionEnabled);
    

    Java 9 is expected to be released in March 2017.

提交回复
热议问题