Last updated August 03, 2012 01:42, by Jesse Glick
Feedicon  

Getting Started using BSAF with NetBeans


News

http://netbeans.org/bugzilla/show_bug.cgi?id=204661#c59 has some recent updates.

Short and sweet version

It is much easier than I thought. Here are the steps:

  • Use Netbeans v7.0 or earlier. Version 7.1 and later will not load the View into the GUI builder. Sad.
  • Download the class library, source, and javadoc jars
  • Create a new library from the tools menu (called BSAF in this document)
  • Create a Java Desktop Application project normally.
  • Remove the "Swing Application Framework" library and add the BSAF library
  • Clean and build
  • Run or Debug

Note: If you update an existing project (that has been run at least once) you will get the following error the first time you run the new libraries, due to differences in the way property classes are stored. This error should only occur once as the problem is resolved when the program exits normally. However be aware that all GUI related properties will be lost.

The error looks like:

Hand holding for newbies (like me)

At the time this page is being written the version is 1.9.1. We recommend you download and use the latest release version.

Download the jar files

Select Downloads from the blue navigation area on the left. Choose 1. Class library, 2. Javadoc, and 3. Sources. Download these jar files into a directory outside your project and the NetBeans environment. They will be reused across projects and NetBeans versions.

Create the BSAF library

The Library Manager is started from the Tools/Library menu. Use the "New Library" button to create the BSAF library. The class library is all that is needed to run, but the javadoc jar will provide documentation while editing sources and the sources jar allows stepping into the library when debugging.

Create a new Java Desktop Application

New desktop application may be created as usual. When created NetBeans (starting with version 6.9) will warn you with this disclaimer dialog:

As stated at the outset, Netbeans 7.1 made good on this threat. You can use SAF and compile SAF applications, but the GUI builder will not load the View. You'll get an error:

The Java and Netbeans teams have orphaned a useful lightweight, off-line application framework more appropriate than the NetBeans, Eclipse, or OpenOffice platforms in many cases. Are there enough SAF legacy users to reverse this course of action?

Replace the SAF library

After a project is created, use the properties editor to substitute the BSAF library for the SAF library. The New Project wizard will create a desktop application with only the Swing Application Framework library. From the Projects tab, right click on the project and select Properties. Then select the Libraries section. Remove the Swing Application Framework library and add the BSAF library created above.

  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2014, Oracle Corporation and/or its affiliates
(revision 20160708.bf2ac18)
 
 
Close
loading
Please Confirm
Close