3

I am looking at the NetBeans Platform using NetBeans IDE to create a Swing UI application.

I am trying to get a jCalendar component into the palette and onto my window. The problem is that if I attempt to drag it onto the form I get an error saying it is not included as a dependency on my module.

enter image description here

So I thought no problem, I will add it, however, even though it is in the palette and getting it there involves creating it as a library, when I attempt to go to Add Dependency under project properties / Libraries, it is not in the list of Libraries to choose from!

enter image description here

The project is a NetBeans Module, and when I create this in a regular java project, I can find it in the list. I can also see it in the Library Manager, but not in the properties of a NetBeans Module.

enter image description here

Any ideas why I can not get this library added here?

P.S. I was trying to use this tutorial to get this picker onto my palette. I assume the difference is, his project isn't a NetBeans Platform one? http://greenxgene.blogspot.co.uk/2012/04/how-to-use-jcalendar-date-picker-in.html

Blueberry
  • 2,211
  • 3
  • 19
  • 33

3 Answers3

3

There's a way easier method than writing wrappers.

  1. Go to Tools -> Palette -> Swing / AWT Components.

  2. Create new category named JCalender

  3. Hit Add from JAR and just follow the simple steps.

That's all. And you'll have this sweet view :

JCalender in Pallet

m4heshd
  • 773
  • 9
  • 23
2

I think the root of the problem is that you need to create a "Library Wrapper Module"

This wraps your jCalendar jar and creates a NetBeans module out of it.

New Project Dialog

After that you should be able to add the item to your form.

Tim Sparg
  • 3,294
  • 2
  • 27
  • 40
  • There is a shortcut. right click on properties -> libraries -> wrapped jars -> and add your jar there. This will make your library a part of the module that you're working on. This can be useful for quick prototyping, however it is not recommended as you can start duplicating dependencies very easily with this method. – Tim Sparg Jun 26 '12 at 15:02
  • I tried that one Tim, didnt actually work. Since it didnt look like the right way to do it, I didnt try too hard! Still not sure why this needs to be wrapped... – Blueberry Jun 26 '12 at 15:51
0

To add your library to the libraries palette, do this:

  • go to Tools/Libraries
  • press New Library
  • set a Library Name and choose Class Libraries as a Library Type
  • press the Add JAR/Folder button and add all the jars that would form your library (add sources and java docs using the other tabs as well)
  • press Ok and you're done

If you want to use the library for Netbeans Platform development, do as Tim mentioned.

SorinS
  • 180
  • 1
  • 12