Java tutorial
//package com.java2s; import java.awt.Insets; import javax.swing.JTextArea; public class Main { public static JTextArea newJTextArea() { JTextArea ret = new JTextArea(); Insets insets = new Insets(4, 4, 4, 4); ret.setMargin(insets); // ret.setHorizontalAlignment(SwingConstants.RIGHT); return ret; } }