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

PIT: On GTK LAF, the 'Up' button is not removed by LayoutManager.removeLayoutComponent()

XMLWordPrintable

    • b15
    • generic
    • generic
    • Verified

      Partial fix 6514599.

      Run the test code. You can see the only 'Up' button on Spinner. That's the bug.

      import java.awt.*;
      import javax.swing.*;

      public class JSpinnerBug2
      {
          public static void main(String[] args)
          {
              try {
                  UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
              }catch(Exception e){
                  e.printStackTrace();
              };
              // create a JSpinner and set a value
              JSpinner spinner = new JSpinner();
              spinner.setValue(new Integer(1234567890));
              
              // get the arrow buttons
              Component arrowUp = spinner.getComponent(0);
              Component arrowDown = spinner.getComponent(1);
              
              // try remove both buttons from the layout
              LayoutManager layout = spinner.getLayout();
              layout.removeLayoutComponent(arrowUp);
              layout.removeLayoutComponent(arrowDown);
              
              // create a frame and add the spinner spinner
              JFrame frame = new JFrame("Only the arrow down is missing");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Container pane = frame.getContentPane();
              pane.setLayout(new FlowLayout());
              pane.add(spinner);
              
              // show the frame
              frame.setBounds(0, 0, 300, 150);
              frame.setVisible(true);
          }
      }
      DELETED BOGUS ENTRY.

            shickeysunw Shannon Hickey (Inactive)
            esubramasunw Elancheran Subramanian (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: