Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6529277

Metal L&F: Blue line appears when JLabel in focus

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0"
      Java(TM) SE Runtime Environment (build 1.6.0-b105)
      Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 2003 or Windows Vista

      A DESCRIPTION OF THE PROBLEM :

      When you use Metal Look&Feel, there is a small blue vertical line between the label and the checkbox with the focus.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Design a JPanel with several JCheckBoxes in a vertical group with NetBeans 5.5. Use JDK 6.0 and System Look&Feel.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Checkboxes should be aligned properly.
      ACTUAL -
      Some Checkboxes are not aligned correctly.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class CheckmarkPanel extends javax.swing.JPanel {
        public static void main(String[] args) throws Exception {
          UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
          JFrame frame = new JFrame();
          frame.add(new CheckmarkPanel());
          frame.pack();
          frame.setVisible(true);
        }
        
        /** Creates new form CheckmarkPanel */
        public CheckmarkPanel() {
          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.
         */
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">
        private void initComponents() {
          jCheckBox1 = new javax.swing.JCheckBox();
          jCheckBox2 = new javax.swing.JCheckBox();
          jCheckBox3 = new javax.swing.JCheckBox();
          jCheckBox4 = new javax.swing.JCheckBox();
          jCheckBox5 = new javax.swing.JCheckBox();

          jCheckBox1.setText("Fertigung:");
          jCheckBox1.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
          jCheckBox1.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
          jCheckBox1.setMargin(new java.awt.Insets(0, 0, 0, 0));

          jCheckBox2.setText("Einkauf:");
          jCheckBox2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
          jCheckBox2.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
          jCheckBox2.setMargin(new java.awt.Insets(0, 0, 0, 0));

          jCheckBox3.setText("Verkauf:");
          jCheckBox3.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
          jCheckBox3.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
          jCheckBox3.setMargin(new java.awt.Insets(0, 0, 0, 0));

          jCheckBox4.setText("Ersatzteil:");
          jCheckBox4.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
          jCheckBox4.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
          jCheckBox4.setMargin(new java.awt.Insets(0, 0, 0, 0));

          jCheckBox5.setText("Packmittel:");
          jCheckBox5.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
          jCheckBox5.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
          jCheckBox5.setMargin(new java.awt.Insets(0, 0, 0, 0));

          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
          this.setLayout(layout);
          layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
              .addGap(97, 97, 97)
              .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                .addComponent(jCheckBox5)
                .addComponent(jCheckBox2)
                .addComponent(jCheckBox1)
                .addComponent(jCheckBox3)
                .addComponent(jCheckBox4))
              .addContainerGap(234, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
              .addContainerGap()
              .addComponent(jCheckBox1)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jCheckBox2)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jCheckBox3)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jCheckBox4)
              .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
              .addComponent(jCheckBox5)
              .addContainerGap(190, Short.MAX_VALUE))
          );
        }// </editor-fold>
        
        
        // Variables declaration - do not modify
        private javax.swing.JCheckBox jCheckBox1;
        private javax.swing.JCheckBox jCheckBox2;
        private javax.swing.JCheckBox jCheckBox3;
        private javax.swing.JCheckBox jCheckBox4;
        private javax.swing.JCheckBox jCheckBox5;
        // End of variables declaration
        
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Do not use System Look&Feel or do not use LEADING Checkbox labels.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ryeung Roger Yeung (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Imported:
                Indexed: