Skip to content

[Question, mostly] Java::JavaAwt versus Java::Awt #8356

@rubyFeedback

Description

@rubyFeedback

I am playing around with jruby + swing right now, in particular writing a GUI agnostic
toolkit - a bit similar to glimmer. My idea is to abstract things into e. g. "Button.new"
being valid for all main use cases: ruby-gtk3 right now, hopefully ruby-tk eventually,
ruby-libui-ng, the web (via objectified HTML tags, e. g. able to treat HTML tags as
objects), perhaps ruby-SDL (via gosu) and so forth. Anyway.

Java + Swing may not be the most elegant toolkit and it is a bit messy too, but it
works out-of-the-box, which is great.

One thing that is a bit confusing is that we have AWT as well as swing on top of it.

The namespace we see here used for swing is:

Java::JavaxSwing::JFrame
Java::JavaxSwing

So, JavaxSwing.

For Awt it is:

Java::JavaAwt::Frame
Java::JavaAwt

In particular for Awt I found it a bit confusing that "Java" is repeated twice,
e. g.

Java::JavaAwt

Why isn't it:

Java::Awt

But looking at Swing, it is also a bit confusing:

Java::JavaxSwing

Why is it Javax there? Why not Java? And why isn't it:

Java::Swing

Now, I assume you guys had some kind of reasoning about this.

Perhaps:

Java::Swing
Java::Awt

may clash with something else. I actually had a name clash elsewhere,
where I had defined:

Widgets::Frame

which conflicted with, I think, awt Frame (I think java_import may have
pulled in some prior name or alias, e. g. if one were to do "include Java").

Anyway, I am mostly just curious about the naming choices here, not
necessarily meaning that anything should change. Has there been some
rationale about the name choices used? My initial attempt was to e. g.
try something like:

Jawa::Awt::Frame

which did not work as it is instead:

Java::JavaAwt::Frame

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions