Mega Code Archive

 
Categories / Java Tutorial / Swing
 

The text is left-justified and top-aligned

import javax.swing.JLabel; public class Main {   public static void main(String[] argv) throws Exception {     JLabel label = new JLabel("Text Label", JLabel.LEFT);     label.setVerticalAlignment(JLabel.TOP);   } }