This Java Swing component allows users to select a font by selecting a font family name, the style (plain, bold, italics)
EventQueue.invokeAndWait(() -> {
FontChooserDialog dialog = new FontChooserDialog((Frame) null, "Font Dialog Example", true);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setVisible(true);
if (!dialog.isCancelSelected()) {
System.out.println("Selected font is: " + dialog.getSelectedFont());
}
});
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
This is a modification of the JFontChooser component, written by Dr Christos Bohoris (Copyright 2009).
GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 https://www.gnu.org/licenses/lgpl-3.0.en.html