src/share/classes/javax/swing/JLabel.java

Print this page




 838      *           <code>TRAILING</code>.
 839      *
 840      * @see SwingConstants
 841      */
 842     public int getHorizontalTextPosition() {
 843         return horizontalTextPosition;
 844     }
 845 
 846 
 847     /**
 848      * Sets the horizontal position of the label's text,
 849      * relative to its image.
 850      *
 851      * @param textPosition  One of the following constants
 852      *           defined in <code>SwingConstants</code>:
 853      *           <code>LEFT</code>,
 854      *           <code>CENTER</code>,
 855      *           <code>RIGHT</code>,
 856      *           <code>LEADING</code>, or
 857      *           <code>TRAILING</code> (the default).
 858      * @exception IllegalArgumentException
 859      *
 860      * @see SwingConstants
 861      * @beaninfo
 862      *       expert: true
 863      *        bound: true
 864      *         enum: LEFT     SwingConstants.LEFT
 865      *               CENTER   SwingConstants.CENTER
 866      *               RIGHT    SwingConstants.RIGHT
 867      *               LEADING  SwingConstants.LEADING
 868      *               TRAILING SwingConstants.TRAILING
 869      *    attribute: visualUpdate true
 870      *  description: The horizontal position of the label's text,
 871      *               relative to its image.
 872      */
 873     public void setHorizontalTextPosition(int textPosition) {
 874         int old = horizontalTextPosition;
 875         this.horizontalTextPosition = checkHorizontalKey(textPosition,
 876                                                 "horizontalTextPosition");
 877         firePropertyChange("horizontalTextPosition",
 878                            old, horizontalTextPosition);




 838      *           <code>TRAILING</code>.
 839      *
 840      * @see SwingConstants
 841      */
 842     public int getHorizontalTextPosition() {
 843         return horizontalTextPosition;
 844     }
 845 
 846 
 847     /**
 848      * Sets the horizontal position of the label's text,
 849      * relative to its image.
 850      *
 851      * @param textPosition  One of the following constants
 852      *           defined in <code>SwingConstants</code>:
 853      *           <code>LEFT</code>,
 854      *           <code>CENTER</code>,
 855      *           <code>RIGHT</code>,
 856      *           <code>LEADING</code>, or
 857      *           <code>TRAILING</code> (the default).

 858      *
 859      * @see SwingConstants
 860      * @beaninfo
 861      *       expert: true
 862      *        bound: true
 863      *         enum: LEFT     SwingConstants.LEFT
 864      *               CENTER   SwingConstants.CENTER
 865      *               RIGHT    SwingConstants.RIGHT
 866      *               LEADING  SwingConstants.LEADING
 867      *               TRAILING SwingConstants.TRAILING
 868      *    attribute: visualUpdate true
 869      *  description: The horizontal position of the label's text,
 870      *               relative to its image.
 871      */
 872     public void setHorizontalTextPosition(int textPosition) {
 873         int old = horizontalTextPosition;
 874         this.horizontalTextPosition = checkHorizontalKey(textPosition,
 875                                                 "horizontalTextPosition");
 876         firePropertyChange("horizontalTextPosition",
 877                            old, horizontalTextPosition);