Switch to full style
Graphics and animation Java code examples
Post a reply

Label Alignment example

Fri Feb 08, 2013 8:22 pm

Label Alignment example in java
java code
import java.awt.*;
import java.applet.Applet;

public class LabelExample extends Applet {

public void init() {
Label labelLeft = new Label();
labelLeft.setText("Left");
Label labelCenter = new Label("Center");
labelCenter.setAlignment(Label.CENTER);
Label labelRight = new Label("Right", Label.RIGHT);

//Add Components to the Applet.
setLayout(new GridLayout(0, 1));
add(labelLeft);
add(labelCenter);
add(labelRight);

validate();
}
}




Post a reply
  Related Posts  to : Label Alignment example
 Working with menus, Label links and files in C#     -  
 Working with menus, Label links and files in C#     -  
 vertical alignment of span tag     -  
 Text alignment problem with IE     -  
 text alignment to right in a awt list box     -  
 how to change the alignment text in html     -  

Topic Tags

Java Applet, Java AWT