Hi guys,
I've a strange issue.
I found some solutions on google and on this forum, but they doesn't work for me.
I've a javafx application in netbeans in which I also use swing controls.
I created a custom jlabel control
public class Label extends JLabel {
public Label()
{
}
private void setAspect(String csFontName, int nSizeFont, boolean bold,Color cColor)
{
int style=bold ? Font.BOLD : Font.PLAIN;
this.setFont(new Font(csFontName,style,nSizeFont));
this.setForeground(cColor);
}
public Label(String csText)
{
super(csText);
setAspect("Tahoma",10,false,Color.black);
}
public Label(String csText, int nSize)
{
super(csText);
setAspect("Tahoma",nSize,false,Color.black);
}
public Label(String csText, int nSize, boolean bold)
{
super(csText);
setAspect("Tahoma",10,bold,Color.black);
}
public Label(String csText, int nSize, boolean bold, Color cColor)
{
super(csText);
setAspect("Tahoma",10,bold,Color.black);
}
}
I selected Label.java file in the project and I click on Tools->add to palette and I selected Swing controls as family.
I restarted netbeans and I found it in the palette.
I try to drag it into my swing form and I've :
Cannot load component class <ProjectName>.Label from project: D:\Progetti\<ProjectName>.
The class must be compiled and must be on the classpath of the project to which this form belongs.
Following forums I went on netbeans log
org.openide.ErrorManager$AnnException: msg
at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:870)
at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
....
....
Caused by: java.lang.ClassNotFoundException: <ProjectName>.Label
at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:178)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:98)
at org.netbeans.modules.form.MetaComponentCreator.prepareClass0(MetaComponentCreator.java:1322)
... 34 more
msg
Cannot load component class ortholab2.Label from project: D:\Progetti\<ProjectName>.
The class must be compiled and must be on the classpath of the project to which this form belongs.
I hope someone can help me ,
Thanks