title: BindingGroup issue in java NetBeans 7.0
body: <p>I created a package named <code>placementrecord</code> in netbeans 7.0. Under this package I created few forms among which one is not running due to some bindingGroup problem. I don't have any clue about this bindingGroup, so I am not able to sort out the error, neither I got an appropriate answer anywhere else.<br /><br />
  Here is the code of that form named "Login" below <strong>Login.java</strong> :</p>
  
  <pre><code>public class Login extends javax.swing.JFrame {
  
      /**
       * Creates new form Login
       */
      public Login() {
          super("Placement Management System");
          initComponents();
      }
  
      /**
       * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the Form
       * Editor.
       */
      @SuppressWarnings("unchecked")
      // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;
      private void initComponents() {
          bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
  
          jTextField1 = new javax.swing.JTextField();
          jLabel1 = new javax.swing.JLabel();
          jLabel2 = new javax.swing.JLabel();
          jButton1 = new javax.swing.JButton();
          jPasswordField1 = new javax.swing.JPasswordField();
          jLabel3 = new javax.swing.JLabel();
          jButton2 = new javax.swing.JButton();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          setResizable(false);
          getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
  
          jTextField1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jTextField1ActionPerformed(evt);
              }
          });
          getContentPane().add(jTextField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 10, 140, -1));
  
          jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14));
          jLabel1.setForeground(new java.awt.Color(0, 0, 153));
          jLabel1.setText("STUDENTID:");
  
          org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, jLabel1, org.jdesktop.beansbinding.ObjectProperty.create(), jLabel1, org.jdesktop.beansbinding.BeanProperty.create("background"));
          bindingGroup.addBinding(binding);
  
          getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 10, 90, 20));
  
          jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 14));
          jLabel2.setForeground(new java.awt.Color(0, 0, 153));
          jLabel2.setText("PASSWORD:");
          getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 40, 90, 20));
  
          jButton1.setForeground(new java.awt.Color(0, 0, 153));
          jButton1.setText("LOGIN");
          jButton1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
          getContentPane().add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 170, 80, 30));
  
          jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  jPasswordField1ActionPerformed(evt);
              }
          });
          getContentPane().add(jPasswordField1, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 40, 140, -1));
  
          jLabel3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/new_login.jpg"))); // NOI18N
          jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
          getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 410, 300));
  
          jButton2.setBackground(new java.awt.Color(255, 255, 255));
          jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/homricon9.jpg"))); // NOI18N
          jButton2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 153, 0)));
          getContentPane().add(jButton2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 253, 40, 40));
  
          bindingGroup.bind();
  
          pack();
      }// &lt;/editor-fold&gt;
  
      private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {
          // TODO add your handling code here:
      }
  
      private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
          // TODO add your handling code here:
      }
  
      /**
       * @param args the command line arguments
       */
      public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new Login().setVisible(true);
              }
          });
      }
      // Variables declaration - do not modify
      private javax.swing.JButton jButton1;
      private javax.swing.JButton jButton2;
      private javax.swing.JLabel jLabel1;
      private javax.swing.JLabel jLabel2;
      private javax.swing.JLabel jLabel3;
      private javax.swing.JPasswordField jPasswordField1;
      private javax.swing.JTextField jTextField1;
      private org.jdesktop.beansbinding.BindingGroup bindingGroup;
      // End of variables declaration
  }
  </code></pre>
  
  <p><strong>Errors on Running</strong> this code are below :<br></p>
  
  <pre><code>run:
  Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
      at java.lang.Class.cast(Class.java:2990)
      at org.jdesktop.beansbinding.Binding.convertForward(Binding.java:1312)
      at org.jdesktop.beansbinding.Binding.getSourceValueForTarget(Binding.java:844)
      at org.jdesktop.beansbinding.Binding.refreshUnmanaged(Binding.java:1222)
      at org.jdesktop.beansbinding.Binding.refresh(Binding.java:1207)
      at org.jdesktop.beansbinding.AutoBinding.tryRefreshThenSave(AutoBinding.java:162)
      at org.jdesktop.beansbinding.AutoBinding.bindImpl(AutoBinding.java:199)
      at org.jdesktop.beansbinding.Binding.bindUnmanaged(Binding.java:959)
      at org.jdesktop.beansbinding.Binding.bind(Binding.java:944)
      at org.jdesktop.beansbinding.BindingGroup.bind(BindingGroup.java:143)
      at Login.initComponents(Login.java:87)
      at Login.&lt;init&gt;(Login.java:20)
      at Login$3.run(Login.java:107)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
  BUILD SUCCESSFUL (total time: 5 seconds)
  </code></pre>