|
#1
|
|||
|
|||
|
Swing Components/Netbeans Palette
I'm having some trouble with the Netbeans palette manager. I created a new class that extends JPanel. All that I'm changing is the paintComponent method. I want to add this new class into the palette so I can drag and drop it in the GUI design screen.
I compile my new class and put it into a jar file. I open palette manager, find the jar and import the component that is listed. The component has an icon that is a page with a question mark on it. When I try to put it onto a GUI design, it stalls the program until I undo the addition. Any idea on how exactly to get a component onto the palette? |
|
#2
|
|||
|
|||
|
Netbeans is probably invoking your paintComponent method in order to display a preview of the widget. Is it possible that your paintComponent method could be broken in some way or just be really slow?
__________________
~evlich |
|
#3
|
|||
|
|||
|
Hmm, that is a possibility. So there's no special code that needs to be added to the actual component to allow it to work properly?
|
|
#4
|
|||
|
|||
|
I would seriously doubt it. Think about it, if that was the case then they would have to extend the Swing interfaces. There might be additional classes that are written which detail the interface, or they may use reflection to look at fields for configuration. But I would doubt that the is anything special that you have to put in your class.
__________________
~evlich |
|
#5
|
|||
|
|||
|
Dragging Components from Projects Explorer
This is a small, but very useful feature. If you have developed a component, you can drag it directly from the Projects explorer and drop it onto a form. (Note the component must be compiled.) You don't need to package and install the component to palette if you don't plan to use it often or in more projects. For more info check: http://form.netbeans.org/updates/update55.html#dragging Kamesh |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make a floating tool palette | Wesley Long | VB Classic | 2 | 10-18-2002 01:35 PM |
| Swing is dead, long live SWT | Darren Bell | Talk to the Editors | 2 | 09-20-2002 11:32 AM |
| Swing: If it looks like a dog and walks like a dog, "Bark" | JB | Talk to the Editors | 3 | 09-16-2002 09:15 PM |
| Using Swing with JSP | Shaun Botha | Java | 5 | 06-25-2001 10:19 PM |
| VisualCafe3Pro and Swing 1.1.1? | Fabio Luis De Paoli | Java | 0 | 08-17-2000 02:06 PM |