I'm traying to make a GUI on wich I can plot some objekts.  I have made
the basic GUI I want by using java-commands through jess. I have made a
panel on wich I wish to be able to draw on, when a function is called.

My problem is that I can figure out how to make a variable of the type
Graphics in jess. If I write:

(defglobal ?*graph* = (new Graphics))

in the same way I have made the JPanels, I get an error massege saying the
constuctor is not found. And I have importes java.awt .

I have tryid to make a canves:
(defglobal ?*canvas* = (new jess.awt.Canvas painter (engine)))

and then use getGraphics on it, but I just can't make it work.

Does anyone have any ideas on how to make a function I can call, that will
be able to use the drawRect(...) and functions like that, in the
java.awt.graphics library?

Basicly I just want to be able to draw a square of a given size and
position, on my panel when I want to.

I want to be able to call this function (because when that works I can
change it to whatever shape I want). It is the ?graph variable that is the
problem to create):

(deffunction draw ()
    ;;(new Graphics ?graph getGraphics)) ;; doesn't work
    ;;(?graph = (getGraphics ?*canvas*)) ;; doesn't work

    (?graph setColor (get-member java.awt.Color red))
    (?graph drawLine 0 0 600 600)
    (?graph drawLine 600 0 0 600)
    (?*f* repaint))

To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]

Reply via email to