I've just release 0.3 ALPHA of the Swing JavaBuilder, whose aim is to dramatically improve the productivity of Swing development via declarative UIs in YAML (and thus give us a better option than that infernal JavaFX thingy).
One of the biggest deliverables of this new release is the first build of the Swing JavaBuilder PDF book that aims to provide a more thorough documentation of the project's goals and features.
Hope you will all find it useful:
http://javabuilders.googlecode.com/files/swing.javabuilder.0.3.ALPHA.zip
(the PDF book is in the root of the ZIP)
It is still missing the section on layout management using MigLayout
http://code.google.com/p/javabuilders/wiki/LayoutDSL
but that will be merged into the PDF soon.
More info at the JavaBuilders site:
http://code.google.com/p/javabuilders/
Saturday, January 10, 2009
Wednesday, December 10, 2008
Enhancing Java: multiline strings and un-escaped strings
Here's my initial proposal for enhanced String handling in Java that I would like to implement as part of the Kijaro project, which is an experimental fork of OpenJDK where Java hackers can try out new language features that they feel are missing.
Any comments are welcome!
Link to Google Doc with the specs:
http://docs.google.com/View?docid=d36kv8n_32g9zj7pdd
Quick teaser:
Any comments are welcome!
Link to Google Doc with the specs:
http://docs.google.com/View?docid=d36kv8n_32g9zj7pdd
Quick teaser:
String sql = """
SELECT col1, col2, col3
FROM Table1
WHERE col1 = 'Test'
AND col2 = ?
ORDER BY col1""";
Thursday, October 30, 2008
Java 6u10: code your RIA in any language (Ruby, Scala, Python, Groovy)
In what can only be described as an excellent move on the part of Sun Microsystems, the new Java 6u10 update (whose sole aim is fixing up all the applet issues to make them a worthwhile competitor to Flex and Silverlight) has full support for all non-Java languages that can run on the JVM: Ruby, Scala, Jython/Python, Scala...even JavaFX :-)
This includes the ability to script all of them using JavaScript from the browser page itself:
http://www.mail-archive.com/jvm-languages@googlegroups.com/msg01073.html
https://jdk6.dev.java.net/plugin2/liveconnect/#NON_JAVA_LIVECONNECT
This is excellent news that should surely increase the chances of applets against Flex, which currently locks you into the Adobe-only ActionScript language (even though admittedly, it is a JavaScript derivative)
More info here:
http://blogs.sun.com/theplanetarium/entry/java_se_6u10_some_things
This includes the ability to script all of them using JavaScript from the browser page itself:
http://www.mail-archive.com/jvm-languages@googlegroups.com/msg01073.html
https://jdk6.dev.java.net/plugin2/liveconnect/#NON_JAVA_LIVECONNECT
This is excellent news that should surely increase the chances of applets against Flex, which currently locks you into the Adobe-only ActionScript language (even though admittedly, it is a JavaScript derivative)
More info here:
http://blogs.sun.com/theplanetarium/entry/java_se_6u10_some_things
Wednesday, October 22, 2008
Forget JavaFX: PulpCore is the real Java RIA
Sometimes a little project out of nowhere comes along and delivers something that instantly grabs you and makes you say "this is it!".
Such was my experience when on the Swing links of the week I found a mention of PulpCore, a small framework that is an alternative to the whole JavaFX fiasco and delivers what we've wanted all along: fun, fast, great looking applets in pure Java (not some new questionable language being forced down your throat)!
http://www.interactivepulp.com/pulpcore/
Try these ones in particular:
http://www.interactivepulp.com/pulpcore/particles/
http://www.interactivepulp.com/pulpcore/sketch/ (Flash, eat your heart out on this one) :-)
The API seems very concise (the code for each of the applets is very short), yet the end results is light years ahead of any of the awkward ugly demos of JavaFX I've seen.
Maybe there is hope for applets to complete with Flash head on after all.
Such was my experience when on the Swing links of the week I found a mention of PulpCore, a small framework that is an alternative to the whole JavaFX fiasco and delivers what we've wanted all along: fun, fast, great looking applets in pure Java (not some new questionable language being forced down your throat)!
http://www.interactivepulp.com/pulpcore/
Try these ones in particular:
http://www.interactivepulp.com/pulpcore/particles/
http://www.interactivepulp.com/pulpcore/sketch/ (Flash, eat your heart out on this one) :-)
The API seems very concise (the code for each of the applets is very short), yet the end results is light years ahead of any of the awkward ugly demos of JavaFX I've seen.
Maybe there is hope for applets to complete with Flash head on after all.
Monday, August 18, 2008
Java Swing fonts in Java 6u10 : B.E.A.U.T.I.F.U.L.!
I've been known to make a few negative comments here and there about Sun's handling of Java recently, but I have to say they've really delivered on their Swing fidelity promises with the latest update.
The switch to using the native Windows font rasterizer for font rendering has made an enormous difference. It's just a pleasure to look at Swing applications now (and even though the Swing API is not perfect, I prefer it much more to SWT with its myriad of hard-coded SWT.* styles).
On the Linux front, the builds of OpenJDK 7 look really great on Ubuntu as well and have fixed most of the glaring GTK+ bugs.
Thank you Sun for a great job on this. It's good to see solid effort like this being put into maintaining Swing.
P.S. You asked for JDK 7 / GTK+ screenshots, so here they are:

Wednesday, August 13, 2008
Using JavaFX objects from within Java: a very bad joke from Sun
So I read this article about accessing JavaFX objects from within Java, which is quite easy, it seems:
http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/index.html
Hidden lower in the article is the first public example I see of the opposite scenario: accessing JavaFX classes from Java.
I was (naively) expecting this would be done the way Groovy does it...as real JVM classes that are interoperable across all JVM languages. But, as usual JavaFX shows its "thrown-together-in-a-hurry-as-a-response-to-Flex" roots:
The Silverlight/C# guys must be laughing their heads off looking at that sample.
http://java.sun.com/developer/technicalArticles/scripting/javafx/javafx_and_java/index.html
Hidden lower in the article is the first public example I see of the opposite scenario: accessing JavaFX classes from Java.
I was (naively) expecting this would be done the way Groovy does it...as real JVM classes that are interoperable across all JVM languages. But, as usual JavaFX shows its "thrown-together-in-a-hurry-as-a-response-to-Flex" roots:
public class Main {
public static void main (String[] args) {
ScriptEngineManager manager =
new ScriptEngineManager();
JavaFXScriptEngine fxEngine =
(JavaFXScriptEngine) manager.getEngineByName("javafx");
try {
String param = "JavaFX object created in Java";
String script = String.format (
"MyJavaFXClass {property: \"%s\"}", param);
Object o = fxEngine.eval(script);
fxEngine.invokeMethod(o, "printProperty");
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
I mean, just beautiful, isn't it...who cares about type safety and static compiling, when we just expose a half-baked scripting interface.The Silverlight/C# guys must be laughing their heads off looking at that sample.
Saturday, July 19, 2008
Java SwingBuilder 0.2 DEV : added support for SWT-style menu API
In my ongoing quest to maximize Swing developer productivity the latest version of the Java SwingBuilder introduces the SWT-style API for creating JMenuItems, which allows you to define the text, mnemonic and accelerator all in one shot, e.g.
http://weblogs.java.net/blog/joconner/archive/2006/10/layout_manager.html
using our visual layout DSL for MigLayout...piece of cake:
JMenuItem(name=saveMenu, onAction=save, text="&Save\tCtrl+S")Also, the visual layout Wiki has been updated to showcase how to implement John O'Conners Layout Manager Challenge:
http://weblogs.java.net/blog/joconner/archive/2006/10/layout_manager.html
using our visual layout DSL for MigLayout...piece of cake:JPanel:
- JScrollPane(name=scroll1): JList(name=list)
- JLabel(name=lNameLbl, text=Last Name)
- JLabel(name=fNameLbl, text=First Name)
- JLabel(name=phoneLbl, text=Phone)
- JLabel(name=emailLbl, text=Email)
- JLabel(name=address1Lbl, text=Address 1)
- JLabel(name=address2Lbl, text=Address 2)
- JLabel(name=cityLbl, text=City)
- JLabel(name=stateLbl, text=State)
- JLabel(name=postalLbl, text=Postal Code)
- JLabel(name=countryLbl, text=Country)
- JTextField(name=lName)
- JTextField(name=fName)
- JTextField(name=phone)
- JTextField(name=email)
- JTextField(name=address1)
- JTextField(name=address2)
- JTextField(name=city)
- JTextField(name=state)
- JTextField(name=postal)
- JTextField(name=country)
- JButton(name=newBtn, text=New)
- JButton(name=deleteBtn, text=Delete)
- JButton(name=editBtn, text=Edit)
- JButton(name=saveBtn, text=Save)
- JButton(name=cancelBtn, text=Cancel)
- MigLayout: |
[grow] [grow] [grow]
scroll1+1+* >lNameLbl lName fNameLbl fName
>phoneLbl phone emailLbl+2,email
>address1Lbl address1+*
>address2Lbl address2+*
>cityLbl city postalLbl postal
>stateLbl state
^|newBtn+*=1,^deleteBtn=1,^editBtn=1,^saveBtn=1,^cancelBtn=1 [grow]
Get the latest version from here:
http://javabuilders.googlecode.com/files/javabuilder.swing.0.2.DEV.2008-07-19.zip
More info as usual on JavaBuilders.org
Subscribe to:
Posts (Atom)
