- // Create the Swing event listeners
- terminal = new SwingTerminal(listener, screen);
+ // Hang onto the session info
+ this.sessionInfo = terminal.getSessionInfo();
+
+ // SwingTerminal is the screen too
+ screen = terminal;
+ }
+
+ /**
+ * Public constructor will render onto a JComponent.
+ *
+ * @param component the Swing component to render to
+ * @param listener the object this backend needs to wake up when new
+ * input comes in
+ * @param windowWidth the number of text columns to start with
+ * @param windowHeight the number of text rows to start with
+ * @param fontSize the size in points. Good values to pick are: 16, 20,
+ * 22, and 24.
+ */
+ public SwingBackend(final JComponent component, final Object listener,
+ final int windowWidth, final int windowHeight, final int fontSize) {
+
+ // Create a Swing backend using a JComponent
+ terminal = new SwingTerminal(component, windowWidth, windowHeight,
+ fontSize, listener);