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

JOptionPane.showOptionDialog is painting "message" object twice

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.1, 1.2.0
    • Fix Version/s: 1.0.2
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      1.0.2
    • CPU:
      generic, sparc
    • OS:
      solaris_2.6, solaris_9, solaris_10

      Description

      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
      ();
         }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              amfowler Anne Fowler (Inactive)
              Reporter:
              amfowler Anne Fowler (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: