Monday, September 7, 2009

Howto Install SwingX in NetBeans 6.7

Today I feel like doing some graphic stuff in my pet application. Even when Swing is really nice, I usually miss a lot of more cool effects. Just thinking in all the needed code to create an usable JTable gives me a headache.

So I've decided to use SwingX. For those of you that doesn't know about SwingX, please check their website, but as a resume I will simple say that are a collections of advanced Swing components and that some of them will become part of the default Swing set in JDK 7.

Let's start the party:

Download SwingX to you computer

You can do it from here: SwingX Download. Now I would recommend you to unpack it.

Add SwingX Library to NetBeans
  1. In NetBeans go to Tools -> Library Manager and click the "New Library..." button
  2. Type a name: SwingX
  3. Now in the ClassPath tab you need to add the jar files you will find the /dist
  4. (Optional) You can also add the SwingX sources and documentation (The SwingX 1.0 javadoc zip file is incomplete, but I used the "Hudson Continuous Build Javadoc" without problems)
Add SwingX to your Project
  1. Right click on your project and choose "Properties"
  2. Select the "Libraries" section in the left tree
  3. Now click in "Add Libraries..." in the right panel
  4. Select the Library you created in the previous step ("SwingX" if you followed my suggestion)
  5. Finally hit the "Add Library" button
Add SwingX Components to the Palette
  1. Create or open a GUI class form. You'll then see the Palette on the right side (by default)
  2. Right click on the Palette and choose "Palette Manager..."
  3. Click "New Category..." and choose a name. I would suggest to type SwingX again.
  4. Select the newly created category and choose "Add from Library..."
  5. Now choose all the components you want to have available (use Ctrl+A to select all)
  6. Finally choose again the "SwingX" category
  7. Click "Finish"
We're done. Now you can use the SwingX components in your NetBeans Projects.

Happy coding

7 comments:

  1. Muchas, pero muchas Gracias!

    ReplyDelete
  2. I cannot explain how helpful this was!! :)..even SwingLabs tut was hard, this really helped alot!..thanks again man

    ReplyDelete
  3. JXDatePicker component says it cannot be instantiated once it is dragged into the GUI Builder. Any ideas why?

    ReplyDelete
  4. Great help.... too good. Nice way to describe...

    ReplyDelete
  5. This is a brilliant tip ! Everywhere else seems to have a million different things to do to get to the same point !

    This is concise !

    ReplyDelete
  6. how about? dragging while the project was Netbeans Platform Based.. says "it cannot be instantiated"

    ReplyDelete