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

Setting Dtwm*positionIsFrame: False causes problems with Swing Menus

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.2.2
    • client-libs
    • None
    • beta
    • generic
    • generic


      daniel.indrigo@canada 2000-04-20

      When using CDE, if "Dtwm*positionIsFrame: False" is set in file
      /usr/dt/app-defaults/C/Dtwm then Swing menus in the following program do
      not work properly with either Java 1.2.2 or Java 1.3. The problem is
      that when clicking on the menu, the list of menu items does not expand
      properly. Pleasenote that the problem goes away if you either resize or
      move the frame.

      Here is the program:

        import javax.swing.*;

        public class SwingTarget extends JFrame
        {
          public SwingTarget() {
              setTitle("Swing Menus");
              JMenuBar mb = new JMenuBar();
              this.setJMenuBar(mb);

              JMenu m = new JMenu("Menu 1");
              m.add(new JMenuItem("Item 1-1"));
              m.add(new JMenuItem("Item 1-2"));
              m.add(new JMenuItem("Item 1-3"));
              mb.add(m);

              JMenu m2 = new JMenu("Menu 2");
              m2.add(new JMenuItem("Item 2-1"));
              m2.add(new JMenuItem("Item 2-2"));
              m2.add(new JMenuItem("Item 2-3"));
              mb.add(m2);

              this.setBounds(100, 100, 200, 200);
              this.setVisible(true);
          }

          public static void main (String[] args) {
              new SwingTarget();
          }
        }


      A similiar program using AWT, instead of Swing, works properly.

      ============================================================================

            mdavidsosunw Mark Davidson (Inactive)
            dindrigo Daniel Indrigo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: