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

Solaris only: applet backgrounds are not properly set when going back and forwar

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b01
    • CPU:
      generic, x86, sparc
    • OS:
      solaris_2.4, solaris_2.5.1, solaris_2.6, solaris_9, windows_95

      Description

        Applets which set their background do not have that background
      color properly restored when going back to the page containing
      that applet.

      I have attached a simple test case. The GrayBgApplet simply
      calls setBackground(Color.gray) in its init() method.
      The appletbg.html page sets the page background to a lighter gray
      and creates the GrayBgApplet with its darker gray.

      To reproduce, start in the directory containing the test.
      Open appletbg.html, the colors of the page and applet are correct.
      Click on the back arrow toolbar button to go back and then
      click on the forward arrow to go to the appletbg.html page,
      the applet background is incorrect - it is the same gray as the
      page background when it should be a darker gray.
      Now click reload and the page and applet backgrounds will be correct.

      This is easily reproducible on the following combinations of
      HotJava and JDK (sparc, solaris):

         HotJava 1.0LAR JDK1.0.K
         HotJava 1.0beta JDK1.1_Final
         HotJava 1.0j JDK1.1.1A

      It's also reproducible with a build from the latest HotJava
      workspace (02/27/97) on JDK1.1.1B.

      Steve Byrne suggested that this may be an AWT bug. One thing to
      consider is that this reproducible with JDK1.0.k as well as JDK1.1
      which leads me to think that its a hotjava bug. That or this bug
      has been in the JDK for quite awhile.



      erik.larsen@Eng 1998-04-14
      This is no longer reproducible. Tested JDK1.1.6 and JDK1.1.7 with hotjava 1.1.3
      -----
      andy.herrick@East 1998-06-12
      This is easyily reproducable, regression test follows:
       
      import java.awt.*;

      class T4035722 extends Frame {
        Panel p1, p2;

        public T4035722 (String s) {
          super(s);

          p1 = new Panel();
          p2 = new Panel();
          p1.setBackground(Color.magenta);
          p2.setBackground(Color.magenta);

          setLayout( new BorderLayout() );
          add("North", p1);
          add("South", p2);

          Label l1 = new Label("Big Green Text on Yellow Background");
          p1.add(l1);
          l1.setForeground(new Color(0,0xff,0));
          l1.setFont(new Font("Helvetica", 0, 30));
          l1.setBackground(Color.yellow);

          Label l2 = new Label("Big Green Text on Yellow Background");
          p2.add(l2);
          l2.setForeground(new Color(0,0xff,0));
          l2.setFont(new Font("Helvetica", 0, 30));
          l2.setBackground(Color.yellow);

        }

        public void paint(Graphics g)
        {
          p2.setForeground(new Color(0,0,0xff));
          p2.setFont(new Font("Helvetica", 0, 10));
          p2.setBackground(Color.magenta);
          super.paint(g);
        }

        public static void main(String argv[])
        {
         T4035722 f = new T4035722("are panels the same ?");
         if ( argv.length == 0 ) {
              f.pack();
         }

         MenuBar mb = new MenuBar();
         f.setMenuBar(mb);
         f.setLocation(200,300);
         f.setSize(new Dimension(600,600));

         mb.add(new Menu("File"));
         mb.add(new Menu("Edit"));
         mb.add(new Menu("View"));

         f.setVisible(true);

        }

      }

      -------

      Verified that this test case causes the background color failure.
      erik.larsen@Eng 1998-06-15
      sandy.labrasca@eng 1999-01-12
      See more info...
      Add DMT in the program mangement. field.

        Attachments

          Activity

            People

            Assignee:
            elarsen Erik Larsen (Inactive)
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: