whitespace fixups
[jSite2.git] / src / net / pterodactylus / jsite / gui / FontComboBox.java
index 8c37cb4..7870a30 100644 (file)
@@ -35,21 +35,27 @@ import javax.swing.ListCellRenderer;
  *
  * @see GraphicsEnvironment#getAllFonts()
  * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
- * @version $Id$
  */
 public class FontComboBox extends JComboBox {
 
+       /** The font names. */
+       private static final String[] fontNames;
+
+       static {
+               Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
+               System.out.println("got " + allFonts.length + " fonts");
+               fontNames = new String[allFonts.length];
+               int fontIndex = 0;
+               for (Font font : allFonts) {
+                       fontNames[fontIndex++] = font.getName();
+               }
+       }
+
        /**
         * Creates a new font combo box.
         */
        public FontComboBox() {
                super();
-               Font[] allFonts = GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
-               String[] fontNames = new String[allFonts.length];
-               int fontIndex = 0;
-               for (Font font: allFonts) {
-                       fontNames[fontIndex++] = font.getName();
-               }
                setModel(new DefaultComboBoxModel(fontNames));
                setRenderer(new FontCellRenderer());
        }
@@ -58,7 +64,6 @@ public class FontComboBox extends JComboBox {
         * The cell renderer for the font name cells.
         *
         * @author David ‘Bombe’ Roden <bombe@freenetproject.org>
-        * @version $Id$
         */
        private static class FontCellRenderer extends JLabel implements ListCellRenderer {