JAVA GUI for perl program
guliver
created: 2006-02-03 09:24:24

Hi,

I'm trying to create a JAVA GUI over a perl program (until now we used a TK GUI, but it looks quite obsolete and have some nasty bugs).

The requirements are:
  1. Perl program have to be run both in GUI mode (JAVA GUI) and in CLI mode (perl CLI).
  2. JAVA GUI have to be able to communicate with the perl program that actually does all the job (the GUI is there just to permit the user to choose/modify some options)
The options are:
  1. Use Java.pm and launch from there the JAVA GUI (from the preliminary tests seems to run slow, the GUI somtimes even freeze).
  2. Launch a jar that contains the JAVA GUI, and call perl subroutines from there.

Which one of these options did you think it's better? Have you ever use one of them and how.

Thanks.
Re: JAVA GUI for perl program
created: 2006-02-03 09:32:02
If you think Tk sucks, use something else, like Prima, or Wx, maybe even Gtk. All of the above beat the Java GUI option. Heck, using CGI beats starting up java.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.
Re^2: JAVA GUI for perl program
created: 2006-02-03 13:27:12
(GUI) Windows Programming FAQ is really badly out of date. Judging by a comparison of the info at gtk.org, if would be counterproductive to use it except for links to GUI sites.
Re^3: JAVA GUI for perl program
created: 2006-02-04 03:02:38
Maybe you'd like to respond to the FAQ detailing how.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.
Re^2: JAVA GUI for perl program
created: 2006-02-06 08:27:41

I forgot to mention this: the GUI must run on Windows (2000,XP,2003), Solaris, HPUX and in near future on Linux.

So, from this point, Gtk is not a very good choice (it's hard to compile and run from a CD/DVD on Windows)

Wx and Prima looks nice, I'll give them a try

Some issues that I'm afraid of (because I get them in TK) are:

  • GUI that froze during procesing databases in the background - in Java the process can be launched on a separate thread (I know that this can be solved using threads in perl, but I'm not sure how well it's working on Windows).
  • Tree view of file system (like Tk::DirTree that is buggy)
Re: JAVA GUI for perl program
created: 2006-02-03 10:04:59
You can use Inline::Java to bridge Perl and Java. It supports GUI behavior. There is even a thin wrapper over Inline::Java which provides sugar for the task: Java::Swing. I wrote Java::Swing

Phil

Re^2: JAVA GUI for perl program
created: 2006-02-06 08:05:39
I've tried Inline::Java, but it's quite slow (at least at start it seems to freeze for about 30'-1min, and we can't get this to the clients).
Re^3: JAVA GUI for perl program
created: 2006-02-06 11:41:04
The first time you run something with Inline::Java it must compile all the java code involved. It should be much faster on the second load, at least until you change the code and have to recompile. All Inline modules for compiled languages suffer this problem. But, Inline is good at caching the results of the compile. If you're a bit more clever than I, you can have that compilation happen during make or make test. Consult the Inline mailing list for details.

Phil

perlmonks.org content © perlmonks.org and andyford, guliver, philcrow, PodMaster

prlmnks.org © 2006 edmund von der burg (eccles & toad)

v 0.03