Class DialogTools


public class DialogTools extends ToolToMakeYourLifeEasier
Since:
1.2: changed by Stefan Ostermann at 2005-04-26: added method to return localized string of a double value.,
1.3 changed by Carsten Schulze at 2005-05-22: added a method to center a given AWT-Window (or subclasses) on the screen.
Version:
$Rev: 1245 $
Author:
Ole Rahn, Stefan Ostermann, Carsten Schulze

FH Osnabrück - University of Applied Sciences Osnabrück
Project PIROL 2005
Daten- und Wissensmanagement
  • Constructor Details

    • DialogTools

      public DialogTools()
  • Method Details

    • centerOnScreen

      public static void centerOnScreen(Window window)
      This method centers the window (or subclasses of it) on the screen.
      Parameters:
      window - the java.awt.Window (or a subclass of it) that should be displayed in the middle of the screen.
    • centerOnWindow

      public static void centerOnWindow(Component component)
    • centerOnWindow

      public static void centerOnWindow(Component component2move, Component component2CenterOn)
    • getPanelWithLabels

      public static JPanel getPanelWithLabels(String text, int charsPerLine)
      This method creates a JPanel with several JLabels on it. For another method to display multiline bold text, have a look at the {javax.swing.JTextArea} and the Font object.
      Parameters:
      text - the text to split up into some JLabels.
      charsPerLine - the maximum number of characters per line text.
      Returns:
      the panel with the labels on it.
    • localNumberStringToDouble

      public static double localNumberStringToDouble(String s)
      This method replaces the localized decimal seperator with a dot.
      Parameters:
      s - the String containing the double value.
      Returns:
      the now dotted double value.
      See Also:
    • numberStringToLocalNumberString

      public static String numberStringToLocalNumberString(String s)
      This method replaces the dot with the localized decimal seperator.
      Parameters:
      s - the String containing the double value.
      Returns:
      the localized String containing the double value.
      See Also:
    • numberToLocalNumberString

      public static String numberToLocalNumberString(double number)
      This method replaces the dot with the localized decimal seperator.
      Parameters:
      number - the double value.
      Returns:
      the localized String containing the double value.
      See Also:
    • setPreferedWidth

      public static void setPreferedWidth(JComponent component, int width)
      Sets the prefered width of an JComponent and keeps it prefered height.
      Parameters:
      component - the component to alter
      width - the new prefered width
    • setPreferedHeight

      public static void setPreferedHeight(JComponent component, int height)
      Sets the prefered height of an JComponent and keeps it prefered height.
      Parameters:
      component - the component to alter
      height - the new prefered width
    • setMaximumWidth

      public static void setMaximumWidth(JComponent component, int width)
    • setMaximumHeight

      public static void setMaximumHeight(JComponent component, int height)