Web hosting script - Java Swing - O Reilly [2] Text in this

Java Swing - O Reilly [2] Text in this and following figures is from A.M. Turing, “Computing Machinery and Intelligence,” Mind, 1950. Figure 24.3. SimpleEditor Here’s the source code for SimpleEditor. It’s designed to be easily extensible, allowing us to add features of the more advanced editor kits. This class serves as the base class for the other examples in this chapter. // SimpleEditor.java // import javax.swing.*; import javax.swing.text.*; import java.awt.*; import java.io.*; import java.awt.event.*; import java.util.Hashtable; // An example showing several DefaultEditorKit features. This class is designed // to be easily extended to add additional functionality. public class SimpleEditor extends JFrame { public static void main(String[] args) { SimpleEditor editor = new SimpleEditor(); editor.addWindowListener(new BasicWindowMonitor()); editor.setVisible(true); } // Create an editor public SimpleEditor() { super(”Swing Editor”); textComp = createTextComponent(); hashDefaultActions(); makeActionsPretty(); updateKeymap(); Container content = getContentPane(); content.add(textComp, BorderLayout.CENTER); content.add(createToolBar(), BorderLayout.NORTH); setJMenuBar(createMenuBar()); setSize(320, 240); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent ev) { System.exit(0); } }); } // Create the JTextComponent subclass. protected JTextComponent createTextComponent() { - 799
If you are in need for cheap and reliable webhost to host your website, we recommend http web server services.

Leave a Reply