Unable to customize the button for my plugin

Answered

Hi Team,

I am unable to apply style (color) fully for my Button, when I try to do that it ends up coloring only the border.

Note: this button will be used in a plugin which will be deployed

Expected:

My Output:

 

My Implementation:
JButton test = new JButton("Test");
test.setPreferredSize(new Dimension(150,30));
test.setBackground(new Color(12,159,167));
jpanel.add(test);

0
3 comments

Plugins should not modify the colors of the UI's Look&Feel, as these colors are customizable by Theme plugins.

0

Yann Cebron How if I need to change the button to looks like red or blue based on positive and negative action scenario? Is there any API that can be used ?

Or if it cant, is there any methods or API to configure button as Primary or Secondary like this?

0

For DialogWrapper, you can set default button via com.intellij.openapi.ui.DialogWrapper#DEFAULT_ACTION and default focused button via com.intellij.openapi.ui.DialogWrapper#FOCUSED_ACTION

0

Please sign in to leave a comment.