How to implement java swing in JESS

165 Views Asked by At

How to implement combobox from java in jess? I have to do something like this:

 ;defglobals
 (defglobal ?*combobox* = 0)
 ;deffunctions
 (bind ?*combobox* (new JComboBox ))

 (deffunction add-widgets ()
 (?*c* add ?*combobox* (BorderLayout.CENTER)))
 (?*combobox* addActionListener (implement ActionListener 
  using (lambda (?name ?evt) 
 (bind ?*combobox* ("slot1" "slot2"))))  

I need to these slots be shown on list and after click OK, another list could be shown in the same combobox. I have to make another combobox for every multislot?

2

There are 2 best solutions below

0
On

It's not the problem. in java I can simply do the array and send it to combobox. i can't do it in jess. I don't know how to interact with it.

0
On

Swing is the same whether you're using it from Java, from Jess, or from Groovy, Scala, or Clojure. If you don't know how to program the GUI you want in Java, then you'll need to learn to do that first. The Swing chapter of the online Java Tutorial is a great place to start on that path.