public int getTitleHeight(Component c) {
   int th = 21;
   int fh = getBorderInsets(c).top + getBorderInsets(c).bottom;
   if (c instanceof JDialog) {
     JDialog dialog = (JDialog) c;
     th = dialog.getSize().height - dialog.getContentPane().getSize().height - fh - 1;
     if (dialog.getJMenuBar() != null) {
       th -= dialog.getJMenuBar().getSize().height;
     }
   } else if (c instanceof JInternalFrame) {
     JInternalFrame frame = (JInternalFrame) c;
     th = frame.getSize().height - frame.getRootPane().getSize().height - fh - 1;
     if (frame.getJMenuBar() != null) {
       th -= frame.getJMenuBar().getSize().height;
     }
   } else if (c instanceof JRootPane) {
     JRootPane jp = (JRootPane) c;
     if (jp.getParent() instanceof JFrame) {
       JFrame frame = (JFrame) c.getParent();
       th = frame.getSize().height - frame.getContentPane().getSize().height - fh - 1;
       if (frame.getJMenuBar() != null) {
         th -= frame.getJMenuBar().getSize().height;
       }
     } else if (jp.getParent() instanceof JDialog) {
       JDialog dialog = (JDialog) c.getParent();
       th = dialog.getSize().height - dialog.getContentPane().getSize().height - fh - 1;
       if (dialog.getJMenuBar() != null) {
         th -= dialog.getJMenuBar().getSize().height;
       }
     }
   }
   return th;
 }
    /**
     * Calculates the preferred size dimensions for the specified panal given the components in the
     * specified parent container.
     */
    public Dimension preferredLayoutSize(Container target) {
      synchronized (target.getTreeLock()) {
        Dimension dim = new Dimension(0, 0);
        int size = actions.size();
        if ((grip != null) && grip.isVisible()) {
          Dimension d = grip.getPreferredSize();
          dim.width += d.width;
          dim.width += hgap;
        }
        for (int i = 0; i < size; i++) {
          Component comp = (Component) actions.elementAt(i);
          if (comp.isVisible()) {
            Dimension d = comp.getPreferredSize();
            dim.width += d.width;
            dim.height = Math.max(dim.height, d.height);
            dim.width += hgap;
          }
        }
        Insets insets = target.getInsets();
        dim.width += insets.left + insets.right;
        dim.height += insets.top + insets.bottom;

        return dim;
      }
    }
 private void hideDropDownButton() {
   for (Component component : this.getComponents()) {
     if (component instanceof AbstractButton && component.isVisible()) {
       component.setVisible(false);
       this.revalidate();
     }
   }
 }
 protected void paintEditor(Graphics g) {
   Component component = grid.getEditorComponent();
   if (component == null) {
     return;
   }
   Rectangle cellBounds = grid.getCellBounds(grid.getEditingRow(), grid.getEditingColumn());
   component.setBounds(cellBounds);
   component.validate();
   component.requestFocus();
 }
 @Override
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   if (c instanceof Container) {
     Insets borderInsets = border.getBorderInsets(c);
     Insets insets = getBorderInsets(c);
     int temp = (insets.top - borderInsets.top) / 2;
     border.paintBorder(c, g, x, y + temp, width, height - temp);
     Dimension size = comp.getPreferredSize();
     Rectangle rect = new Rectangle(OFFSET, 0, size.width, size.height);
     SwingUtilities.paintComponent(g, comp, (Container) c, rect);
     comp.setBounds(rect);
   }
 }
 /** {@inheritDoc} */
 @Override
 protected void installListeners(JScrollPane c) {
   super.installListeners(c);
   c.addPropertyChangeListener(this);
   if (UIManager.getBoolean("ScrollPane.useChildTextComponentFocus")) {
     viewportViewFocusHandler = new ViewportViewFocusHandler();
     c.getViewport().addContainerListener(viewportViewFocusHandler);
     Component view = c.getViewport().getView();
     if (view instanceof JTextComponent) {
       view.addFocusListener(viewportViewFocusHandler);
     }
   }
 }
 // Overridden for performance reasons. ---->
 @Override
 public boolean isOpaque() {
   Color back = getBackground();
   Component p = getParent();
   if (Objects.nonNull(p)) {
     p = p.getParent();
   } // p should now be the JTable.
   boolean colorMatch =
       Objects.nonNull(back)
           && Objects.nonNull(p)
           && back.equals(p.getBackground())
           && p.isOpaque();
   return !colorMatch && super.isOpaque();
 }
 @Override
 public Insets getBorderInsets(Component c) {
   Dimension size = comp.getPreferredSize();
   Insets insets = border.getBorderInsets(c);
   insets.top = Math.max(insets.top, size.height);
   return insets;
 }
 public void focusLost(FocusEvent e) {
   // We will still paint focus even if lost temporarily
   focusLostTemporarily = e.isTemporary();
   if (!focusLostTemporarily) {
     comp.repaint();
   }
 }
Beispiel #10
0
 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) {
   JMenuItem b = (JMenuItem) c;
   ButtonModel model = b.getModel();
   Color borderColorLo = AbstractLookAndFeel.getFrameColor();
   Color borderColorHi =
       ColorHelper.brighter(AbstractLookAndFeel.getMenuSelectionBackgroundColor(), 40);
   if (c.getParent() instanceof JMenuBar) {
     if (model.isArmed() || model.isSelected()) {
       g.setColor(borderColorLo);
       g.drawLine(x, y, x + w - 1, y);
       g.drawLine(x, y, x, y + h - 1);
       g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);
       g.setColor(borderColorHi);
       g.drawLine(x + 1, y + 1, x + w - 2, y + 1);
       g.drawLine(x + 1, y + 1, x + 1, y + h - 1);
     }
   } else {
     if (model.isArmed() || (c instanceof JMenu && model.isSelected())) {
       g.setColor(borderColorLo);
       g.drawLine(x, y, x + w - 1, y);
       g.drawLine(x, y + h - 1, x + w - 1, y + h - 1);
       g.setColor(borderColorHi);
       g.drawLine(x, y + 1, x + w - 2, y + 1);
     }
   }
 }
Beispiel #11
0
  /**
   * Overridden to enforce the position of the glass component as the zero child.
   *
   * @param comp the component to be enhanced
   * @param constraints the constraints to be respected
   * @param index the index
   */
  protected void addImpl(Component comp, Object constraints, int index) {
    super.addImpl(comp, constraints, index);

    /// We are making sure the glassPane is on top.
    if (glassPane != null && glassPane.getParent() == this && getComponent(0) != glassPane) {
      add(glassPane, 0);
    }
  }
 /* Repost event to dispatchComponent */
 private boolean repostEvent(MouseEvent e) {
   if (dispatchComponent == null) {
     return false;
   }
   MouseEvent editorMouseEvent = SwingUtilities.convertMouseEvent(grid, e, dispatchComponent);
   dispatchComponent.dispatchEvent(editorMouseEvent);
   return true;
 }
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   if (comp.hasFocus() || focusLostTemporarily) {
     Color color = g.getColor();
     g.setColor(focusColor);
     BasicGraphicsUtils.drawDashedRect(g, x, y, width, height);
     g.setColor(color);
   }
 }
    public FocusBorder(Component comp) {
      this.comp = comp;

      comp.addFocusListener(this);

      // This is the best guess for a L&F specific color
      focusColor = UIManager.getColor("TabbedPane.focus");
    }
 public void actionPerformed(ActionEvent e) {
   JGrid grid = (JGrid) e.getSource();
   if (!grid.hasFocus()) {
     CellEditor cellEditor = grid.getCurrentCellEditor();
     if (cellEditor != null && !cellEditor.stopCellEditing()) {
       return;
     }
     grid.requestFocus();
   }
   SelectionModel selectionModel = grid.getSelectionModel();
   int anchorRow = selectionModel.getAnchorRow();
   int anchorColumn = selectionModel.getAnchorColumn();
   grid.editCellAt(anchorRow, anchorColumn, null);
   Component editorComp = grid.getEditorComponent();
   if (editorComp != null) {
     editorComp.requestFocus();
   }
 }
 public void run() {
   while (true) {
     synchronized (semaphore) {
       try {
         semaphore.wait();
       } catch (InterruptedException ex) {
       }
     }
     Color origColor = c.getBackground();
     for (int i = 0; i < flashCount; i++) {
       c.setBackground(flashColor);
       try {
         Thread.currentThread().sleep(100);
       } catch (Exception ex) {
       }
       c.setBackground(origColor);
     }
   }
 }
    public void layoutContainer(Container parent) {
      Dimension size = parent.getSize();

      Dimension captionSize = caption.getPreferredSize();
      caption.setBounds(PADDING, PADDING, captionSize.width, captionSize.height);

      // make all buttons the same size
      Dimension buttonSize = cancelButton.getPreferredSize();
      buttonSize.width = Math.max(buttonSize.width, prevButton.getPreferredSize().width);
      buttonSize.width = Math.max(buttonSize.width, nextButton.getPreferredSize().width);

      // cancel button goes on far left
      cancelButton.setBounds(
          PADDING, size.height - buttonSize.height - PADDING, buttonSize.width, buttonSize.height);

      // prev and next buttons are on the right
      prevButton.setBounds(
          size.width - buttonSize.width * 2 - 6 - PADDING,
          size.height - buttonSize.height - PADDING,
          buttonSize.width,
          buttonSize.height);

      nextButton.setBounds(
          size.width - buttonSize.width - PADDING,
          size.height - buttonSize.height - PADDING,
          buttonSize.width,
          buttonSize.height);

      // calculate size for current page
      Rectangle currentPageBounds = new Rectangle();
      currentPageBounds.x = PADDING;
      currentPageBounds.y = PADDING * 2 + captionSize.height;
      currentPageBounds.width = size.width - currentPageBounds.x - PADDING;
      currentPageBounds.height =
          size.height - buttonSize.height - currentPageBounds.y - PADDING * 2;

      for (int i = 0; i < pages.length; i++) {
        Component page = pages[i];
        page.setBounds(currentPageBounds);
        page.setVisible(i == currentPage);
      }
    }
    /** Lays out the container in the specified panel. */
    public void layoutContainer(Container target) {
      synchronized (target.getTreeLock()) {
        Insets insets = target.getInsets();
        Dimension dim = target.getSize();

        int fullHeight = dim.height;
        int bottom = dim.height - insets.bottom - 1;
        int top = 0 + insets.top;
        int left = insets.left;
        int maxPosition = dim.width - (insets.left + insets.right) - hgap;
        int right = dim.width - insets.right;
        maxPosition = right;
        int height = bottom - top;
        int size = actions.size();
        int w, h;
        if ((grip != null) && grip.isVisible()) {
          Dimension d = grip.getPreferredSize();
          grip.setBounds(left, top + vgap, d.width, bottom - top - 2 * vgap);
          left += d.width;
          left += hgap;
        }
        for (int i = 0; i < size; i++) {
          left += hgap;
          Component comp = (Component) actions.elementAt(i);
          Dimension d;
          Dimension minSize = comp.getMinimumSize();

          if (i == size - 1) d = comp.getMaximumSize();
          else d = comp.getPreferredSize();
          w = d.width;
          h = Math.min(height, d.height);
          if ((left < maxPosition) && (left + w > maxPosition)) {
            if (maxPosition - left >= minSize.width) w = maxPosition - left;
          }

          comp.setBounds(left, (fullHeight - d.height) / 2, w, h);

          //  	  if (i == size - 1)
          //  	    d = comp.getMaximumSize();
          //  	  else
          //  	    d = comp.getPreferredSize();
          //  	  if ((left + d.width) > right)
          //  	    w = right - left;
          //  	  else
          //  	    w = d.width;
          //  	  h = Math.min (height, d.height);
          //  	  comp.setBounds (left, (fullHeight - d.height)/2, w, h);

          left += d.width;
        }
      }
    }
Beispiel #19
0
  /**
   * Adds default interactions to the specified component.
   *
   * @param comp component
   * @param win parent window
   */
  public static void addInteraction(final Component comp, final Window win) {
    comp.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseEntered(final MouseEvent e) {
            focus(comp);
          }
        });

    if (win instanceof BaseXDialog) {
      // add default keys
      final BaseXDialog d = (BaseXDialog) win;
      comp.addKeyListener(
          new KeyAdapter() {
            @Override
            public void keyPressed(final KeyEvent e) {
              final Object s = e.getSource();
              if (s instanceof BaseXCombo && ((BaseXCombo) s).isPopupVisible()) return;

              // do not key close dialog if button or editor is focused
              if (ENTER.is(e) && !(s instanceof BaseXButton || s instanceof TextPanel)) {
                d.close();
              } else if (ESCAPE.is(e)) {
                // do not cancel dialog if search bar is opened
                boolean close = true;
                if (s instanceof TextPanel) {
                  final SearchBar bar = ((TextPanel) s).getSearch();
                  close = bar == null || !bar.deactivate(true);
                }
                if (close) d.cancel();
              }
            }
          });
      return;
    }

    if (win instanceof GUI) {
      comp.addKeyListener(globalShortcuts((GUI) win));
    } else {
      throw Util.notExpected("Reference to main window expected.");
    }
  }
Beispiel #20
0
  /**
   * Sets a specified <code>Component</code> to be the glass pane for this root pane. The glass pane
   * should normally be a lightweight, transparent component, because it will be made visible when
   * ever the root pane needs to grab input events.
   *
   * <p>The new glass pane's visibility is changed to match that of the current glass pane. An
   * implication of this is that care must be taken when you want to replace the glass pane and make
   * it visible. Either of the following will work:
   *
   * <pre>
   *   root.setGlassPane(newGlassPane);
   *   newGlassPane.setVisible(true);
   * </pre>
   *
   * or:
   *
   * <pre>
   *   root.getGlassPane().setVisible(true);
   *   root.setGlassPane(newGlassPane);
   * </pre>
   *
   * @param glass the <code>Component</code> to use as the glass pane for this <code>JRootPane
   *     </code>
   * @exception NullPointerException if the <code>glass</code> parameter is <code>null</code>
   */
  public void setGlassPane(Component glass) {
    if (glass == null) {
      throw new NullPointerException("glassPane cannot be set to null.");
    }

    AWTAccessor.getComponentAccessor().setMixingCutoutShape(glass, new Rectangle());

    boolean visible = false;
    if (glassPane != null && glassPane.getParent() == this) {
      this.remove(glassPane);
      visible = glassPane.isVisible();
    }

    glass.setVisible(visible);
    glassPane = glass;
    this.add(glassPane, 0);
    if (visible) {
      repaint();
    }
  }
 /** Adds the specified component with the specified name to the layout. */
 public void addLayoutComponent(String name, Component comp) {
   synchronized (comp.getTreeLock()) {
     if ("Grip".equals(name)) { // NOI18N
       grip = comp;
     } else if ("Action".equals(name)) { // NOI18N
       actions.addElement(comp);
     } else
       throw new IllegalArgumentException(
           "cannot add to layout: unknown constraint: " + name); // NOI18N
   }
 }
Beispiel #22
0
 public boolean isResizable(Component c) {
   boolean resizable = true;
   if (c instanceof JDialog) {
     JDialog dialog = (JDialog) c;
     resizable = dialog.isResizable();
   } else if (c instanceof JInternalFrame) {
     JInternalFrame frame = (JInternalFrame) c;
     resizable = frame.isResizable();
   } else if (c instanceof JRootPane) {
     JRootPane jp = (JRootPane) c;
     if (jp.getParent() instanceof JFrame) {
       JFrame frame = (JFrame) c.getParent();
       resizable = frame.isResizable();
     } else if (jp.getParent() instanceof JDialog) {
       JDialog dialog = (JDialog) c.getParent();
       resizable = dialog.isResizable();
     }
   }
   return resizable;
 }
Beispiel #23
0
 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
   if (image != null && showimage) {
     // TODO: add ability to scale maintaining aspect ratio fitting to size of parent
     // TODO: Need to add not zoom all the way, but zoom to a box of aspect ratio 4/3
     Graphics2D g2 = (Graphics2D) g;
     AffineTransform tran = new AffineTransform(1f, 0f, 0f, 1f, 0, 0);
     float widthscale = (float) c.getWidth() / image.getWidth();
     float heightscale = (float) c.getHeight() / image.getHeight();
     switch (drawmode) {
       case DRAW_MODE_ASPECT:
         float scale;
         if (widthscale < heightscale) {
           scale = widthscale;
         } else {
           scale = heightscale;
         }
         tran.scale(scale, scale);
         g2.drawImage(
             image,
             new AffineTransformOp(tran, AffineTransformOp.TYPE_BILINEAR),
             (int) (c.getWidth() - image.getWidth() * scale) / 2,
             (int) (c.getHeight() - image.getHeight() * scale) / 2);
         break;
       case DRAW_MODE_WIDTH:
         tran.scale(widthscale, widthscale);
         g2.drawImage(image, tran, null);
         break;
       case DRAW_MODE_HEIGHT:
         tran.scale(heightscale, heightscale);
         g2.drawImage(image, tran, null);
         break;
       default:
         tran.scale(widthscale, heightscale);
         g2.drawImage(image, tran, null);
         break;
     }
   }
 }
Beispiel #24
0
 private static Method getBRBIMethod(Component component) {
   Class klass = component.getClass();
   while (klass != null) {
     if (BRB_I_MAP.containsKey(klass)) {
       Method method = (Method) BRB_I_MAP.get(klass);
       return method;
     }
     klass = klass.getSuperclass();
   }
   klass = component.getClass();
   Method[] methods = klass.getMethods();
   for (int i = methods.length - 1; i >= 0; i--) {
     Method method = methods[i];
     if ("getBaselineResizeBehaviorInt".equals(method.getName())) {
       Class[] params = method.getParameterTypes();
       if (params.length == 0) {
         BRB_I_MAP.put(klass, method);
         return method;
       }
     }
   }
   BRB_I_MAP.put(klass, null);
   return null;
 }
Beispiel #25
0
 // Many of the following methods have been added purely
 // so InternalFunctions can work.  Originally, the code in
 // that class was inline here, so its functions had direct
 // access.  I removed it so that students do not need to wade
 // through all the functions!  But, that leaves the question as
 // to what to do with the following methods, but I don't think
 // there's much you can do ...
 public void changeSize(int width, int height) {
   setSize(width, height);
   Component top = splitPane.getTopComponent();
   Component bottom = splitPane.getBottomComponent();
   int totalHeight = top.getHeight() + bottom.getHeight();
   int topHeight = (totalHeight * topProportion) / 100;
   int bottomHeight = (totalHeight * bottomProportion) / 100;
   top.setPreferredSize(new Dimension(width - 10, topHeight));
   bottom.setPreferredSize(new Dimension(width - 10, bottomHeight));
   splitPane.resetToPreferredSizes();
   pack();
 }
 public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus) {
   ListCellRenderer renderer = comboBox.getRenderer();
   Component c;
   Dimension d;
   c =
       renderer.getListCellRendererComponent(
           listBox, comboBox.getSelectedItem(), -1, false, false);
   c.setFont(comboBox.getFont());
   if (comboBox.isEnabled()) {
     c.setForeground(comboBox.getForeground());
     c.setBackground(comboBox.getBackground());
   } else {
     c.setForeground(UIManager.getColor("ComboBox.disabledForeground"));
     c.setBackground(UIManager.getColor("ComboBox.disabledBackground"));
   }
   d = c.getPreferredSize();
   currentValuePane.paintComponent(g, c, comboBox, bounds.x, bounds.y, bounds.width, d.height);
 }
 public synchronized void paintIcon(Component c, Graphics g, int x, int y) {
   g.setColor(Color.white);
   g.fillRect(0, 0, c.getWidth(), c.getHeight());
   if (getImageObserver() == null) {
     g.drawImage(
         getImage(),
         c.getWidth() / 2 - getIconWidth() / 2,
         c.getHeight() / 2 - getIconHeight() / 2,
         c);
   } else {
     g.drawImage(
         getImage(),
         c.getWidth() / 2 - getIconWidth() / 2,
         c.getHeight() / 2 - getIconHeight() / 2,
         getImageObserver());
   }
 }
