L & F Concept. Can This Be Done In Java Today?

Windows 8 Desktop UI Concept

I came across an awesome UI Concept for what could have been the desktop UI for Windows 8 yesterday whiles reading around on the Windows 8 blog. I immediately fell in love with the UI and personally WISHED this is what Microsoft should have come up with along side Metro as an upgrade to the Windows Desktop Experience.

After drooling over the UI for God knows how long and reading up on the comments, I asked myself, “How easily can such a UI be created for a Java Desktop (Swing/JavaFX) Application?”

I’ve taken the time to look around the Internet for Look and Feels for Java that come anywhere near this UI Concept and I have not found any as yet. I tried playing around briefly myself and realized the concept can be achieved but requires a bit of hard work (what doesn’t).

All in all I think the UI Concept is just the bomb, and personally I would be glad if Synthetica or Substance L&F had such a theme. It would be serious hit in my opinion.

Let me know in the comments what you think about this UI concept as well as the potential for coming up with something this stunning for a Java Swing/JavaFX application today.

Something I Would Love To Do In Java

Java is a pretty cool language, and I think it is good for teaching the basics about programming. The following is just something I look forward to doing in future versions of Java if Object literals are added.

Here is how u define a rectangle in JavaFX using Java at the moment

Rectangle rect = new Rectangle();
   rect.setFill(Color.RED);
   rect.setWidth(200);
   rect.setHeight(100);
   rect.setX(20.0f);
   rect.setY(20.0f);

Here is how I would love to be able to define it,

Rectangle rect = new Rectangle({
   fill: Color.RED,
   width: 200,
   height: 100,
   x: 20.0f,
   y: 20.0f
});

I believe I have been spoiled by my usage of Javascript, and I could use other VM languages, but I think this is just fun to look at. This inherently has issues, because there would need to be to be a lot of Type Casting in order to get the variables out or to set them accordingly, because the Map passed as the argument would need to be defined as HashMap<String, Object> to ensure any value could be passed. The implementation of the Rectangle class would then need to internally map these properties to the right variables somehow.

With Collection Literals in Java 8 onwards, this all will be possible, but the other issue would be if the various UI Classes like Rectangle would be refactored to make the above code possible. I highly doubt it personally, but nothing is impossible.

I will certainly play around with this a bit later. Feel free to share your own ideas in the comments below.

Oracle Did Not Get The Memo About Annoying Users

Oracle recently release Netbeans 7.1 Beta and JavaFX 2.0 and made them available for download from javafx.com. I managed to get the download for Netbeans 7.1 Beta last night without fuss and completed the installation, also without fuss. I expected the JavaFX SDK to be bundled, but it was not.

Trying to download the SDK has become an exercise in futility as I’m presented with Login screens, failed login attempts, password resets and lastly server error pages. Switching browsers from Opera to IE gave me more than an error page and at least enabled me to access my Oracle accounts to reset my password, but the download for the JavaFX 2.0 still gives me an error message at the time of writing.

Whiles struggling with all this, I took time to read the introduction to FXML development for JavaFX 2.0 and compared it to Javascript /XAML development for the Win 8 applications and realized a vast similarities. It would be interesting to see which is the dominant application platform a year from now.

Oracle need to understand that if they want people (developers) to adopt a product they need to make it available without hassle, and then provide compelling services on their website where people can choose to register to be a part of. Even Microsoft are giving away downloads of the Win 8 OS without the need for an account. Oracle need to step up and move away from bureaucratic thinking and get with the programme.

Enough ranting, going back to try the download again.

Cool JavaFX 2.0, But What Happened To JFileChooser?

JFileChooser With Missing Icon (Netbeans)
JFileChooser With Missing Icon (Netbeans)

In the midst of all the good news about JavaFX 2.0 and the reinvested interest in the Java Swing Platform by Oracle at JavaOne, I have to ask myself: what happened to JFileChooser? In all the articles I have read in the past year or so about all the cool and upcoming features in the Java 7 and the new component(s) being introduced the Swing library, I have heard very little about JFileChooser or any improvements planned for the platform.

There have been a lot of complaints in the past about poor performance and a lack of some basic functionality for that component. There were even some mentions of the component being replaced with a Native Implementation sometime back, but there has not been any concrete word on that. Personally, my current pet peaves with the component include:

  • Way too minimal right-click PopupMenu – only New Folder, Rename, View and Refresh are implemented. This minimal popup is also way to difficult to extend by the entry level user. Also, drag and drop file handling is implemented, so why is it so difficult to include Open/Select, Cut, Copy and Paste as basic options in the default popup menu?
  • Poor performance for listing directories and their contents when zip archives are included
  • Lack of decent Directory View (possibly as a tree)
  • Ability to use “\\<pc-name>” option on a Windows based system to navigate to a network location

Other more advanced users have other problems with the component but these are the few I feel are general problems and could be fixed or improved.

The current “Open Project” and “Open File” implementations in the Netbeans IDE seem to have some very useful implementations of the JFileChooser and some have even advocated that those components be ported back into the main JDK source if possible, but that is yet to be seen or determined.

All in all, I think the JFileChooser component needs some attention, because it certainly is starved for some.

It Takes 2: From Java 2 to JavaFX 2.0

From Java 2 to JavaFX 2
From Java 2 to JavaFX 2

After hearing about Oracle’s new Road Map for the JavaFX 2.0 release expected to be made available next year, I found it sort of funny to realize the similarity between what it took for Java to become successful and what it probably is going to take for JavaFX to be become successful.

Up until version 1.6 of the currently successful Java Platform, it carried the brand “Java 2 Platform v1.x” and this was basically the platform I met when I begun my programming career. According to Wikipedia:

J2SE 1.2 (December 8, 1998) — Codename Playground. This and subsequent releases through J2SE 5.0 were rebranded Java 2 and the version name “J2SE” (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included reflection, a Collections framework, Java IDL (an IDL implementation for CORBA interoperability), and the integration of the Swing graphical API into the core classes. a Java Plug-in was released, and Sun’s JVM was equipped with a JIT compiler for the first time.

So what is similar in between Java and JavaFX at this point? That will be their version number. It seems Java and JavaFX will potentially owe their success to their “second” major version. From the road map presented by Oracle and the expected changes with respect to API, language and integration changes, I expect if finished in time and coupled with a possible Java 7 release around the same time, JavaFX 2.0 is set to become the next best thing in the RIA and Java UI development arena.

I so far have not used JavaFX for anything more than a demo app and an attempt at making a Flash type web banner animation. But with the proposed changes, I feel I can immediately drop JavaFX 2.0 into my current application to pimp up the UI and deliver a whole new user experience for the next version of the application. So I only hope Oracle lives up to the current road map and plans and deliver a kick ass platform with all the proposed widgets and finally what seems like JWebpane.

Oracle make us proud.

Using JSON in Java Swing

After months of working with PHP and AJAX, I finally found time and a reason to go back to Java Swing. This simple application, made at a friend’s request, enables one to determine his/her Ghanaian name based on their date of birth. With all the time I have spent working with PHP and AJAX, I have come to love the JSON data exchange format and I simply could not pass up the opportunity to see how it performs and works with my latest Java Swing incarnation. The application also includes the new Swing Task Dialog component and makes use of the Joda Time API.  Continue reading Using JSON in Java Swing

JavaFX 1.3 Adds New Features and Fixes My Pet Peave

Oracle recently released JavaFX 1.3 and this comes with many fixes, but my favorite little fix is the damn JS sniffing code used by the JavaFX javascript. This has now been updated to enable Opera browsers above 10.5 to detect and load JavaFX applets.

Aside that, I think release has finally piqued my interest in JavaFX and I am planning an uptake when Netbeans 6.9 is released.