| Author |
Using Constants
|
Landon Blake
Ranch Hand
Joined: Oct 15, 2004
Posts: 43
|
|
I'm looking for some help with the use of constants. For example, in the following statement we are setting the horizontal text position of a JLabel object to CENTER. testLabel.setHorizontalTextPosition(JLabel.CENTER); Is "JLabel.CENTER" a method call, or simply a way to reference the CENTER constant of the JLabel class? Thanks, Landon
|
 |
Amit Saini
Ranch Hand
Joined: Oct 20, 2004
Posts: 280
|
|
If it was a method call then it would have parenthesis (). But I dont see that , so CENTER is a constant. JLabel inherits this constant from the javax.swing.SwingConstants class. API notes: CENTER public static final int CENTER The central position in an area. Used for both compass-direction constants (NORTH, etc.) and box-orientation constants (TOP, etc.).
|
 |
 |
|
|
subject: Using Constants
|
|
|