package openjava.debug.gui; import java.io.IOException; import java.awt.event.*; import javax.swing.*; import javax.swing.text.*; public class SourceCodeViewer extends JFrame { protected JTextPane textPane; public SourceCodeViewer() { super( "OpenJava" ); setBounds( 100, 100, 640, 600 ); setJMenuBar( initMenuBar() ); getContentPane().add( textPane = initPanel() ); } public static void main( String[] args ) throws IOException { final SourceCodeViewer frame = new SourceCodeViewer(); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { frame.dispose(); System.exit( 0 ); } public void windowActivated(WindowEvent e) { frame.getContentPane().requestFocus(); } }); frame.pack(); frame.setBounds( 100, 100, 640, 600 ); frame.setVisible( true ); } public static JTextPane initPanel() { JTextPane text = new JTextPane( new DefaultStyledDocument() ); //text.setEditorKit( new OJHTMLEditorKit() ); text.setContentType( "text/html; charset=EN" ); text.setText( "<pre><font color=red>This</font> is a test.\n Yes, it is.\n\ttab\nEnd.</pre>" ); return text; } public static JMenuBar initMenuBar() { JMenuBar mbar = new JMenuBar(); JMenu menu; menu = new JMenu( "File" ); menu.add( new JMenuItem( "Quit" ) ); mbar.add( menu ); menu = new JMenu( "Edit" ); menu.add( new JMenuItem( "Copy" ) ); menu.add( new JMenuItem( "Copy All" ) ); menu.add( new JMenuItem( "Reflesh" ) ); mbar.add( menu ); menu = new JMenu( "Help" ); menu.add( new JMenuItem( "About OpenJava" ) ); mbar.add( menu ); return mbar; } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 1462 | Julian Hyde | saffron: check in OpenJava20011117 source files, without any of my modifications | ||
#1 | 1461 | Julian Hyde |
saffron: First check in. Just documents, and the unmodified OpenJava 20001010 source files. |