public ManagementConsole(SwingAgentBridge swingAgentBridge) {
   super("Management Console");
   managementGuiAdapter = new ManagementGuiAdapter( swingAgentBridge, this );
   Console console=new Console(managementGuiAdapter, "managementAdapter");
   JScrollPane pane=new JScrollPane(console.getTextPane());
   console.write("Tryllian AFC Habitat Management Console\n" +
                                "Uses Jython technology.\n" ,"output");
   console.capturePythonOutput();
   console.getTextPane().requestFocus();
   console.newInput();
   getContentPane().add(pane);
}

Example 3: Embedding a Jython Swing component in a Java application.

Back to Article