This software is licensed under the CC-GNU LGPL.

GWT Widget Library

Tuesday, June 13, 2006


GWT-WL Now On SourceForge

I am moving the GWT Widget Library project over to SourceForge, which has some pretty nice tools for managing the project. The GWT Widget Library will now include a browsable subversion repository, bug and feature tracking, multiple distribution types, and a website for project documentation and JavaDocs. It should allow me to manage things a little better and give me somw web space for things that I can't put up on the blog.

SourceForge Project:

Project Home Page (needs work):

Personal Blog (occasional GWT articles)

Feedback on the new setup and features is welcome.

Monday, June 12, 2006


ANNOUNCE: GWT Widget Library 0.0.4

Download Version 0.0.4

New Packages:

This is a package for temporary classes meant to temporarily fix issues with GWT components. It is expected that these classes will be removed at some point with little warning.

New Classes:


Friday, June 09, 2006


JsGraphics coming in 0.0.4

If you haven't heard of JsGraphics, it is a drawing library that is compatible with a wide range of browsers, even very old browsers like Netscape 4.x and IE 4.x.

Version 0.0.4 of the library will include a wrapper for JsGraphics which will hopefully allow for charting packages and such to be built on top of it.

To give you a sampling of the API, here is a screenshot and sample code to build a bar and lioine chart.


public void onModuleLoad ()
JsGraphicsPanel p = new JsGraphicsPanel("g");

int[] data = new int[]{150, 200, 187, 56,
92, 112, 69, 185, 175, 46};

int[] xPoints = new int[data.length];
int[] yPoints = new int[data.length];

for (int i = 0; i < data.length; i++) {
int val = data[i];

p.setColor(new Color(122, 10, 87));
p.fillRect(i * 30 + 30, 300 - val, 20, val);

xPoints[i] = i * 30 + 40;
yPoints[i] = 300 - val;

p.drawPolyline(xPoints, yPoints);

The way the JavaScript library is set up makes it difficult to allow you to uild the widget and add it to RootPanel. Instead you need to create the JsGraphicsPanel from an existing HTML element in the page by passing the ID of the DIV element.

Here is the HTML that was used for the example above:

<title>Wrapper HTML for MyApplication</title>
<script src="script/wz_jsgraphics.js" type="text/javascript"></script>
<meta name='gwt:module' content='org.hanson.gwt.MyApplication' />
<script language="javascript" src="gwt.js"></script>

<div style="border:1px solid #000;overflow:hidden;width:350px;height:290px;"><div id="g"></div></div>


I am hoping to release this on Monday, along with some other utilities such as converting from Java to JavaScript arrays, and some small bug fixes.

Sunday, June 04, 2006


ANNOUNCE: GWT Widget Library 0.0.3

What's New in GTW Widget Library 0.0.3

Download Version 0.0.3

This Color and BorderStyle classes, as well as several style setting methods in ImageButton are under consideration for removal. If you have an opion please comment on


FormPanel API Proposal

I am working on a file upload (like everyone else), and created a few widgets for it, including a FormPanel. This might make it into Monday's release of my distribution. I welcome comments on the API.

The FormPanel's constructor takes a Panel as an argument. This panel is used to organize the widgets inside of the form.

public FormPanel (Panel panel);
public Panel getPanel ();
public void setEncodingType (String type);
public void setMultipartEncoding ();
public void setMethodAsGet ();
public void setMethodAsPost ();
public void setTarget (String url);
public boolean add (Widget widget);
public void submit ();

I also created a FileUpload class, that currently only has a constructor and no methods, The constructor takes the field name as it's only argument.

public FileUploadField (String name);

Here is a code example of using both classes:

final FormPanel form = new FormPanel(new FlowPanel());

FileUploadField fUpload = new FileUploadField("file");

Hyperlink addLink = new Hyperlink();
addLink.setText("Add File");
addLink.addClickListener(new ClickListener()
public void onClick (Widget sender)

Feedback welcome.

Friday, June 02, 2006


Coming Soon in 0.0.3

I haven't had a lot of time to expand the library this week, but there are a few new things, and a reorganization of the packages.
I expect that this structure will be stable for some time, and it isn't as ego-centric as "org.hanson" was.

A few new classes:

I expect that this will be packaged and released on Monday, June 5th.


May 2006   June 2006  

This page is powered by Blogger. Isn't yours?