Class SwingHelper


  • public class SwingHelper
    extends java.lang.Object
    Assorted utility methods.
    Author:
    Pinaki Poddar
    • Constructor Summary

      Constructors 
      Constructor Description
      SwingHelper()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.AbstractButton getSelectedButton​(javax.swing.ButtonGroup group)  
      static java.lang.String getTimeString​(long value, java.util.concurrent.TimeUnit unit)  
      static void position​(java.awt.Component c, java.awt.Component parent)
      Position the given component at the center of the given parent component or physical screen.
      static void print​(java.awt.Component c, java.lang.String format, java.io.File output)  
      static void setLookAndFeel​(int fontSize)  
      static java.lang.String toString​(java.util.concurrent.TimeUnit unit)  
      • Methods inherited from class java.lang.Object

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

      • SwingHelper

        public SwingHelper()
    • Method Detail

      • position

        public static void position​(java.awt.Component c,
                                    java.awt.Component parent)
        Position the given component at the center of the given parent component or physical screen.
        Parameters:
        c - the component to be positioned
        parent - the component whose center will match the center of the given component. If null, the given component will match the screen center.
      • getTimeString

        public static java.lang.String getTimeString​(long value,
                                                     java.util.concurrent.TimeUnit unit)
      • toString

        public static java.lang.String toString​(java.util.concurrent.TimeUnit unit)
      • print

        public static void print​(java.awt.Component c,
                                 java.lang.String format,
                                 java.io.File output)
      • getSelectedButton

        public static javax.swing.AbstractButton getSelectedButton​(javax.swing.ButtonGroup group)
      • setLookAndFeel

        public static void setLookAndFeel​(int fontSize)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception