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

REGRESSION:Frame is missing coffee-cup icon

XMLWordPrintable

    • b51
    • x86
    • windows_2000, windows_2003, windows_xp
    • Verified

      Run the following test on Windows with 1.5.0 b48 and b49:
      import java.awt.*;

      class test {
          
          public static void main(String[] args) {
      Frame f = new Frame("this is a test");
      f.setSize(new Dimension(200,200));

      f.show();
          }
      }

      Notice that in b48 frame has coffee-cup icon, while in b49 it doesn't have it.
      Reproduced on Windows XP
      ###@###.### 2004-04-30

      Same problem reported by a CAP member:

      J2SE Version (please include all output from java -version flag):
        java version "1.5.0-beta2"
        Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta2-b50)
        Java HotSpot(TM) Client VM (build 1.5.0-beta2-b50, mixed mode, sharing)

      Does this problem occur on J2SE 1.3.x or 1.4.x? Yes / No (pick one)
        No, works fine with build48

      Operating System Configuration Information (be specific):
        WinXP SP1

      Hardware Configuration Information (be specific):
        IBM Thinkpad T30, 512M RAM, 2GHz Intel P4m

      Bug Description:
        CheckboxMenuItem does not show the "check" in the menu.

      Steps to Reproduce (be specific):
        Compile and run the following class. Item #2 in the menu is a
        CheckboxMenuItem. By default it should show as "checked". It does not.
        Selecting it from the menu has no effect. Our application worked fine
        with either build 4x (46 or 48?).

      ----------------------------------------------------------------------

      package test;

      import java.awt.*;
      import java.awt.event.*;

      /**
        *
        */
      public class Test extends Frame
           {
           public Test() throws HeadlessException
               {
               MenuBar menu_bar = new MenuBar();
               Menu menu = new Menu("Menu");
               menu_bar.add(menu);
               MenuItem item1 = new MenuItem("item #1");
               menu.add(item1);
               CheckboxMenuItem item2 = new CheckboxMenuItem("item #2");
               item2.setState(true);
               menu.add(item2);
               MenuItem item3 = new MenuItem("item #3");
               menu.add(item3);
               setMenuBar(menu_bar);

               setLayout(new BorderLayout());
               add(new Button("top"), BorderLayout.NORTH);
               add(new Button("bottom"), BorderLayout.SOUTH);
               add(new Button("left"), BorderLayout.WEST);
               add(new Button("right"), BorderLayout.EAST);
               add(new MyCanvas(), BorderLayout.CENTER);
               }

           public static void main(String[] args)
               {
               Frame f = new Test();
               f.setSize(400, 300);
               f.setVisible(true);

               f.addWindowListener(new WindowListener()
                   {
                   public void windowClosed(WindowEvent e) {}
                   public void windowOpened(WindowEvent e) {}
                   public void windowClosing(WindowEvent e)
                       {
                       System.exit(0);
                       }
                   public void windowIconified(WindowEvent e) {}
                   public void windowDeiconified(WindowEvent e) {}
                   public void windowActivated(WindowEvent e) {}
                   public void windowDeactivated(WindowEvent e) {}
                   });
               }

           }

      class MyCanvas extends Canvas
           {
           public void paint(Graphics g)
               {
               super.paint(g);

               Dimension d = getSize();
               g.setColor(Color.red);
               g.drawLine(0, 0, d.width-1, d.height-1);
               g.drawLine(0, d.height-1, d.width-1, 0);
               g.setColor(Color.black);
               }
           }

            vjayaramsunw Vijayan Jayaraman (Inactive)
            domsunw Dom Dom (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: