package textareapadding; import java.awt.Color; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.border.Border; public class TextAreaPadding extends JFrame { public TextAreaPadding() { super("Text Area Padding"); setSize(300, 100); setDefaultCloseOperation(EXIT_ON_CLOSE); setLocationRelativeTo(null); JTextArea area = new JTextArea("Some Text, Some Text, Some Text ........................................."); Border border = BorderFactory.createLineBorder(Color.DARK_GRAY); area.setBorder(BorderFactory.createCompoundBorder(border, BorderFactory.createEmptyBorder(10, 10, 10, 10))); area.setLineWrap(true); area.setEditable(false); add(area); setVisible(true); } public static void main(String[] args) { new TextAreaPadding(); } }
Pages
Wednesday, December 12, 2012
Mengatur Padding TextArea pada Java
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment