Class DemoUtility


  • public class DemoUtility
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DemoUtility()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int compareLocales​(java.util.Locale l1, java.util.Locale l2)
      Compares two locals.
      static java.awt.Panel createSpacer()  
      static void fixGrid​(java.awt.Container cont, int columns)
      Provides easy way to use basic functions of GridBagLayout, without the complications.
      private static int getCurrentYear()  
      static java.util.Locale[] getG7Locales()
      Get the G7 locale list for demos.
      static void setInsets​(java.awt.Container cont, java.awt.Component comp, java.awt.Insets insets)
      Provides easy way to change the spacing around an object in a GridBagLayout.
      static void setText​(java.awt.TextComponent area, java.lang.String newText)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • titleFont

        public static final java.awt.Font titleFont
      • labelFont

        public static final java.awt.Font labelFont
      • choiceFont

        public static final java.awt.Font choiceFont
      • editFont

        public static final java.awt.Font editFont
      • creditFont

        public static final java.awt.Font creditFont
      • numberFont

        public static final java.awt.Font numberFont
      • bgColor

        public static final java.awt.Color bgColor
      • choiceColor

        public static final java.awt.Color choiceColor
      • copyright1

        public static final java.lang.String copyright1
      • localeList

        private static java.util.Locale[] localeList
    • Constructor Detail

      • DemoUtility

        public DemoUtility()
    • Method Detail

      • getCurrentYear

        private static final int getCurrentYear()
      • fixGrid

        public static void fixGrid​(java.awt.Container cont,
                                   int columns)
        Provides easy way to use basic functions of GridBagLayout, without the complications. After building a panel, and inserting all the subcomponents, call this to lay it out in the desired number of columns.
      • setInsets

        public static void setInsets​(java.awt.Container cont,
                                     java.awt.Component comp,
                                     java.awt.Insets insets)
        Provides easy way to change the spacing around an object in a GridBagLayout. Call AFTER fixGridBag, passing in the container, the component, and the new insets.
      • createSpacer

        public static java.awt.Panel createSpacer()
      • setText

        public static void setText​(java.awt.TextComponent area,
                                   java.lang.String newText)
      • compareLocales

        public static int compareLocales​(java.util.Locale l1,
                                         java.util.Locale l2)
        Compares two locals. Return value is negative if they're different, and more positive the more fields that match.
      • getG7Locales

        public static java.util.Locale[] getG7Locales()
        Get the G7 locale list for demos.