DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005

    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. #2
    Join Date
    Aug 2003
    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?

  3. #3
    Join Date
    Nov 2005
    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. #4
    Join Date
    Aug 2003
    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.

  5. #5
    Join Date
    Oct 2009
    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


Similar Threads

  1. How to make a floating tool palette
    By Wesley Long in forum VB Classic
    Replies: 2
    Last Post: 10-18-2002, 12:35 PM
  2. Swing is dead, long live SWT
    By Darren Bell in forum Talk to the Editors
    Replies: 2
    Last Post: 09-20-2002, 10:32 AM
  3. Replies: 3
    Last Post: 09-16-2002, 08:15 PM
  4. Using Swing with JSP
    By Shaun Botha in forum Java
    Replies: 5
    Last Post: 06-25-2001, 09:19 PM
  5. VisualCafe3Pro and Swing 1.1.1?
    By Fabio Luis De Paoli in forum Java
    Replies: 0
    Last Post: 08-17-2000, 01:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.