Get JLabel's Text - Java Swing

Java examples for Swing:JLabel

Description

Get JLabel's Text

Demo Code


import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;
 
public class Main {
        public void init(){
                JLabel label1 = new JLabel("JLabel Get Text.");
                String text = label1.getText();
        }/*from   w w w  .ja va 2 s  .co m*/
       
}

Related Tutorials