It looks like i am asking for help to disable the blue focus indicator effect inside a JComboBox in Java Swing. i want to remove the visual indication of focus (the blue border) when the JComboBox is selected, i think i can achieve this by using a custom UI. I don't know how i can do that:
JComboBox<Integer> day = new JComboBox<>();
for (int i = 1; i <= 31; i++) {
day.addItem(i);
}
day.setForeground(Color.LIGHT_GRAY);
day.setFont(new Font("SansSerif", Font.PLAIN, 11));
day.setFocusable(false);
day.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
day.setBorder(new RoundBorder());
day.setBackground(Color.WHITE);
day.setBounds(40, 192, 73, 40);
form.add(day);
public class RoundBorder extends AbstractBorder {
private static final long serialVersionUID = 1L;
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
Graphics2D g2 = (Graphics2D) g.create();
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
RoundRectangle2D round = new RoundRectangle2D.Float(x, y, width - 1, height - 1, 8, 8);
g2.setColor(new Color(0xe9eaec, false));
g2.draw(round);
g2.dispose();
}
@Override
public Insets getBorderInsets(Component c) {
return new Insets(4, 8, 4, 8);
}
@Override
public Insets getBorderInsets(Component c, Insets insets) {
insets.set(4, 8, 4, 8);
return insets;
}
}

Found the answer here. Since that link will probably disappear in future, here is its essence.
The question:
The answer:
Here is a SSCCE adapted from the code in your question that incorporates the above code:
Here is a screen capture of the result.