Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextPane;

public class Main {
    public static void main(String args[]) {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JTextPane ta = new JTextPane();
        ta.setContentType("text/html");
        ta.setText("<HTML><BODY><CODE> import java.io.*; <br> public class MyIO{}</CODE><br></BODY></HTML>");
        JScrollPane jsp = new JScrollPane(ta);
        f.getContentPane().add(jsp);

        f.setSize(300, 200);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }
}