View Javadoc

1   package com.ochafik.swing.syntaxcoloring;
2   import java.io.File;
3   
4   import javax.swing.JFrame;
5   import javax.swing.JScrollPane;
6   
7   import com.ochafik.io.ReadText;
8   
9   public class Test {
10  	public static void main(String args[]) {
11  		JFrame f=new JFrame("Test");
12  		String text=args.length==0 ? "" : ReadText.readText(new File(args[0]));
13  		JEditTextArea ta=new JEditTextArea();
14  		ta.setText(text);
15  		f.getContentPane().add("Center",new JScrollPane(ta));
16  		f.pack();
17  		f.show();
18  	}
19  }