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?
Asked
Active
Viewed 1,118 times
1 Answers
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.
- Create a swing Font for the glyphicon font.
- Set the font on your JButton.
- 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.