
{filelink=23}
import java.awt.FlowLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingConstants;
import java.awt.Font;
public class UJLabel extends JFrame
{
public UJLabel()
{
setSize( 275, 180 );
setLayout( new FlowLayout() );
JLabel lblText = new JLabel();
// Souligner le texte de JLabel
lblText.setText("Exemple JLabel souligné:" );
lblText.setToolTipText( lblText.getText() );
add( lblText );
}
public static void main (String[] args) {
JFrame frameLabel=new UJLabel();
frameLabel.setTitle("Attributs des JLabels JLabel");
frameLabel.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
frameLabel.setVisible(true);
}
}