1

I want to use glyphicons in JButton and I wonder if there are is some alternative for Java Swing. If not is there is a way I can use fontello in my Java project?

1 Answers1

2

Glyphicons use a font to display icons, each icon being a character in the font.

Therefore it is simple to use them in JButtons.

  1. Create a swing Font for the glyphicon font.
  2. Set the font on your JButton.
  3. Set the button label to the character of a glyphicon icon. The characters codes can be found for example in bootstrap.css.

Here is a detailed explanation using fontawesome instead of glyphicons but the technique is the same.

Community
  • 1
  • 1
wero
  • 32,544
  • 3
  • 59
  • 84