• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Problem with output JESS NETBEAN

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello es anyone of you knows how to get the result generated by jess and put on a WRITER or view directly on a textArea
I tried too much stuff and it did not work (I'm stuck)

Writer os = new StringWriter();
engine.addOutputRouter("t",os);
System.out.println(os.toString());
os rest empty

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Rete engine = new Rete();

try {

engine.batch(nom);

engine.executeCommand("(reset)");

engine.executeCommand("(assert (fait mo ))");

Writer os = new StringWriter();
engine.addOutputRouter("t",os);

System.out.println(os.toString());
engine.executeCommand("run");

}
catch (JessException je) {
System.out.println("2:" + je.getMessage());

}
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic