[Question, mostly] Java::JavaAwt versus Java::Awt #8371
-
|
I am playing around with jruby + swing right now, in particular writing a GUI agnostic Java + Swing may not be the most elegant toolkit and it is a bit messy too, but it 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: So, JavaxSwing. For Awt it is: In particular for Awt I found it a bit confusing that "Java" is repeated twice, Why isn't it: But looking at Swing, it is also a bit confusing: Why is it Javax there? Why not Java? And why isn't it: Now, I assume you guys had some kind of reasoning about this. Perhaps: may clash with something else. I actually had a name clash elsewhere, which conflicted with, I think, awt Frame (I think java_import may have Anyway, I am mostly just curious about the naming choices here, not which did not work as it is instead: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
The first word Most people tend to use |
Beta Was this translation helpful? Give feedback.
The first word
Javais a place where we bind constants for Java classes. The second word is the concatenated package name.Java::JavaxSwing::JButtonmeans a Java class JButton in the package javax.swing. We cannot know all Java classes or where they load so we use a consistent unambiguous naming. Java::Awt could be a Java class with no package which happens to be called Awt.Most people tend to use
java_importand do not see these constants unless you happen to notice the constant binding which is defined.