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

Popup menu colours inconsistent (1.1.x ONLY)

    Details

    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.5.1, solaris_2.6

      Description



      Name: mf23781 Date: 01/08/98


      Popup menus Inherit their background colours but not their
      foreground colours from their parent. This can lead to some
      unreadable colour combinations.
      They should either ignore the parents colours like ordinary
      menus appear to do or inherit both foreground and background.
      The following example shows this porblem
      import java.awt.*;
      import java.awt.event.*;
      public class Test extends Frame
      {
        PopupMenu popup;
        Canvas c;
        public Test () {
          c = new Canvas();
          c.setForeground(Color.blue);
          c.setBackground(Color.white);
          add(c);
          String[] names = new String[] {"item1", "item2", "item3"};
          popup = new PopupMenu("title");
          for (int i = 0; i < names.length; i++){
              MenuItem mi = new MenuItem (names[i]);
              popup.add(mi);
          }
          c.add(popup);
          c.addMouseListener(new MouseAdapter(){
            public void mouseClicked(MouseEvent e){
                popup.show(c, e.getX(), e.getY());
                Graphics g = c.getGraphics();
                g.drawLine(5,5,100,100);
            }
          });
          setSize(200, 100);
          show();
        }
        public static void main (String args[])
        {
          Test t = new Test ();
        }
      }

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                miflemi Mick Fleming (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: