Forum: JRuby Non-Java Related jRuby GUI Builder

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
E9d515fc42ffe9a4fe4e03adfe94fcbf?d=identicon&s=25 Farsheed B. (angeloflight)
on 2013-05-04 03:42
I've been looking for a set of tools for rapid GUI development in jRuby
and everywhere I look, I get Swing, AWT and other Java-related tools. I
learnt jRuby coz I was pretty much fed up with the excessively verbose
Java code that made programming a chore. The last thing I want to do is
look at it again while coding in ruby code.

Does anyone have any suggestions for jRuby GUI development tools that do
NOT include Swing, AWT or other Java-related stuff? I don't need a
native look and feel, just the ability to add my own images as buttons
and customize the UI elements using images.
205dc91609a5f2631d58d9ebbb17471d?d=identicon&s=25 Robin M. (robin2)
on 2013-05-04 08:40
Have you tried MigLayout which (IMHO) makes Swing usable.

Charles Monteiro (Guest)
on 2013-05-04 12:39
(Received via mailing list)
Limelight comes to mind , see here;

Charles Monteiro
0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-04 17:16
(Received via mailing list)
Charles, Limelight is interesting -- althoughI just looked at it
briefly, it looks good.  It *is* written in Java, though it looks like
it provides a Ruby wrapper around its Java.

Farsheed, that said, if the development you're doing is for something
serious (that is, multiple users and an expected multiyear lifetime with
future upgrades), then I think you'd do better with something more
established.  I believe Limelight hasn't been updated in 8 months
(, and though there's nothing wrong
with that, it could, for example, eventually become out of date with
respect to a new version of Java, JRuby, etc.

However, please be aware that just because Java code is verbose doesn't
mean that the Ruby code calling it needs to be. I have an example of a
JRuby Swing program here:

Github repo:

Blog article:

This fileprobably has the most Swing library interaction:

Thanks to JRuby, the code there isn't that much worse than code using a
Ruby library would be.

I spent several years doing Java Swing development, andmy take on it is
it's a very powerful library, but it's complex, with a steep learning
curve. Complex UI products like NetBeans and the Intellij IDE's such as
RubyMine use it. Forget AWT, it's ancient, and worse.  SWT, maybe; I
only looked at it briefly once, and thought it to be less fully featured
than Swing.

This page lists some GUI frameworks for Ruby: There's an FFI
wrapper around Tk -- that might be an option for you -- I think Tk is
far less complex than Swingor SWT.

- Keith

Keith R. Bennett
Charles Monteiro (Guest)
on 2013-05-06 01:32
(Received via mailing list)

I know, it seemed to be that the op was looking for non-Swing i.e. not
the usual Java GUI development framework.

I'm not pushing it and I agree with your assessment.

Thanks for the links on the Jruby Swing example.

Charles Monteiro (Guest)
on 2013-05-06 03:22
(Received via mailing list)

Can you think of any examples that uses Jruby's Swing API but does that
in the context of the output generated by a GUI design tools like IDEA's
GUI Builder ?


0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-06 14:21
(Received via mailing list)
Charles -

To be honest, I've never used a GUI builderfor Swing.  I have no idea
what their output is.  So I don't know of any examples.  I'm a bit
suspicious of GUI builders, believing they may nurture bad habits, such
as the production of monolithic and complex frames that defy reuse.
That's probably an invalid prejudice based on GUI builders I used that
predated Swing, though.

Unless it's a trivial UI, you'll want to reuse panels, both to save you
work, and for look and feel consistency.  So be careful how you use them
-- it's easy to be tempted to do an entire frame in one step, but there
may be cases where you would be better off creating individual panelsby
themselves, and then assembling them either in code, or in the GUI
builder, if that is possible.

- Keith

Keith R. Bennett
Charles Monteiro (Guest)
on 2013-05-06 17:24
(Received via mailing list)

thanks, I have been spoiled I'm afraid. I have been using GUI builders
in VisualWorks Smalltalk since 94 and they do allow you to create
reusable components which is well supported and encouraged.
Again, i totally agree with your advise and it may be the case that the
IDEA GUI builder and or Swing combo make it hard to create reusable
components via the builder. I hope that's not the case.

I suppose that the GUI builder will generated a class or set of classes
so perhaps its just a matter of requiring said file into one's Ruby
project and then creating in Jruby the callback implementations for the
various listeners. Perhaps the IDEA team has examples of that somewhere.

Thomas E Enebo (Guest)
on 2013-05-06 18:29
(Received via mailing list)
We are still actively developing JRubyFX but you can use JavaFX scene

This will create a FXML file of the layout you made and then you can
controllers to it for behavior.  JRubyFX can be found here:

There is an example showing this in the repo...

Charles Monteiro (Guest)
on 2013-05-06 18:47
(Received via mailing list)
Very interesting

Is there a roadmap for the project ? I'll scan git but I trust that I
will be able to understand what the current limitations are.


Thomas E Enebo (Guest)
on 2013-05-06 20:21
(Received via mailing list)
There is not a roadmap, but I can mention a few things which are still

- Fxml support has been in flux recently but I think it should be fairly
stable now.  byteit101 has been working on that and it would be what you
would consume from the RAD tool.  Jumping on now will help shake out any
issues with FXML support.  He is using it for a complex GUI.
- DSL API which can work in conjunction with Fxml is filling out method
signatures which are missing parameter helpers.  Parameter helpers allow
to specify things like 'fill= :red' instead of 'fill ='.
have these on most of the popular FX types but we need to make them for
- Speeding up load time.  byteit101 also has a branch which loads
now.  loadtime is an ever-present work item for JRuby in general :)

So, it is a project where many things work and there are still plenty of
unfinished aspects.

0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-07 05:02
(Received via mailing list)
Tom -

Can you tell us anything about JavaFX in general?  Do you like it? Is it
a good framework?  (I guess they all have their issues, so my question
should really be "is it better than the others?".)

I found this information page on FX, if anyone's interested:

- Keith

Keith R. Bennett
Thomas E Enebo (Guest)
on 2013-05-07 18:25
(Received via mailing list)
I take JavaFX as the Swing replacement these days and I think if you are
interesting in a rich GUI then JavaFX has more to offer over Swing.  As
such, frameworks like Moneybars could be retrofitted to also target FX
controls.  So don't think of JavaFX as being as much a new framework as
new set of components/controls.

The obvious nice things about FX is how easy it is to get a polished
effect.  Or how easy it is to make non-rectangular windows.  If you
this with the fact that stylesheets are baked into the system then you
write a program once and restyle it without changing code.  A lot of
refinements over what Swing provides.

JRubyFX (and any other language binding like GroovyFX) typically makes
using the library nicer since they all layer on their idiomatic patterns
the API.  In JRubyFX, programatically we have a DSL for simpler scene
layout.  JavaFX also provides FXML as a mechanism for storing a scene
layout as data (typically generated using a RAD tool) which generally
be used for more complex layouts.  JRubyFX can pull in these XML files
use them in a natural way.

E9d515fc42ffe9a4fe4e03adfe94fcbf?d=identicon&s=25 Farsheed B. (angeloflight)
on 2013-05-10 20:19
Thanks for the responses, everyone. JavaFX does look promising, although
I haven't used it and sincerely hope it isn't as user unfriendly as
everything else Java has made.

I'm curious to know how a person using Ruby (not jRuby) would go about
developing desktop applications. This is not so much because I want to
know about how Ruby actually achieves this but more because I would like
to know what it would use other than Java-based technologies. I'm not
sure why all the jRuby UI development tools are Java-centric. What does
Ruby, which cannot use these, do and can this also be used for jRuby?
This would enable developers to easily switch between Ruby and jRuby
without needing to learn or use a different technology in each case.
0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-10 20:32
(Received via mailing list)
Farsheed -

I think it's because almost all user facing apps written these days are
or mobile apps -- very few are desktop apps.

Try looking for a job coding in Ruby that's not a Rails job and you'll
what I mean. ;)

Back when Java became popular, they were still writing a lot of desktop
client apps, and a desktop GUI library was quite important. Not so much

- Keith
E9d515fc42ffe9a4fe4e03adfe94fcbf?d=identicon&s=25 Farsheed B. (angeloflight)
on 2013-05-11 00:26
That makes sense, Keith. Would you know what Ruby (not jRuby) does in
case of a thick client application? Something more on the lines of a
fullscreen multiplayer game rather than a browser-based application.
0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-11 01:12
(Received via mailing list)
I don't really know what you'd use for MRI Ruby.  I guess you could
the low level OS calls if you wanted to, but I imagine that would be a
of work, and nonportable.

If you're writing games, I do know that Java has a 3D library, and you
could drive that from JRuby if you wanted to. At least you'd be
OS-portable. That would be low level too though. There may be libraries
available to wrap some of that complexity for you, I don't know.

If you can find a C library, then you could probably find a way to drive
from MRI Ruby.

- Keith
Bruce Adams (Guest)
on 2013-05-11 13:59
(Received via mailing list)
A great native GUI library for Ruby is Shoes, I
don't know if Shoes is appropriate for game development.

I seem to remember talk of a JRuby version of Shoes, but I'm not finding
it in a too quick search.
B5c492685b72ea664bdda295053d819f?d=identicon&s=25 David M. (mully)
on 2013-05-11 15:36
Bruce Adams wrote in post #1108591:
> A great native GUI library for Ruby is Shoes, I
> don't know if Shoes is appropriate for game development.
> I seem to remember talk of a JRuby version of Shoes, but I'm not finding
> it in a too quick search.

Purple Shoes, perhaps?:
Bruce Adams (Guest)
on 2013-05-12 13:14
(Received via mailing list)
It looks like Steve Klabnik's reply didn't make it to the list. (He may
not be a subscriber.)

Steve Klabnik <> wrote:

Shoes 4 (github/shoes/shoes4) is all jruby, and people do write games in
Manuel Ramos (Guest)
on 2013-05-12 15:19
(Received via mailing list)
Hi ... I had experiment with Qt and theres a way to integrate Nokias
Wysiwyg tool and a translator to Ruby... but i thinks on this on MRI and
sure this will give you more that one headache... first i choose Jruby
thinking on portability ... Also a solution for GUI that nots include
need a 3rd party lib to makes it run.. This must require aditional work
deploy or event on develop stations day to day ... All this troubles and
works hours are reduced using Java that let you run Jruby itself. The
libs are ready to be used and its crossplatform. After a lots on thinks
hours i find that this is one of the reasons because all Ruby Gui tries
on that way...and take it as one of the better for mines... Regards
 El 11/05/2013 20:12, "Bruce Adams" <> escribi:
4fd6f6b507aa3ac75b6cb8ab26fde1c5?d=identicon&s=25 Eric C. (echristopherson)
on 2013-05-14 00:12
(Received via mailing list)
On Fri, May 3, 2013 at 8:42 PM, Farsheed Bamboat

There's a Qt binding for JRuby (hasn't been updated in 11 months

There's also Monkeybars, which applies a modified MVC pattern to Swing:
Charles Monteiro (Guest)
on 2013-05-14 00:24
(Received via mailing list)
I share your non-enthusiasm for Java related UI having done a fair bit
of Swing in the thankfully distant past. However, so far my initial use
of JavaFX is promising. It by far more reminds me of Apache (Adobe) Flex
than Swing / AWT.

There is also a major corp player and decent community behind it
supporting and  enhancing it. They claim it uses hardware acceleration
although I have not tested that yet.

I would suggest checking it out.

Charles Monteiro
James Britt (Guest)
on 2013-05-14 00:37
(Received via mailing list)
Keith Bennett wrote:
> C harles -
> To be hone st, I've never used a GUI builder for Swing.  I have no idea
> what their output i s.  So I don't know of any examples.   I'm a bit
> suspicious of GUI builders , believing they may nurture bad habits, such
> as the production of mon olithic and comp lex frames that defy reuse.

That's entirely up to do the developer, at least in the case of the
Netbeans GUI builder.  I worked on a large commercial application that
managed satellite modems, rendering a number of detailed windows and
panels.  It was written in JRuby using Monkeybars.  (I'm the Monkeybars
project admin, so assorted caveats apply.)

We had several custom components that were reused.  For example, a
screen might show four different modems; we didn't code a separate modem
panel for each one, nor did we create a single monolithic panel, since
the number of modems could change .  Such panels were dynamically added
or removed as needed, reusing a single component class.

> That's probably an invalid pre judice based on GUI builders I used that
> predated Swing, though.
> Unless it's a tr ivial UI, you'll want to reuse panels, both to save you
> work, and for look and feel consistency .  S o be careful how you use
> them -- it's easy to be temp ted to do an entire frame in one step, but
> t here may b e cases wher e you wou ld be better off creating individual
> panels by themselves, and then assembling them eithe r in code, or in
> the GUI builder, if that is possible.

Monkeybars has built-in support for the reuse of, and dynamic
creation/removal of, components and (bearing in mind all my biases) is
the only JRuby GUI framework suitable for anything of more than
moderate complexity.

And while it works really well with pre-compiled classes such as you can
get from the Netbeans GUI builder you can also easily create UI items
using in-line Ruby.

In my own Monkeybars apps I use in-line code (via the Swingset-NG gem)
to create simple stuff like an "About" screen or user input forms, and a
GUI builder for anything more complicated.

You can see an example program here:

I think all the screens were made in Netbeans using the GUI tool.

To address the original post, using Monkeybars will, at some point, have
you sticking your nose into Swing.  You really can't avoid it, if only
to understand what options are available.

No matter what GUI tool you choose you will have to dig into the quirks
and foibles of the tool in order to do anything sophisticated, and that
assumes the GUI toolkit even allows for sophistication.  (I.e., can you
design your own widgets outside of what the toolkit provides?)

Swing is probably not much worse than others in that regard, and offers
a tremendous range of UI options.  You have to pick your battles.

James Britt


Neurogami - Avant-garage Research & Development
773c21073bd45af7c4f90ce516827752?d=identicon&s=25 Eric W. (edubkendo)
on 2013-05-14 06:02
(Received via mailing list)
I've actually spent a great deal of time researching this question: how
does one build a GUI app with Ruby? To answer your question here, there
basically two roads, in MRI (that's Matz's Ruby Implementation, the
non-java ruby) there are a handful of GUI libraries, all of them binding
one of the C/C++ toolkits: Gnome/GTK, QT, Wx, Gosu(for games) etc. The
second option is to use JRuby, and either work directly with one of the
Java toolkits (Swing, SWT, JavaFX) , or use one of the libraries that
wraps/abstacts/builds on top of those toolkits (Monkeybars, Rubeus,
Limelight, JRubyFX). Shoes has also been mentioned. It is undergoing a
rewrite that will use JRuby to provide a wrapper around SWT.

Your suggestion of using one of the MRI GUI libraries, from JRuby, would
make a lot of sense (portability of code, etc) except that all of those
libraries bind to various C libraries, and support for that in JRuby is,
well, currently unsupported. C-Ext support was offered as an experiment,
a previous version of JRuby (to the best of my understanding) but (again
the best of my understanding), it was buggy, difficult to maintain, and
essentially working against the tool. I believe it is still possible to
invoke JRuby with C-Extension support enabled, but I think for something
complex as a GUI toolkit, you'd have a hard time getting it working. You
could possibly bind to one of those libraries via JNI/FFI support, but
again, at this point you are basically working against the tool,
creating a
lot of trouble for yourself, to get something working which would never
really be a good fit for each other. And quite possibly you would end up
writing far, far more java code than had you just written your app using
one of those Java GUI toolkits you seem to want to avoid.

So, after all this research, what have I chosen for my projects going
forward? JRubyFX, 100%. One, JavaFX is a really nice, modern GUI
with a lot of manhours being poured into improving it. It uses CSS for
styling, has a great GUI builder (SceneBuilder), which produces FXML
is quite readable/writable on its own), it performs well, and I could go
and on. It's really easy to create your own widgets, components, etc in
JavaFX (or JRubyFX), and there's tons of great documentation, blog
and other info easily available for it. Two, JRubyFX provides a very
ruby-ish wrapper around this, and its getting better all the time as
byteit101 has been putting a ton of work into making it a top-notch
framework. Three, efforts are currently underway to get JavaFX running
iOS and Android (it's been done in Oracle's lab, and they've opensourced
their proto-types). This means, it may eventually be possible to write
JRubyFX apps targeting those devices as well (This one's a big maybe, of
course, but Android, at least, should be a very real possibility. This
stuff about the mobile stuff is just speculation on my part, nobody from
JRubyFX is doing any work on this stuff at the moment, or looking at it,
that I know of, but it's something I am personally very intrigued by).
Four, javafx provides some really slick packaging tools for easily
native installers for Windows, Linux and OSX. We've already integrated
support (in basic form, with information on how to customize it
into JRubyFX. Finally, Oracle themselves have stated that JavaFX is the
replacement for Swing, and that they will be phasing Swing out in favor

Hope that helped answer your questions, and I hope I've convinced you to
checkout JRubyFX. It's awesome-sauce.
E9d515fc42ffe9a4fe4e03adfe94fcbf?d=identicon&s=25 Farsheed B. (angeloflight)
on 2013-05-15 18:50
Thanks for the responses, everyone.

Eric, I think I'll check out JRubyFX.
Charles Monteiro (Guest)
on 2013-05-15 21:22
(Received via mailing list)
A great way of checking that out is via the Ensemble  app which is
basically an collection of sample Java FX apps for browser style
exploration. It comes with the latest jdk i.e. as part of the samples ,
but is also available in the Apple AppStore if you are  a Mac user.

Charles Monteiro
0d1cd73bfe0ebe09074bfcd138ed3d5d?d=identicon&s=25 Keith B. (keith_b)
on 2013-05-16 06:21
(Received via mailing list)
Charles -

Just to be sure, you're not talking about using Fx in a web browser,
right?  It seems that most or all of the Java security issues have to do
with running Java in the browser.

- Keith

Keith R. Bennett
This topic is locked and can not be replied to.