-
Bug
-
Resolution: Fixed
-
P3
-
1.1, 1.2.0
-
None
-
1.0.2
-
generic, sparc
-
solaris_2.6, solaris_9, solaris_10
The following program shows the "pane" parameter passed into
JOptionPane.showOptionDialog is being painted twice!
import java.awt.*;
import com.sun.java.swing.*;
public class PaintTest extends JFrame
{
public PaintTest()
{
JPanel pane = new JPanel(new BorderLayout());
JPanel titlePanel = new JPanel(new BorderLayout());
titlePanel.add(new JLabel("Title"), "Center");
pane.add(titlePanel, "North");
JScrollPane scrollFilterPane =
new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollFilterPane.setAlignmentX(JScrollPane.LEFT_ALIGNMENT);
scrollFilterPane.setAlignmentY(JScrollPane.TOP_ALIGNMENT);
JViewport vp = scrollFilterPane.getViewport();
vp.add(new JPanel());
pane.add(scrollFilterPane, "Center");
JOptionPane.showOptionDialog(this, pane, "Title",
JOptionPane.DEFAULT_OPTION,
JOptionPane.PLAIN_MESSAGE, null,
new Object[] {new JPanel()},
null);
}
public static void main(String[] argv)
{
PaintTest dlg = new PaintTest
();
}
}
JOptionPane.showOptionDialog is being painted twice!
import java.awt.*;
import com.sun.java.swing.*;
public class PaintTest extends JFrame
{
public PaintTest()
{
JPanel pane = new JPanel(new BorderLayout());
JPanel titlePanel = new JPanel(new BorderLayout());
titlePanel.add(new JLabel("Title"), "Center");
pane.add(titlePanel, "North");
JScrollPane scrollFilterPane =
new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollFilterPane.setAlignmentX(JScrollPane.LEFT_ALIGNMENT);
scrollFilterPane.setAlignmentY(JScrollPane.TOP_ALIGNMENT);
JViewport vp = scrollFilterPane.getViewport();
vp.add(new JPanel());
pane.add(scrollFilterPane, "Center");
JOptionPane.showOptionDialog(this, pane, "Title",
JOptionPane.DEFAULT_OPTION,
JOptionPane.PLAIN_MESSAGE, null,
new Object[] {new JPanel()},
null);
}
public static void main(String[] argv)
{
PaintTest dlg = new PaintTest
();
}
}
- duplicates
-
JDK-4109899 JOptionPane-passing Component as param 'message' doesn't show Component properly
-
- Closed
-