Hi all, i have a simple JPanel bean in my projects, now i want to drag my panel bean class into my jframe.
My panel bean class is like this:
public class BeanPanel extends javax.swing.JPanel {
/** Creates new form BeanPanel */
public BeanPanel () {
initComponents();
Session session=HibernateUtil.getSessionFactory().openSession();
}
This code seem to break the bean:
Session session=HibernateUtil.getSessionFactory().openSession();
When i try to drag the class into my JFrame bean i had this error message:
This component cannot be instantiated. Please make sure it is a JavaBeans Component
If i comment it all works fine. What is the reason of this?
Thanks.