Java examples for Swing:JTextArea
Setting the Tab Size of a JTextArea Component
import java.awt.Font; import javax.swing.JTextArea; public class Main { public static void main(String[] argv) { JTextArea textarea = new JTextArea(); // Get the default tab size int tabSize = textarea.getTabSize(); // 8 // Change the tab size tabSize = 4;//from w w w . j a v a 2 s . c o m textarea.setTabSize(tabSize); Font font = textarea.getFont(); } }