简体   繁体   中英

How to implement java swing in JESS

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?

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM