0

The question is in the title.

Here's my code :

JButton button = new JButton("JOUER", new ImageIcon(getClass().getResource("template.png")));
button.setBounds(0, 0, 215, 84);
button.setBackground(new Color(0,0,0,0));
button.setFont(new Font("Bebas Neue Bold", Font.TRUETYPE_FONT, 50));
button.setForeground(Color.WHITE);
button.setVerticalTextPosition(SwingConstants.CENTER);
button.setHorizontalTextPosition(SwingConstants.CENTER);

Here's the result :

The result

And I just want to know if is it possible to outline my text.

Here's the result I want to have:

The button I want to have

Gilbert Le Blanc
  • 50,182
  • 6
  • 67
  • 111
Melody
  • 1
  • So you want to outline your button, but the "[button you want to have](https://www.zupimages.net/up/20/48/7ods.png)" does not have an outline. Which is it? – Cardinal System Nov 27 '20 at 21:51
  • Images should be uploaded to this site so they are visible with your question. – camickr Nov 28 '20 at 00:09
  • Maybe something like: https://stackoverflow.com/questions/24028358/change-jbutton-focus-area/24028405#24028405 – camickr Nov 28 '20 at 00:11
  • The appearance of raised text has to be part of the font. Otherwise, you can try [Outline Font paint](http://www.java2s.com/Code/Java/2D-Graphics-GUI/OutlineFontpaint.htm). – Gilbert Le Blanc Dec 16 '20 at 10:59

0 Answers0