I would like to know if there is some way in Swing to turn an ImageIcon to gray scale in a way like:
component.setIcon(greyed(imageIcon));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One limitation of
GrayFilter.createDisabledImage()is that it is designed to create a disabled appearance for icons across diverse Look & Feel implementations. Using thisColorConvertOpexample, the following images contrast the effect:GrayFilter.createDisabledImage():com.apple.laf.AquaLookAndFeelColorConvertOp#filter():com.apple.laf.AquaLookAndFeelGrayFilter.createDisabledImage():com.sun.java.swing.plaf.nimbus.NimbusLookAndFeelColorConvertOp#filter():com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel