Thursday May 31, 2007

Java FX @ Java One

Everyone (especially in the US) loves a winner and at every Java One you have one product, technology or event that makes the biggest splash. 2007 is shaping up as the year of Java FX. In a nutshell: "JavaFX comprises a comprehensive set of runtime environments, widgets, development tools, and scripting environments At the 2007 JavaOne Conference, Sun introduced two products in the JavaFX family: JavaFX Script and JavaFX Mobile." You owe to yourself to kick the tires on Java FX Script, so here are some pointers to some resources on the web.

As far as I am concerned, this year's conference was one of the better ones, that I've attended (since '96). I have not been so excited since 2003 when we previewed Java Studio Creator. One of the cool things about the conference is the social networking aspect. You end up having a beer with entrepreneurs that will become the next Jeff Bezos, renowned technologists and lot's of other folks with who you collaborate during the year, but they always at the end of the phone line or just a name in the CC list.
 

Thursday May 03, 2007

What's on tap @ NetBeans Day

The NetBeans platform and IDE has evolved tremendously in the last couple of years. Version 6 is around the corner and the Sun will be releasing a preview at NetBeans Day / Java One. So what's on tap? Support for native and dynamic languages (Ruby, JavaScript), Java Studio Creator's ease of use available for desktop applications, integrated profiler, rapid visual web application development, UML, REST W/S, lots of productivity features, etc. The best way to get more info is by attending NetBeans Day (details below).

May 7th, Moscone 

NetBeans Day

Highlights

  • NetBeans Day Opening Session: Jonathan Schwartz and Rich Green
  • Lunch with the Java Posse
  • NetBeans 6.0 IDE
  • Partner Showcase
    • CollabNet, YASU Technologies
  • Swing GUI Building With Matisse: Chapter II
  • NetBeansMobility
  • JRuby: Understanding the Fuss
  • Partner Showcase
    • Intland, USDA, Xoetrope
  • Closing Session: James Gosling

The first 400 attendees will receive a free copy of Rich Client Programming: Plugging into the NetBeans Platform. We will also be giving out 1 GB USB flash drives, loaded with the latest NetBeans 6.0 Milestone. Throughout the day, we will be giving out special edition NB 6.0 T-shirts and NetBeans cubes. Pay attention, you may have to earn your T-shirt by asking or answering a question.

Friday Apr 20, 2007

Java 6 available on Ubuntu Feisty via Multiverse

The good news:

  • Java 6 is now available on Ubuntu 7.04 (Feisty Fawn) from the multiverse repositories
  • A couple of simple commands will install Java 6 on your system:
    1. Get and install Java: sudo apt-get install sun-java6-jdk
    2. Make Java 6 default: sudo update-alternatives --config java
    3. Edit sudo vi /etc/jvm the first entry should point to your JDK /usr/lib/jvm/java-6-sun
    4. Optionally you can install the jre and firefox plugin: sudo aptitude install sun-java6-jre sun-java6-plugin

Of course, you'll be better off following the documentation available on the Ubuntu website.

The not so good news:

  • Java 6 is still not default on Ubuntu 7.04 (after installing the OS you get 1.4.2)
  • You can install Java 6 from the Applications | Add/Remove, however you have to fish for it and "Show" All Available Applications when you search for it

In addition to Java, Glassfish v1 and NetBeans 5.5 are also available from the multiverse repositories. IMHO this software stack makes Ubuntu very competitive vis-a-vis RedHat / JBoss. I'll blog some other time on this topic. 

Monday Apr 09, 2007

Game geeks will love it

Here is an implementation of the popular "Lines" Russian game written by Alexei Mokeev in F3. Business logic and cool graphics in less than 350 lines of code. Take a look at the snippet below to see how one leverages Java the language, and of course this runs on the JVM.

 

import f3.ui.\*;
import f3.ui.canvas.\*;
import java.lang.System;
import java.lang.Math;

 ...

operation Lines.moveBallTo (to:LinesCell) {
    var path:LinesCell\* = [to];
    while(to.marker <> 0) {
       to = getMinimumAround(to);
       insert to as first into path;
    } //OK. We have Path

    activeCell =-1;
    var frm:LinesCell = path[0];
    to = path[sizeof path -1];

    var l:Integer = sizeof path;

    if (l == 2) {
        to.ballColor = frm.ballColor;
        frm.busy = false;
        to.busy = true;
        changed = true;
        dropBalls();
        return;
    }

    // Clearing FROM
    to.ballColor = frm.ballColor;
    frm.busy = false;

    for (cell in path[indexof . <l-1]) (dur (l-2)\*100 linear) {
        cell.marker = -10; //Field in movement
    }

    for (cell in path[indexof . < l]) (dur (l-2)\*200 linear) {
        cell.marker = -1; //Stop markup
        if ((cell.x == to.x) and (cell.y == to.y)) { //Ok. We at the end
            to.busy = true;
                   
            for (c in fld[n|n.marker == -10]) { c.marker = -1;}
            changed = true;
            dropBalls();
        }
    }

}
 

Take a look at the screen shot of the game running on my Mac.

 

Friday Feb 16, 2007

"Pretty" Java

Not long ago I went to Monrovia (East of LA) to meet the Sun folks working on SOA toolability and runtimes. I gave a demo of Java Studio Creator and also learned about their work on developing a new technology. Like any presentation it's the demo that makes or breaks the deal and I was blown away by what Chris Oliver has shown that day.

The technology is called F3 - "form follows function" (the name will likely change), a declarative Java scripting language, which among other features, enables easy binding of UI element to data. Here is a link to his blog and a demo of F3 in action. F3 takes advantage of Java 2D and Swing and enables developers to rapidly develop "icandi" applications. This technology does a better job than anything else I've seen in exposing the power of Java for developing GUI applications.

There is a lot of interest around this project and perhaps if it becomes open source soon, the community will help the technology evolve to a point where is has critical mass and wide industry adoption. Having support for something like F3 in an IDE, such as NetBeans would also help. I suspect that this will happen shortly :-) Stay tuned.
 

