Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4908303
Votes 0
Synopsis REGRESSION: Copy and paste into applets does not work like with 1.3 to 1.4.0
Category java_plugin:misc
Reported Against 1.4.2
Release Fixed
State 11-Closed, duplicate of 4833526, bug
Priority: 3-Medium
Related Bugs 4833526
Submit Date 18-AUG-2003
Description



FULL PRODUCT VERSION :
all is described above.  I will send you the program source
file if you like.

-- Brad Jesness (  xxxxx@xxxxx  )

REPLY REQUESTED.  THIS IS A SERIOUS LOSS OF FUNCTIONALTY FOR
A MAJOR CATEGORY OF ON-LINE PROGRAMS!!

FULL OPERATING SYSTEM VERSION :  Windows 98 SE and
likely all Windows platforms (perhaps others)


EXTRA RELEVANT SYSTEM CONFIGURATION :
Here is an annoucement I have had to make to
users of my Universal Test/Inventory Scorer because
of a loss of functionality going from 1.4.0 to 1.4.1 :

 VERY RECENTLY, THE NEWEST VERSION OF JAVA SDK HAS BEEN
MADE SO IT DOES NOT DO PASTING INTO AN APPLET TEXTAREA.
* Only the LAST (previous) major version still runs the
program (ver 1.4.0) **

THIS HAS RESULTED IN THE FOLLOWING MODIFIED _AND NEW_ (AND
WORKING) DIRECTIONS
BEING PUT ON THE WEB PAGE VERY RECENTLY.

A new procedure allows it to
run on any PC operating an Internet Explorer Browser Version
5 or above.
Using the new download procedure, the program will run on
the very newest
Internet Explorer ver 6 Browser.  Below I will quote from
the cyberper web site,
http://www.concentric.net/~cyberper/quick_start.htm
IF YOU FOLLOW ALL THE PROCEDURES BELOW FIRST, BEFORE
VISITING THE cyberper
site, then the Java Scoring Program will work immediately
without any
additional download (except download of the web page itself
and the little
applet, which takes seconds).  The program will be up and
running right away.

Here now is the Sun, Inc. download procedure (new
recommendation), quoting:

NEWLY UPDATED DEC. 28, 2002 WITH IMPORTANT NEW INSTRUCTIONS
SINCE THE NEWEST JAVA DOWNLOWD DOES NOT ALLOW ALL THE
NEEDED FUNCTIONALITY.

The Universal Inventory/Test Scorer involves ONLY a download
from
Sun, Inc. (a most  customer  corporation -- the inventor of the
Java language)
and the downloading of an applet into a browser window.  The
security of
applets is assured by Sun.  For more information on applets
see the last note
on this web page.

New REQUIRED SUN, Inc. Download

In order for the Scoring Program to run, SEVERAL people have
reported
 needing the full Sun Software Development Kit (SDK) (which
includes the Internet
 Explorer Browser Java Plug-in AND the full set of standard
Java classes).

This is now the REQUIRED procedure for users of the Java
Scorer.
Simply follow the procedure below before first running the
Universal
Inventory/Test Scorer and no further downloads from Sun,
Inc. will
ever be required.)

Here it the procedure. This download gives you both the
needed
SDK and the needed JRE (the Browser Plug-in):

Go to
http://java.sun.com/products/archive/j2se/1.4.0/index.html
Take the third DOWNLOAD link for the SDK (Java Software
  Development Kit)
version 1.4.0 (for Windows).  NOTE: DO NOT GO TO THE WEB
PAGE FOR THE NEWEST SDK VERSION (VERSION 1.4.1 )
This newest version has been altered so that it does NOT
have all the
functionality needed for the Scorer Program.

Accept the agreement on the page you are brought to after
clicking
that link.

Click the Download j2sdk-1_4_0-win.exe link when you are
brought to the third Sun web page after clicking ACCEPT on
the
last-mentioned page. Save the download somewhere you can
find it.
(I save it to my Desktop.)

Install the download by double-clicking its icon. When
installing,
select the option to install the Java Plug-in for Internet
Explorer.

This download allows the Java Scoring Program to work with
the newest IE Browser (ver. 6) and all Internet Explorers
ver. 5
and over.

THIS NEW RECOMMENDED DOWNLOAD IS BIG AND WILL
TAKE OVER 2 HOURS AT A 56k CONNECTION SPEED.  *BUT,*
AS WAS THE CASE WITH THE SMALLER AUTOMATIC
DOWNLOAD, THIS DOWNLOAD WILL BE NECESSARY ONLY
BEFORE  THE FIRST USE OF THE JAVA SCORING PROGRAM.
AFTER THAT THE PROGRAM WILL LOAD AND RUN IN
SECONDS.

( If you do this download from Sun, Inc. before you ever try
to
run the Java Scoring Program, you will find that it runs
INSTANTLY.  This procedure works for everyone and that is
why
it is now the REQUIRED procedure.
In fact,  I recommend using this procedure for everyone even
if
you already have a Java Plug-in (JRE) and/or SDK.) ...



A DESCRIPTION OF THE PROBLEM :
VERY RECENTLY, THE NEWEST VERSION OF JAVA SDK HAS BEEN
MADE SO IT DOES NOT DO PASTING INTO AN APPLET TEXTAREA.
* Only the LAST (previous) major version still runs the
program (ver 1.4.0) **

THIS HAS RESULTED IN THE FOLLOWING MODIFIED _AND NEW_ (AND
WORKING) DIRECTIONS
BEING PUT ON THE WEB PAGE VERY RECENTLY.

A new procedure allows it to
run on any PC operating an Internet Explorer Browser Version
5 or above.
Using the new download procedure, the program will run on
the very newest
Internet Explorer ver 6 Browser.  Below I will quote from
the cyberper web site,
http://www.concentric.net/~cyberper/quick_start.htm
IF YOU FOLLOW ALL THE PROCEDURES BELOW FIRST, BEFORE
VISITING THE cyberper
site, then the Java Scoring Program will work immediately
without any
additional download (except download of the web page itself
and the little
applet, which takes seconds).  The program will be up and
running right away.

Here now is the Sun, Inc. download procedure (new
recommendation), quoting:

NEWLY UPDATED DEC. 28, 2002 WITH IMPORTANT NEW INSTRUCTIONS
SINCE THE NEWEST JAVA DOWNLOWD DOES NOT ALLOW ALL THE
NEEDED FUNCTIONALITY.

The Universal Inventory/Test Scorer involves ONLY a download
from
Sun, Inc. (a most  customer  corporation -- the inventor of the
Java language)
and the downloading of an applet into a browser window.  The
security of
applets is assured by Sun.  For more information on applets
see the last note
on this web page.

New REQUIRED SUN, Inc. Download

In order for the Scoring Program to run, SEVERAL people have
reported
 needing the full Sun Software Development Kit (SDK) (which
includes the Internet
 Explorer Browser Java Plug-in AND the full set of standard
Java classes).

This is now the REQUIRED procedure for users of the Java
Scorer.
Simply follow the procedure below before first running the
Universal
Inventory/Test Scorer and no further downloads from Sun,
Inc. will
ever be required.)

Here it the procedure. This download gives you both the
needed
SDK and the needed JRE (the Browser Plug-in):

Go to
http://java.sun.com/products/archive/j2se/1.4.0/index.html
Take the third DOWNLOAD link for the SDK (Java Software
  Development Kit)
version 1.4.0 (for Windows).  NOTE: DO NOT GO TO THE WEB
PAGE FOR THE NEWEST SDK VERSION (VERSION 1.4.1 )
This newest version has been altered so that it does NOT
have all the
functionality needed for the Scorer Program.

Accept the agreement on the page you are brought to after
clicking
that link.

Click the Download j2sdk-1_4_0-win.exe link when you are
brought to the third Sun web page after clicking ACCEPT on
the
last-mentioned page. Save the download somewhere you can
find it.
(I save it to my Desktop.)

Install the download by double-clicking its icon. When
installing,
select the option to install the Java Plug-in for Internet
Explorer.

This download allows the Java Scoring Program to work with
the newest IE Browser (ver. 6) and all Internet Explorers
ver. 5
and over.

THIS NEW RECOMMENDED DOWNLOAD IS BIG AND WILL
TAKE OVER 2 HOURS AT A 56k CONNECTION SPEED.  *BUT,*
AS WAS THE CASE WITH THE SMALLER AUTOMATIC
DOWNLOAD, THIS DOWNLOAD WILL BE NECESSARY ONLY
BEFORE  THE FIRST USE OF THE JAVA SCORING PROGRAM.
AFTER THAT THE PROGRAM WILL LOAD AND RUN IN
SECONDS.

( If you do this download from Sun, Inc. before you ever try
to
run the Java Scoring Program, you will find that it runs
INSTANTLY.  This procedure works for everyone and that is
why
it is now the REQUIRED procedure.
In fact,  I recommend using this procedure for everyone even
if
you already have a Java Plug-in (JRE) and/or SDK.) ...



REGRESSION.  Last worked in version 1.4

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.Just follow the above described procedure using 1.4.1
2. Then follow the above procedure (using 1.4.0) as
indicated
3. Run the program from the links at the bottom of
http://www.concentric.net/~cyberper/ANNOUNCEMENT.htm
under both of the 2 conditions and see the clear
different result (using 1.4.0 copy and paste into
the program works; using 1.4.1 IT DOES NOT WORK)

EXPECTED VERSUS ACTUAL BEHAVIOR :
program needs the ability to paste into a textarea
from a txt file (any of the users choice)

ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error messages, just no paste response.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Below is the source code, but you need to go to
http://www.concentric.net/~cyberper/quick_start.htm
to find out what input to try to give the program
(though here, copy and paste of WHATEVER shows the problem)

The following code is MINE and I reserve all rights to it:

import java.applet.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.io.*;

public class ScorerUser2FPC extends JApplet implements ActionListener
{
  private TreeMap dict = new TreeMap();
  private int scaleArray[];
  private int Items;
  private String s;
  JTextArea theText;
  JButton button;
  JLabel inputLabel;
  String label;
  String tstr = "T";
  String fstr = "F";
  StringBuffer out;
  JPanel pane;
  JScrollPane scroller;
  int click = 1;
  
    public void calcScaleScores(String s)
    {
     
     int allAnslen = (s.length()); // full set of client answers (one per item)
     char ansArray[] = new char[(allAnslen + 1)];
     s.getChars(0, allAnslen, ansArray, 1);
     Items = dict.size();  // number of Scales (may = no. of items if its a
stand. test)
     scaleArray = new int[Items + 1]; // array to record matches bet. item
answers and scale
                                      //score up if matches (or correct)
     Iterator I = dict.keySet().iterator();
     int n = 0;
   
     
       while (I.hasNext())
       {
     
         char Oneon = (char)('a' - 1);
         String presItem = (String)I.next();
   	  
   	
   	  LinkedList defs = (LinkedList)dict.get(presItem);
   	  
   	  int size = defs.size();
   	
         ListIterator L = defs.listIterator();
   	
   	  n = n + 1;
   	  
   	
   	   for(int i = 1; i < size + 1; i++)
   	   {
          	 // get official answer(s) that 'count' for scale
            String recItemans = (String)L.next();
   	     Oneon = (char)(Oneon +1);
   		 

   
   	  	  if(Integer.parseInt(recItemans.substring(0,3)) == 0)
                 continue;
   		  
   		  
          int noPartItemInScale = (recItemans.length() - 1)/3; //get no. of
answers for that scale
                                                   //setup array for each
triplet
          int itemIntArray[] = new int[noPartItemInScale];
      
            for(int j = 0; j < noPartItemInScale; j++)
   	     {
            itemIntArray[j] =
Integer.parseInt(recItemans.substring((j*3),((j*3)+3)));
            if(ansArray[itemIntArray[j]] == Oneon)
   		    scaleArray[n] = scaleArray[n] + 1;
   	   
   	     }
   	   }
   	 }
   	
          
       for(int i = 1; i < Items + 1; i++)
       {
       
  	   theText.append("Scale " + i + "     Score:  " + scaleArray[i]);
  	   theText.append("\n");
  	   repaint();
       }
  	 
  	 //theText.setText(out.toString());
     
     }
     
      public void addWord(String itemNo, String definition)
      {
       if (dict.containsKey(itemNo))
       {
        LinkedList defs = (LinkedList)dict.get(itemNo);
        defs.add(definition);  // Add new definition only
       }
       else
       {
        LinkedList defs = new LinkedList();  // New list
        defs.add(definition);  // Add definition to new list
        dict.put(itemNo, defs);  // Add word and defs association
       }
      }
     
  public void input()
   {
  
  // Read words and definitions into the container
    try {
     StringReader fr = new StringReader(theText.getText());
     BufferedReader br = new BufferedReader(fr);
     String itemNo = br.readLine();
  
    while (itemNo != null)
    {
     String line = br.readLine();
     while (line.length() > 1)
     {
      addWord(itemNo, line);  // Add itemNo and definition OR definition
      line = br.readLine();
     }

  	itemNo = br.readLine();
    }
    }catch (FileNotFoundException e) {
     System.out.println("File not found: " + e.getMessage());
    } catch (IOException e) {
     System.out.println("I/O error: " + e.getMessage());
    }
    theText.setText("");
   }
   
   public void input2()
    {
     try
     {
     StringReader fr2 = new StringReader(theText.getText());
     BufferedReader br2 = new BufferedReader(fr2);
     StringBuffer strbuf = new StringBuffer();
     String word = br2.readLine();
  
     
     if (word != null && word.equals(tstr)) word="a";
     if (word != null && word.equals(fstr)) word="b";
     
     while (word != null)
     {
      strbuf.append(word);
  	word = br2.readLine();
  	if(word != null && word.equals(tstr)) word="a";
      if(word != null && word.equals(fstr)) word="b";
     }
  	
     s = strbuf.toString();
     
  	
  	
  
    } catch (FileNotFoundException e) {
     System.out.println("File not found: " + e.getMessage());
    } catch (IOException e) {
     System.out.println("I/O error: " + e.getMessage());
    }
  
  
      theText.setText("");
  
   }
  
    public void actionPerformed(ActionEvent e)
    {
      switch(click)
  	  {
  		case 1:
  			button.setText("");
  			inputLabel.setText("");
  			input();
  			click = 2;
  			inputLabel.setText("Now Cut and Paste (or Enter)
Client/Student Answers and Click Button Again");
  			button.setText("Click Again after inputing
Client/Student Answers");
  			break;
  			
  		case 2:
  			button.setText("");
  			inputLabel.setText("");
  			input2();
  			click = 3;
  			inputLabel.setText("Simply Click Button again for
Scores");
  			button.setText("Click for Raw Scale/Test Item Scores");
  			break;
  		case 3:
  			button.setText("");
  			calcScaleScores(s);
  			click = 4;
  			inputLabel.setText("Raw Scores on Each Scale/ Test
Item");
  			button.setEnabled(false);
  			break;
  		default:
  			System.out.println("Close and restart program to do
again");
  	  }
    
    
    }
  
 public void init() {
 
     pane = new JPanel();
     pane.setLayout(new BorderLayout());
    
     
       // Create text area  customer 
       theText = new JTextArea(600,550);
       theText.setFont(new Font("Courier", Font.PLAIN, 12));
       theText.setLineWrap(false);
     
       // Add a scroller to the text area  customer 
       scroller = new JScrollPane(theText);
       scroller.setPreferredSize(new Dimension(600, 500));
       
scroller.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
     
       // Create a label for the text area  customer 
       String s2 = "Paste in Scoring System (using Ctrl-V) THEN Click Button at
Bottom";
        
       inputLabel = new JLabel(s2);

     
       // Add all components to the content pane
       pane
.add("North", inputLabel);
       pane.add("Center", scroller);
   
       //setResizable(false);
    
    
     label = "Click Here after Pasting Scoring System";
     button = new JButton(label);
     
     button.addActionListener(this);
     button.setAlignmentX(Component.CENTER_ALIGNMENT);
     pane.add("South", button);
     getContentPane().add(pane);
     resize(600,500);
     show();
 
   }
}

---------- END SOURCE ----------

CUSTOMER WORKAROUND :
there is no work around, except to download the
older 1.4.0 SDK

Release Regression From : 1.4.0_03
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Incident Review ID: 179524) 
======================================================================
Posted Date : 2005-07-22 03:26:19.0
Work Around
N/A
Evaluation




The bug is not reproducible on Windows NT and Windows 2000 SP 3 with
and Internet Explorer 6 and JRE 1.4.1_04 and 1.4.2.
The text is properly pasted into the applet's textarea.
Will try to reproduce on Windows 98.

  xxxxx@xxxxx   2003-08-19

======================================================================
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang