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

In JLabel, etc., setText does not update properly with HTML object tag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 6
    • 1.4.0
    • client-libs
    • beta
    • x86
    • linux



      Name: jk109818 Date: 01/06/2003


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      java version "1.4.1_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
      Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

      FULL OPERATING SYSTEM VERSION :

      RH Linux 7.2


      A DESCRIPTION OF THE PROBLEM :
      In component JLabel, etc. if setText method is used with
      an HTML <object> tag, the <object> tag is not removed
      by following calls to setText.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Start Applet
      2. See an initial inscription " Test bug "
      3. Press the button and see, that the inscription has not
      changed " Test bug "
      4. First time has worked a code
      String str = " <html> Test <br> <object classid
      ='javax.swing. JLabel '> <param name ='text ' value
      ='bug '> </object> </html> ";
      jLabel1.setText (str);
      Second time has worked a code
      String str = " <html> Test </html> ";
      jLabel1.setText (str);
      5. Value tag <object> remains in the component jLabel1
      although it should have been removed.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class bug02 extends javax.swing.JApplet {
          public bug02() {
              initComponents();
              String str = "<html>Test<br><object
      classid='javax.swing.JLabel'><param name='text' value='bug'></object></html>";
              jLabel1.setText(str);
          }
          private void initComponents() {//GEN-BEGIN:initComponents
              jLabel1 = new javax.swing.JLabel();
              jButton1 = new javax.swing.JButton();
              jLabel1.setText("jLabel1");
              getContentPane().add(jLabel1, java.awt.BorderLayout.CENTER);
              jButton1.setText("jButton1");
              jButton1.addActionListener(new java.awt.event.ActionListener() {
                  public void actionPerformed(java.awt.event.ActionEvent evt) {
                      jButton1ActionPerformed(evt);
                  }
              });
              getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);
          }
          private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
              String str = "<html>Test</html>";
              jLabel1.setText(str);
          }
          private javax.swing.JLabel jLabel1;
          private javax.swing.JButton jButton1;
      }
      ---------- END SOURCE ----------
      (Review ID: 165575)
      ======================================================================

            idk Igor Kushnirskiy (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: