How can I use other Swing classes?

How should I use other swing-classes which are not presented on designer panel. For example JLayeredPanel (that is what I actually need). And what shuold I do to bind panles with class-fields. Because when I make binding only fields like buttons or TextFields are created in class code, but not panels.

6 comments
Comment actions Permalink

How should I use other swing-classes which are not
presented on designer panel. For example
JLayeredPanel (that is what I actually need).


You can add your own components to the palette by right clicking in the Palette window and selecting 'Add Component' from the context menu.

And what shuold I do to bind panles with class-fields.
Because when I make binding only fields like buttons
or TextFields are created in class code, but not
panels.


Create the field manually in the class and then attach the panel to the field by selecting it in the 'field name' property dropdown.

0
Comment actions Permalink

thanks! But when I add something to the panel always apperars some errors like there is no such class. What could it be?

0
Comment actions Permalink

thanks! But when I add something to the panel always
apperars some errors like there is no such class.
What could it be?


Can you give some more details what you're doing exactly and where you get this error?

0
Comment actions Permalink

I'm trying to do a similar thing with one of the SwingX components - a JXDatePicker. The component appears in the palette, but when I add a date picker to the form, the UI Designer box shows an error:

Class "org.jdesktop.swingx.JXDatePicker" cannot be instantiated: org.jdesktop.swingx.plaf.basic.BasicMonthViewUI

If I preview or run the app - the date pickers work fine.

0
Comment actions Permalink

Hello Tony,

TJ> I'm trying to do a similar thing with one of the SwingX components -
TJ> a JXDatePicker. The component appears in the palette, but when I add
TJ> a date picker to the form, the UI Designer box shows an error:
TJ>
TJ> Class "org.jdesktop.swingx.JXDatePicker" cannot be instantiated:
TJ> org.jdesktop.swingx.plaf.basic.BasicMonthViewUI

Thanks for your report! This was actually a bug in the UI Designer, and it'll
be fixed in a bugfix update for IDEA 6.0.
http://www.jetbrains.net/jira/browse/IDEADEV-10632

--
Dmitry Jemerov
Software Developer
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Hi All,

actually I tried to add a class that extends JTree, but I still have the same problem, although the bug seems to have been fixed... I tried two things:

I decalred this class in another package, so I had the error:

]]>

which I don't really understand! However in the designer it recognizes it as a JTree.

Then I tried to decalre the class within the class representing the form. So I had the error:

< Class "MyClass$DnDJTree" not found>

and the designer doesn't recognize it as JTree, instead of that all the panel are filled in red...

could anyone help me!?

Thanks a lot.


Lotfi

0

Please sign in to leave a comment.