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

Motif version of JOptionPane has layout problems with button row

XMLWordPrintable

    • beta
    • generic, sparc
    • generic, solaris_2.6



      Name: dbT83986 Date: 01/12/99


      The Motif versions of the standard JOptionPane dialogs are not using
      enough horizontal padding around the button row. This is easily
      seen when comparing a JOptionPane message dialog with a native
      message dialog running under the CDE window manager.

      When using a showConfirmDialog you can see that the default border
      ring is almost touching(~3 pixels away) the window manager frame.
      The same button configuration for a native CDE dialog has about
      a 13 pixel gap.

      Please spend a little time looking at the layout distances, both
      horizontal and vertical, used in the CDE message dialogs to find
      out how you should be doing the same to the standard dialogs.

      Here's the code you can use to easily bring up a Motif version
      of the showConfirmDialog:

      //~~~~~~~~~~~~~~~~~~~~~~ cut here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      class msgbox extends JFrame {

          public static void main (String args[]) {
              try {
                  UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
              } catch (Exception e) {e.printStackTrace();}
              String msg = "Are you really sure you want to do that?";
              JOptionPane.showConfirmDialog(new msgbox(), msg, "Confirm", JOptionPane.YES_NO_OPTION);
              System.exit(0);
          }
      }
      (Review ID: 52504)
      ======================================================================

            amfowler Anne Fowler (Inactive)
            dblairsunw Dave Blair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: