Mega Code Archive
Lines are left justified This label text will center the lines
import javax.swing.JButton;
public class Main {
public static void main(String[] argv) throws Exception {
JButton button = new JButton();
button.setText("" + "This is a" + "
" + "swing button"
+ "");
}
}