Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling method in Java App from Jython

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I create a GUI using a Jython script file, I am not clear on how we contruct the event methods so that the non GUI "work" part of the app is handled outside of the Jything Interpreter. Or is this even possible?
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm afraid that you have exceeded the monthly capacity of this forum, come back later.
Gregg, what do you mean by "outside" of the Jython interpreter? Do you
mean back in the JVM? Got code?
[ October 29, 2003: Message edited by: Barry Gaunt ]
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I mean is if I use Jython to construct a simple GUI in a file. Then in my java code I do
interpreter.execfile("gui.py");
That is all find and good. But if my GUI has Buttons, Menu's, etc I need the Action Events to reside in the java program itself, not in the script file. I don't really have any code yet because I need to find out if this is possible before I commit to doing it.
But for an example I found on the internet:

If this is my script file that I call from the java program, notice the:

I need that to call a method inside my Java application. I don't want all my event code in the script file. I hope that makes better sense.
I'm afraid that you have exceeded the monthly capacity of this forum, come back later.
I noticed this forum was a bit on the dormant side. I thought I would bring it back to life.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic