KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > swing > JLabel

javax.swing
Class JLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLabel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants
Direct Known Subclasses:
BasicComboBoxRenderer, DefaultListCellRenderer, DefaultTableCellRenderer, DefaultTreeCellRenderer
See Also:
Top Examples, Source Code, XMLEncoder, ComponentOrientation

protected int checkHorizontalKey(int key,
                                 String message)
See Also:
setHorizontalAlignment(int), setHorizontalTextPosition(int), IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected int checkVerticalKey(int key,
                               String message)
See Also:
setVerticalTextPosition(int), setVerticalAlignment(int), IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public AccessibleContext getAccessibleContext()
See Also:
JComponent, Accessible
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Icon getDisabledIcon()
See Also:
ImageIcon, LookAndFeel.getDisabledIcon(javax.swing.JComponent, javax.swing.Icon), setDisabledIcon(javax.swing.Icon)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getDisplayedMnemonic()
See Also:
setLabelFor(java.awt.Component), getLabelFor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getDisplayedMnemonicIndex()
See Also:
setDisplayedMnemonicIndex(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getHorizontalAlignment()
See Also:
SwingConstants, setHorizontalAlignment(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getHorizontalTextPosition()
See Also:
SwingConstants
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Icon getIcon()
See Also:
setIcon(javax.swing.Icon)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getIconTextGap()
See Also:
setIconTextGap(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Component getLabelFor()
See Also:
setDisplayedMnemonic(int), getDisplayedMnemonic()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getText()
See Also:
setText(java.lang.String)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public LabelUI getUI()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getUIClassID()
See Also:
UIDefaults.getUI(javax.swing.JComponent), JComponent
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getVerticalAlignment()
See Also:
setVerticalAlignment(int), SwingConstants
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getVerticalTextPosition()
See Also:
SwingConstants, setVerticalTextPosition(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public boolean imageUpdate(Image img,
                           int infoflags,
                           int x,
                           int y,
                           int w,
                           int h)
See Also:
ImageObserver, Component
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JLabel()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1599]Create JLabel with specific size and font
By Anonymous on 2005/11/04 20:23:08  Rate
JLabel result = new JLabel  (  ) ; 
 result.setPreferredSize  ( new Dimension  ( 80, 20 )  ) ; 
 result.setFont  ( new Font  ( "Arial", Font.PLAIN, 12 )  ) ; 
 


public JLabel(String text)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JLabel(String text,
              int horizontalAlignment)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JLabel(String text,
              Icon icon,
              int horizontalAlignment)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JLabel(Icon image)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public JLabel(Icon image,
              int horizontalAlignment)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected Component labelFor
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected String paramString()
See Also:
JComponent
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setDisabledIcon(Icon disabledIcon)
See Also:
JComponent.setEnabled(boolean), getDisabledIcon()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setDisplayedMnemonic(char aChar)
See Also:
setDisplayedMnemonic(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setDisplayedMnemonic(int key)
See Also:
setLabelFor(java.awt.Component), getLabelFor()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setDisplayedMnemonicIndex(int index)
                               throws IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setHorizontalAlignment(int alignment)
See Also:
getHorizontalAlignment(), SwingConstants
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setHorizontalTextPosition(int textPosition)
See Also:
SwingConstants, IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setIcon(Icon icon)
See Also:
getIcon(), setHorizontalTextPosition(int), setVerticalTextPosition(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setIconTextGap(int iconTextGap)
See Also:
getIconTextGap()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setLabelFor(Component c)
See Also:
setDisplayedMnemonic(int), getDisplayedMnemonic()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setText(String text)
See Also:
setIcon(javax.swing.Icon), setHorizontalTextPosition(int), setVerticalTextPosition(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1933]set text example
By Mihir on 2007/10/07 07:43:39  Rate
import java.awt.*; 
 import javax.swing.*; 
 import java.awt.event.*; 
 /*  < applet code =Jtext1 width=250 height=220 >  
   < /applet >  */
 
 public class Jtext1 extends JApplet  {  
     JTextField t1; 
     Container c1; 
     JPanel p1= new JPanel (  ) ; 
     Dimension dim = new Dimension ( 300,30 ) ; 
     public void init (  )  {  
         c1=this.getContentPane (  ) ; 
         t1.setText ( "Text already set" ) ; 
         p1.add ( t1 ) ; 
         c1.add ( p1 ) ; 
      }  
      
  } 


public void setUI(LabelUI ui)
See Also:
UIDefaults.getUI(javax.swing.JComponent)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setVerticalAlignment(int alignment)
See Also:
getVerticalAlignment(), SwingConstants
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setVerticalTextPosition(int textPosition)
See Also:
getVerticalTextPosition(), SwingConstants
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void updateUI()
See Also:
JComponent
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags