Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JTextField;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;

public class Main {
    public static void main(String[] argv) throws Exception {
        JTextComponent textComp = new JTextField("Initial Text");
        Document doc = textComp.getDocument();

        // Append some text
        doc.insertString(doc.getLength(), "some text", null);
    }
}