projects
/
jSite2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add look & feel selector into configuration dialog
[jSite2.git]
/
src
/
net
/
pterodactylus
/
jsite
/
gui
/
FontComboBox.java
diff --git
a/src/net/pterodactylus/jsite/gui/FontComboBox.java
b/src/net/pterodactylus/jsite/gui/FontComboBox.java
index
8c37cb4
..
1dcb77e
100644
(file)
--- a/
src/net/pterodactylus/jsite/gui/FontComboBox.java
+++ b/
src/net/pterodactylus/jsite/gui/FontComboBox.java
@@
-39,17
+39,24
@@
import javax.swing.ListCellRenderer;
*/
public class FontComboBox extends JComboBox {
*/
public class FontComboBox extends JComboBox {
- /**
- * Creates a new font combo box.
- */
- public FontComboBox() {
- super();
+ /** The font names. */
+ private static final String[] fontNames;
+
+ static {
Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
- String[] fontNames = new String[allFonts.length];
+ System.out.println("got " + allFonts.length + " fonts");
+ fontNames = new String[allFonts.length];
int fontIndex = 0;
for (Font font: allFonts) {
fontNames[fontIndex++] = font.getName();
}
int fontIndex = 0;
for (Font font: allFonts) {
fontNames[fontIndex++] = font.getName();
}
+ }
+
+ /**
+ * Creates a new font combo box.
+ */
+ public FontComboBox() {
+ super();
setModel(new DefaultComboBoxModel(fontNames));
setRenderer(new FontCellRenderer());
}
setModel(new DefaultComboBoxModel(fontNames));
setRenderer(new FontCellRenderer());
}