title: mouseListener only recognize JLabel
body: <p>I added a mouseListener on a JPanel which contains several components.
  To test the mouseListener I only setBorder of the Jpanel when entering and exit the jpanel.
  The problem is, it only recognizes the mouse event on the jlabels of the jpanel, not on other components or the main jpanel itself. Can't figure out why...</p>
  
  <p>here's the code :</p>
  
  <pre><code>     import javax.swing.JFrame;
  
  
  public class compte2 extends javax.swing.JPanel {
  
  
      public compte2() {
          initComponents();
      }
  
  
      @SuppressWarnings("unchecked")
      // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;                          
      private void initComponents() {
  
          jPanel1 = new javax.swing.JPanel();
          jLabel1 = new javax.swing.JLabel();
          jLabel3 = new javax.swing.JLabel();
          jButton2 = new javax.swing.JButton();
          jPanel2 = new javax.swing.JPanel();
          jLabel4 = new javax.swing.JLabel();
          jLabel6 = new javax.swing.JLabel();
          jButton1 = new javax.swing.JButton();
          jScrollPane1 = new javax.swing.JScrollPane();
  
          setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
          setPreferredSize(new java.awt.Dimension(240, 160));
          addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseEntered(java.awt.event.MouseEvent evt) {
                  formMouseEntered(evt);
              }
              public void mouseExited(java.awt.event.MouseEvent evt) {
                  formMouseExited(evt);
              }
          });
          setLayout(new java.awt.BorderLayout());
  
          jPanel1.setMinimumSize(new java.awt.Dimension(100, 56));
          jPanel1.setPreferredSize(new java.awt.Dimension(400, 56));
          jPanel1.setLayout(new java.awt.BorderLayout());
  
          jLabel1.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
          jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
          jLabel1.setText("CLUB");
          jLabel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
          jLabel1.setPreferredSize(new java.awt.Dimension(240, 28));
          jPanel1.add(jLabel1, java.awt.BorderLayout.PAGE_START);
  
          jLabel3.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
          jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
          jLabel3.setText("ILLIMITE");
          jLabel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
          jLabel3.setPreferredSize(new java.awt.Dimension(190, 28));
          jPanel1.add(jLabel3, java.awt.BorderLayout.CENTER);
  
          jButton2.setIcon(new javax.swing.ImageIcon("C:\\Users\\pc\\Downloads\\icon\\Pics\\see.png")); // NOI18N
          jButton2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
          jButton2.setMinimumSize(new java.awt.Dimension(28, 28));
          jButton2.setPreferredSize(new java.awt.Dimension(28, 28));
          jPanel1.add(jButton2, java.awt.BorderLayout.LINE_END);
  
          add(jPanel1, java.awt.BorderLayout.PAGE_START);
  
          jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
          jPanel2.setMinimumSize(new java.awt.Dimension(100, 28));
          jPanel2.setPreferredSize(new java.awt.Dimension(400, 28));
          jPanel2.setLayout(new java.awt.BorderLayout());
  
          jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
          jLabel4.setText("€");
          jLabel4.setPreferredSize(new java.awt.Dimension(15, 28));
          jPanel2.add(jLabel4, java.awt.BorderLayout.LINE_END);
  
          jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
          jLabel6.setText("0,00");
          jLabel6.setMaximumSize(new java.awt.Dimension(50, 28));
          jLabel6.setPreferredSize(new java.awt.Dimension(50, 28));
          jPanel2.add(jLabel6, java.awt.BorderLayout.CENTER);
  
          jButton1.setText("ENCAISSER");
          jButton1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
          jButton1.setMinimumSize(new java.awt.Dimension(80, 28));
          jButton1.setPreferredSize(new java.awt.Dimension(80, 28));
          jPanel2.add(jButton1, java.awt.BorderLayout.LINE_START);
  
          add(jPanel2, java.awt.BorderLayout.PAGE_END);
          add(jScrollPane1, java.awt.BorderLayout.CENTER);
      }// &lt;/editor-fold&gt;                        
  
      private void formMouseEntered(java.awt.event.MouseEvent evt) {                                  
          compte2 mc = (compte2)evt.getSource();
      mc.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(204, 0, 0), 4));
      }                                 
  
      private void formMouseExited(java.awt.event.MouseEvent evt) {                                 
         compte2 mc = (compte2)evt.getSource();
      mc.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
      }                                
  
  
      // Variables declaration - do not modify                     
      private javax.swing.JButton jButton1;
      private javax.swing.JButton jButton2;
      private javax.swing.JLabel jLabel1;
      private javax.swing.JLabel jLabel3;
      private javax.swing.JLabel jLabel4;
      private javax.swing.JLabel jLabel6;
      private javax.swing.JPanel jPanel1;
      private javax.swing.JPanel jPanel2;
      private javax.swing.JScrollPane jScrollPane1;
      // End of variables declaration                   
  
  
  
      public static void main(String[] args) {
  
          JFrame j = new JFrame();
          compte2 mc = new compte2();
          j.add(mc);
          j.pack();
          j.setVisible(true);
  }
  
  }
  </code></pre>