Newbie getting: component cannot be instantiated make sure it is a JavaBean
I've been doing the JavaBeans Trail. Didn't get far.
Created MyBean.java (included at the end) and added it to the palette. When I try to drop it on a JFrame, I get:
"The component cannot be instantiated.
Please make sure it is a JavaBean."
What must I do to make sure it's a JavaBean?
(I made sure the project was compiled before trying to drop it on.)
TIA,
Mike
Using:
Sun Java(TM) Studio Enterprise 8.1 (Build 2006.12.01)
Windows XP version 5.1 running on x86
Java 1.5.0_09
==========<->==========
/*
* MyBean.java
*
* Created on April 20, 2007, 12:59 PM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
/**
*
* @author MFidler
*/
publicclass MyBean{
/** Creates a new instance of MyBean */
public MyBean(){
}
/**
* Holds value of property yourName.
*/
private String yourName;
/**
* Getter for property yourName.
* @return Value of property yourName.
*/
public String getYourName(){
return this.yourName;
}
/**
* Setter for property yourName.
* @param yourName New value of property yourName.
*/
publicvoid setYourName(String yourName){
this.yourName = yourName;
}
}

