Sit amet felis. Mauris semper,

Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, ...

Category name clash

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra. Nulla in tellus eget odio sagittis blandit. ...

Test with enclosures

Here's an mp3 file that was uploaded as an attachment: Juan Manuel Fangio by Yue And here's a link to an external mp3 file: Acclimate by General Fuzz Both are CC licensed. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Quisque sed felis. Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, ...

Block quotes

Some block quote tests: Here's a one line quote. This part isn't quoted. Here's a much longer quote: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In dapibus. In pretium pede. Donec molestie facilisis ante. Ut a turpis ut ipsum pellentesque tincidunt. Morbi blandit sapien in mauris. Nulla lectus lorem, varius aliquet, ...

Contributor post, approved

I'm just a lowly contributor. My posts must be approved by the editor.Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam. Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros. Aliquam pharetra. Nulla in tellus eget odio sagittis blandit. Maecenas at ...

Posted by The Java Monkey - - 6 comments

The other day I was putting together a test harness for a project. I decided to try the cool Swing Desktop Application framework that comes with NetBeans 6. An hour later I had a fully working and tested test harness (rapid app development in Java is now possible!). The last part was to build a standalone binary distribution of this and run it the test environment.

At this point I hit a major stumbling block. As my NetBeans runs on JDK 1.6, NetBeans created all the group layout GUI code with the GroupLayout javax.swing packages and classes that come by default with Java 1.6. However, the test environment I was going to be running on, only had Java 1.5, and could not be upgraded easily. The GroupLayout code does not work in Java 1.5. I couldn't find much in google on how to switch between the two, and remembered that a year ago I tried to do a similar conversion with find..replace from javax.swing to org.jdesktop which didn't work due to class interface differences.

After playing around in Matisse for a while, I worked out how to get NetBeans 6 to do this conversion for you. The best part is it does it quickly and effortlessly.

Bring up the GUI class in question, and switch to the Matisse designer view of that class. In the Inspector pane, select the form, right-click on it and click Properties as the following screenshot illustrates:



In the resulting properties dialog, there is an option Layout Generation Style, which facilitates the switching from pre-Java 1.6 and Java 1.6. Simply select Swing Layout Extensions Library and NetBeans immediately converts your code. The next screenshot illustrates the options in the aforementioned properties dialog:




Sweet!

6 Responses so far.

  1. pradip tiwari says:

    Thank you.. this was useful..

  2. Dr. John says:

    Curiously, there is a global setting for
    Layout Generation Style, but it doesn't seem to apply itself to each form class.
    I found that if I have a bunch of GUI classes, I have to toggle the Layout Generation Style property individually on each class. Sometimes, I have to switch it to "Standard Java 6 code" then immediately choose "Swing Layout Extensions Library" in order to force it to regenerate the form code.

  3. Yuk says:

    Thank you, really helped me out with this and saved a lot of trouble!

  4. Anonymous says:

    very useful!

  5. This post tells you about NetbBeans 6.1 which include very important feature of switching between org.jdesktop to javax.swing. The screenshot given in this post help me a lot in understanding the conversion. Thanks for the post.

  6. geetha says:

    Ecorptrainings.com provides JAVA SWING in hyderabad with best faculties on real time projects. We give the best online trainingamong the JAVA SWING in Hyderabad. Classroom Training in Hyderabad India

Leave a Reply

Recent Posts