|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.Util
Defines a class containing commonly used utility methods.
Field Summary | |
static int |
BUTTON_HEIGHT
|
static int |
BUTTON_WIDTH
|
static int |
FONT_LARGE
|
static int |
FONT_MEDIUM
|
static int |
FONT_SMALL
|
static int |
FONT_XSMALL
|
static int |
HORIZONTAL_BUTTON_DISTANCE
|
static int |
VERTICAL_BUTTON_DISTANCE
|
Constructor Summary | |
Util()
|
Method Summary | |
static void |
centerJFrame(javax.swing.JFrame jFrame)
Makes sure that the frame is opened in the middle of the screen. |
static void |
setFont(javax.swing.JComponent comp,
boolean bold,
int size)
Sets the font for the specific JComponent |
static void |
setJComponentSize(javax.swing.JComponent c,
int width,
int height)
Forces the size of a JComponent. |
static java.lang.String |
shortString(java.lang.String str,
int length,
int nbrOfRows)
Cuts off a String to the desired length ending it with "...". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int BUTTON_WIDTH
public static final int BUTTON_HEIGHT
public static final int FONT_XSMALL
public static final int FONT_SMALL
public static final int FONT_MEDIUM
public static final int FONT_LARGE
public static final int HORIZONTAL_BUTTON_DISTANCE
public static final int VERTICAL_BUTTON_DISTANCE
Constructor Detail |
public Util()
Method Detail |
public static void setJComponentSize(javax.swing.JComponent c, int width, int height)
c
- the component to set the size onwidth
- the width to setheight
- the height to setpublic static void setFont(javax.swing.JComponent comp, boolean bold, int size)
comp
- the current JComponentbold
- true if font should be set to bould, plain if falsesize
- the size of the fontpublic static void centerJFrame(javax.swing.JFrame jFrame)
jFrame
- the frame to centerpublic static java.lang.String shortString(java.lang.String str, int length, int nbrOfRows)
str
- the String to be shortenedlength
- the desired lengthnbrOfRows
- number of rows (line breaks) in the returned string
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |