 	(.add canvas BorderLayout/CENTER)
 	(.add hscrollbar BorderLayout/SOUTH)
 	(.add vscrollbar BorderLayout/EAST))
-      (.installScrollHandler scn hscrollbar vscrollbar)
+      (add-scrollbars scn hscrollbar vscrollbar)
 
       ;; main panel
       (doto main-panel

                with-printed-result,
                now,
                defvar-,
                defmacro-)]
	[conexp.math.util
         :only (with-doubles)]
	[conexp.layout


;;; Drawing Routine for the REPL

(defnk draw-lattice
  "Draws given lattice with given layout-function on a canvas. Returns
  the panel of the lattice editor. The following options are allowed,
  their default values are given in paranthese:

    - layout-fn (*standard-layout-function*)
    - visible (true)
    - dimension [600 600]
  "
  [lattice
   :layout-fn *standard-layout-function*
   :visible true
   :dimension [600 600]]
  (let [^JFrame frame (JFrame. "conexp-clj Lattice"),
        ^JPanel lattice-editor (make-lattice-editor frame (layout-fn lattice))]
    (doto frame
      (.add lattice-editor)
      (.setSize (Dimension. (first dimension) (second dimension)))
      (.setVisible visible))
    lattice-editor))

;;;

