Netbeans: Add custom classes to the palette

Hi,
I have a created number of custom classes, such class add_button extends JButton, etc...
How I can add them to the palette for future visual use.
Thanks
Omer-PitouAsked:
Who is Participating?
 
CEHJCommented:
0
 
Omer-PitouAuthor Commented:
Thank you very much
0
 
CEHJCommented:
:)
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
Omer-PitouAuthor Commented:
This helped and I managed to add it .
I have a question: I want to know what is the right way of creating custom.
1. Previously, I had one class (one .java file) as follows

public class CustomClasses {

    public static class LabelC extends JLabel {
        public LabelC() {
            setText("HelloWord");
        }
    }
    
    public static class TextFieldC extends JTextField {
        public TextFieldC() {
        
        }        
    }
    
    public static class TextFieldDisableC extends JTextField {
        public TextFieldDisableC() {
            enable(false);
        }       
    }
    
    public static class TableC extends JTable {
        public TableC() {
        
        }    
    }
}

Open in new window

With this one, From the palette, I can only see CustomClasses, NOT the individual custom classes.
2. I tried to create an individual .java file for the custom class, and I can see it in the palette.
public class CustomLabel extends JLabel {
    public CustomLabel() {
            setText("HelloWord");
        }    
}  

Open in new window


My question is: Should I create individual .java file per custom class. If I want to keep them in one .java file, how can I make them visible in the palette.

Regards.
0
 
CEHJCommented:
Should I create individual .java file per custom class.
Most definitely
0
 
Omer-PitouAuthor Commented:
Thanks for your prompt reply
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.