public class DialogTools extends ToolToMakeYourLifeEasier
Constructor and Description |
---|
DialogTools() |
Modifier and Type | Method and Description |
---|---|
static void |
centerOnScreen(java.awt.Window window)
This method centers the window (or subclasses of it) on the screen.
|
static void |
centerOnWindow(java.awt.Component component) |
static void |
centerOnWindow(java.awt.Component component2move,
java.awt.Component component2CenterOn) |
static javax.swing.JPanel |
getPanelWithLabels(java.lang.String text,
int charsPerLine)
This method creates a JPanel with several JLabels on it.
|
static double |
localNumberStringToDouble(java.lang.String s)
This method replaces the localized decimal seperator with a dot.
|
static java.lang.String |
numberStringToLocalNumberString(java.lang.String s)
This method replaces the dot with the localized decimal seperator.
|
static java.lang.String |
numberToLocalNumberString(double number)
This method replaces the dot with the localized decimal seperator.
|
static void |
setMaximumHeight(javax.swing.JComponent component,
int height) |
static void |
setMaximumWidth(javax.swing.JComponent component,
int width) |
static void |
setPreferedHeight(javax.swing.JComponent component,
int height)
Sets the prefered height of an JComponent and keeps it prefered height.
|
static void |
setPreferedWidth(javax.swing.JComponent component,
int width)
Sets the prefered width of an JComponent and keeps it prefered height.
|
public static void centerOnScreen(java.awt.Window window)
window
- the java.awt.Window (or a subclass of it) that should be
displayed in the middle of the screen.public static void centerOnWindow(java.awt.Component component)
public static void centerOnWindow(java.awt.Component component2move, java.awt.Component component2CenterOn)
public static javax.swing.JPanel getPanelWithLabels(java.lang.String text, int charsPerLine)
Font
object.text
- the text to split up into some JLabels.charsPerLine
- the maximum number of characters per line text.public static double localNumberStringToDouble(java.lang.String s)
s
- the String containing the double value.numberStringToLocalNumberString(String)
,
numberToLocalNumberString(double)
public static java.lang.String numberStringToLocalNumberString(java.lang.String s)
s
- the String containing the double value.localNumberStringToDouble(String)
,
numberToLocalNumberString(double)
public static java.lang.String numberToLocalNumberString(double number)
number
- the double value.numberStringToLocalNumberString(String)
,
localNumberStringToDouble(String)
public static void setPreferedWidth(javax.swing.JComponent component, int width)
component
- the component to alterwidth
- the new prefered widthpublic static void setPreferedHeight(javax.swing.JComponent component, int height)
component
- the component to alterheight
- the new prefered widthpublic static void setMaximumWidth(javax.swing.JComponent component, int width)
public static void setMaximumHeight(javax.swing.JComponent component, int height)