Icon doesn't load on WelcomeScreen.QuickStart.Platform group
Answered
icons class
package icons;
import com.intellij.openapi.util.IconLoader;
import javax.swing.*;
public class ClassName {
public static final Icon ICON_NAME = IconLoader.getIcon("/icons/icons-main.png");
}
plugin.xml configuration
<actions>
<action id="com.XXXXX.SetupHandler" class="com.XXXXX.SetupHandler"
text="XXXX" description="YYYY"
icon="ClassName.ICON_NAME">
<add-to-group group-id="WelcomeScreen.QuickStart.Platform" anchor="first"/>
</action>
</actions>
Please sign in to leave a comment.
Do you have any errors?
Did you try with loading any of the bundled icon?
No I don't have any errors.
The same icon loaded just fine when I loaded in the toolbar.
Tried giving the url directly too "/icons/main-icon.png" still a blank. But as you said the bundled icons work.
I also tried with an invalid reference. It printed an error and displayed a ? icon instead of blank space.
I'd assume then that something may be wrong with the icons that you provide - file type/resolution. Try to copy one of the bundled icon into your resources directory and try to use it.
Thanks for helping me find the perfect way to find the problem.
Seems that I was using a png icon of 15x15 px resolution.
Once I changed it to 16x16 px It worked.
Thanks a ton.