Beispiel #28
0
    public void paintLogo(Component c, Graphics g, int x, int y, int w, int h) {
      if (hasLogo(c)) {
        Graphics2D g2D = (Graphics2D) g;

        Font savedFont = g2D.getFont();
        g.setFont(logoFont);
        FontMetrics fm = JTattooUtilities.getFontMetrics((JComponent) c, g, c.getFont());
        String logo =
            JTattooUtilities.getClippedText(
                AbstractLookAndFeel.getTheme().getLogoString(), fm, h - 16);

        AffineTransform savedTransform = g2D.getTransform();

        Color fc = getLogoColorHi();
        Color bc = getLogoColorLo();

        if (JTattooUtilities.isLeftToRight(c)) {
          g2D.translate(fm.getAscent() + 1, h - shadowSize - 4);
          g2D.rotate(Math.toRadians(-90));
          g2D.setColor(bc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 0, 1);
          g2D.setColor(fc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 1, 0);
        } else {
          g2D.translate(w - shadowSize - 4, h - shadowSize - 4);
          g2D.rotate(Math.toRadians(-90));
          g2D.setColor(bc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 0, 1);
          g2D.setColor(fc);
          JTattooUtilities.drawString((JComponent) c, g, logo, 1, 0);
        }

        g2D.setTransform(savedTransform);
        g2D.setFont(savedFont);
      }
    }
 /** Method to get the previous component for focus */
 public Component getComponentBefore(Container focusCycleRoot, Component aComponent) {
   if (aComponent.equals(colValue)) return rowValue;
   else return colValue;
 }
Beispiel #30
0
  public InterpreterFrame() {
    super("Simple Lisp Interpreter");

    // Create the menu
    menubar = buildMenuBar();
    setJMenuBar(menubar);
    // Create the toolbar
    toolbar = buildToolBar();
    // disable cut and copy actions
    cutAction.setEnabled(false);
    copyAction.setEnabled(false);
    // Setup text area for editing source code
    // and setup document listener so interpreter
    // is notified when current file modified and
    // when the cursor is moved.
    textView = buildEditor();
    textView.getDocument().addDocumentListener(this);
    textView.addCaretListener(this);

    // set default key bindings
    bindKeyToCommand("ctrl C", "(buffer-copy)");
    bindKeyToCommand("ctrl X", "(buffer-cut)");
    bindKeyToCommand("ctrl V", "(buffer-paste)");
    bindKeyToCommand("ctrl E", "(buffer-eval)");
    bindKeyToCommand("ctrl O", "(file-open)");
    bindKeyToCommand("ctrl S", "(file-save)");
    bindKeyToCommand("ctrl Q", "(exit)");

    // Give text view scrolling capability
    Border border =
        BorderFactory.createCompoundBorder(
            BorderFactory.createEmptyBorder(3, 3, 3, 3),
            BorderFactory.createLineBorder(Color.gray));
    JScrollPane topSplit = addScrollers(textView);
    topSplit.setBorder(border);

    // Create tabbed pane for console/problems
    consoleView = makeConsoleArea(10, 50, true);
    problemsView = makeConsoleArea(10, 50, false);
    tabbedPane = buildProblemsConsole();

    // Plug the editor and problems/console together
    // using a split pane. This allows one to change
    // their relative size using the split-bar in
    // between them.
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topSplit, tabbedPane);

    // Create status bar
    statusView = new JLabel(" Status");
    lineNumberView = new JLabel("0:0");
    statusbar = buildStatusBar();

    // Now, create the outer panel which holds
    // everything together
    outerpanel = new JPanel();
    outerpanel.setLayout(new BorderLayout());
    outerpanel.add(toolbar, BorderLayout.PAGE_START);
    outerpanel.add(splitPane, BorderLayout.CENTER);
    outerpanel.add(statusbar, BorderLayout.SOUTH);
    getContentPane().add(outerpanel);

    // tell frame to fire a WindowsListener event
    // but not to close when "x" button clicked.
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(this);
    // set minimised icon to use
    setIconImage(makeImageIcon("spi.png").getImage());

    // setup additional internal functions
    InternalFunctions.setup_internals(interpreter, this);

    // set default window size
    Component top = splitPane.getTopComponent();
    Component bottom = splitPane.getBottomComponent();
    top.setPreferredSize(new Dimension(100, 400));
    bottom.setPreferredSize(new Dimension(100, 200));
    pack();

    // load + run user configuration file (if there is one)
    String homedir = System.getProperty("user.home");
    try {
      interpreter.load(homedir + "/.simplelisp");
    } catch (FileNotFoundException e) {
      // do nothing if file does not exist!
      System.out.println("Didn't find \"" + homedir + "/.simplelisp\"");
    }

    textView.grabFocus();
    setVisible(true);

    // redirect all I/O to problems/console
    redirectIO();

    // start highlighter thread
    highlighter = new DisplayThread(250);
    highlighter.setDaemon(true);
    highlighter.start();
  }