Sunday Nov 05, 2006

Simplicity is the ultimate sophistication

I did not come up with that, it was Leonardo Da Vinci, however we've been trying to apply just that in the tools organization here at Sun. The voice of the customer was clear: they did not like changing tools in process of building Java and native applications using Sun's tools.

A good friend put this is in a nustshell: "The answer is NetBeans", what is your question? We just released NetBeans 5.5 and a series of Packs that complement the functionality already part of the base product. Most of the functionality of Java Studio Creator can now be found in something called the NetBeans Visual Web Pack, enterprise tools, formerly found in Sun Java Studio Enterprise are now bundled in the NetBeans Enterprise Pack. Moreover native development is now possible in Netbeans via the C/C++ Pack (this is wild since it also works on my PowerBook G4 Mac using the native compiler).     

People that know me could tell you that I am a little skeptical so I tried to install myself the whole tools stack and I wanted to see if I can do some real application development using all this functionality, now available in one tool.

Project scope:

  1. Develop a simple Web Service
  2. Rapidly create a web application visually using the packaged JSF components and consume the Web Service developed in step one
  3. Reverse engineer the web application (UML is now available on the NetBeans beta update center) so I can learn (or remind myself :-)) about the framework that Java Studio Creator uses to manage the application life cycle

Let's get to work.

Creating a Web Service (W/S) is part of the basic NetBeans functionality and can be done a couple of ways. I chose to create a web application project to which I could add a W/S. If you are interested in the details take a look at this tutorial (which documents W/S creation for NetBeans 5.0, but is relevant for the 5.5 release). The IDE creates the W/S (class & deployment descriptors, etc) and all you have to do is add one or more interfaces. You can deploy and test the W/S within a minutes. Pretty sweet. The only complain is that I wish I had a W/S project type rather than having to create a generic web project.

Next step involved, creating a web application that can consume my W/S. I chose a Visual Web Application project which, to my surprise was just as simple as using Java Studio Creator. You have all these (JSF extensions) widgets in the palette to choose from and you can just drag and drop them onto the page / form. I used just a couple of components: a button and a static text. The idea was to call the W/S in the action handler of the button and set the text of the static text component to whatever the W/S returns. The only complication was that I had create the W/S client within the project. In Creator all I had to do is locate a W/S via its WSDL and from that point on I could just drag and drop it on the form or a component. In this iteration of the Visual Web Pack you have to manually (right mouse click on the "Web Pages" node in the project and select "New | Web Service Client") create the W/S client. Once the client is created you can expand the tree "Web Service References" node and look for the method / interface and drag and drop it in the page (the Java view of the form / page). This action will insert a code clip:


        try { // Call Web Service Operation
            wsconsumption.OTWebServiceService service = new wsconsumption.OTWebServiceService();
            wsconsumption.OTWebService port = service.getOTWebServicePort();
            // TODO process result here
            java.lang.String result = port.getName();
            System.out.println("Result = "+result);
           

            // this is my code that uses the W/S to set the text
            staticText1.setText(port.getName());
        } catch (Exception ex) {
            // TODO handle custom exceptions here
        }

My last step involved creating a UML reverse engineering project which has as target the visual web application project. This is a very simple operation, just follow the wizards. In the project, expand the model node, look for the relevant Java package, expand it and select it together with all its files, and use the context menu to generate a diagram (usually class is the most relevant). Now I can look at the various artifacts of the visual web project, understand the dependencies, etc.

In case I have not said this already, all of this is possible using NetBeans 5.5 and its supporting cast of Packs. 

Tuesday Sep 05, 2006

Old job nostalgia

I've been in my new job for three month. The "bits" and I growing farther apart. In an attempt to re-establish myself as a coder I decided to write a simple Netbeans plugin. Here are my findings. [Read More]
About

octav

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today