-
Bug
-
Resolution: Fixed
-
P3
-
7
-
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.
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.
- relates to
-
JDK-6514599 JSpinner default layout manager does not allow removing "Next" button
- Closed