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

labels, backgrd colors don't appear till first repaint (null layout) 1.1.x/win32

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_95, windows_nt

      Description

      orig synopsis: "bugs displayng label and background"

      Name: rm29839 Date: 11/25/97


      This bug happens only on win95. It is not shown on NT or Solaris

      The following applet doesn't visualize label and
      background color when appears.
      I have tried this applet with appletviewer 1.1.4 and
      with hotjava browser and the behaviour is the
      same: when the applet is loaded doesn't visualize
      labels and background colors, if I icony and deicony
      (if the paint() method is called) the applet is
      display in a right way. The same behaviour if the
      applet window is obscured with another window.


      Let me know...

      bye
          antonio



      HTML source:
      <html>
      <head>
      <title>prova</title>
      </head>
      <body bgcolor="#f4f4ff" link="#cc0000" alink="#ff3300" vlink="#005522"><center>
      <table width=500><tr><td valign=top><font face="helvetica,arial,swiss">
      <h1>Prova</h1>
      </td></tr></table>

      <table width=500><tr><td valign=top>
      <applet code="Bug.class" width=550 height=400>
      </applet>
      </table>
      </blockquote>
      </center></body>
      </html>


      JAVA source:
      import java.applet.*;
      import java.awt.*;

      public class Bug extends Applet implements Runnable{
      Thread bugThread = null;
      Graph graphObj;

      private void handleException(Throwable exception) {
      }

      public void init() {
      super.init();
      try {
      setLayout(null);
      setSize(550, 400);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      }


      public void run ( ) {
      graphObj = new Graph();
      add(graphObj);
      return;
      }

      public void start ( ) {
      if (bugThread == null){
      bugThread = new Thread(this);
      bugThread.start();
      }
      }

      public void stop ( ) {
      bugThread = null;
      }
      }


      /*************************************************************************/
      /* Graph Class */
      /*************************************************************************/
      class Graph extends java.awt.Panel {
      private java.awt.Label ivjLabel1 = null;
      private java.awt.Label ivjLabel2 = null;
      private java.awt.TextField ivjTextField1 = null;


      public Graph() {
      super();
      initialize();
      }


      public Graph(java.awt.LayoutManager layout) {
      super(layout);
      }

      /**
       * Return the Label1 property value.
       * @return java.awt.Label
       */

      private java.awt.Label getLabel1() {
      if (ivjLabel1 == null) {
      try {
      ivjLabel1 = new java.awt.Label();
      ivjLabel1.setName("Label1");
      ivjLabel1.setText("Antonio");
      ivjLabel1.setBounds(32, 84, 125, 30);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjLabel1;
      }

      /**
       * Return the Label2 property value.
       * @return java.awt.Label
       */
      private java.awt.Label getLabel2() {
      if (ivjLabel2 == null) {
      try {
      ivjLabel2 = new java.awt.Label();
      ivjLabel2.setName("Label2");
      ivjLabel2.setText("DO YOU SEE THIS LABEL");
      ivjLabel2.setBounds(83, 24, 217, 33);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjLabel2;
      }

      /**
       * Return the TextField1 property value.
       * @return java.awt.TextField
       */
      private java.awt.TextField getTextField1() {
      if (ivjTextField1 == null) {
      try {
      ivjTextField1 = new java.awt.TextField();
      ivjTextField1.setName("TextField1");
      ivjTextField1.setBounds(186, 86, 125, 30);
      } catch (java.lang.Throwable ivjExc) {
      handleException(ivjExc);
      }
      };
      return ivjTextField1;
      }

      /**
       * Called whenever the part throws an exception.
       * @param exception java.lang.Throwable
       */
      private void handleException(Throwable exception) {
      }

      /**
       * Initialize class
       */
      private void initialize() {
      setName("Graph");
      setName("Graph");
      setLayout(null);
      setBackground(java.awt.Color.orange);
      setSize(426, 240);
      add(getLabel1(), getLabel1().getName());
      add(getTextField1(), getTextField1().getName());
      add(getLabel2(), getLabel2().getName());
      }


      }
      (Review ID: 20597)
      ======================================================================

        Attachments

          Activity

            People

            • Assignee:
              rraysunw Richard Ray (Inactive)
              Reporter:
              rmandelsunw Ronan Mandel (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: