Java tutorial
import java.awt.Dimension; import javax.swing.JEditorPane; import javax.swing.JOptionPane; import javax.swing.JScrollPane; public class Main { public static void main(String[] args) { final JEditorPane editPane1 = new JEditorPane("text/html", "Try ty\tping some tabs"); editPane1.setPreferredSize(new Dimension(400, 300)); JOptionPane.showMessageDialog(null, new JScrollPane(editPane1)); JOptionPane.showMessageDialog(null, new JScrollPane(new JEditorPane("text/html", editPane1.getText()))); } }