JDK-4275482 : TextArea is empty if the append char[] is too big
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_95
  • CPU: x86
  • Submitted: 1999-09-24
  • Updated: 1999-09-25
  • Resolved: 1999-09-25
Related Reports
Duplicate :  
Description
Name: skT88420			Date: 09/24/99


1. Read in a file, put it in char[]
2. Then set it in a TextArea
If the file is large(such as len= 185191 ) then you see the TextArea is empty.  This is happening in win95. small file is all right. For winnt it is OK no matter the file is big or small.
Following is the partial code.

=====================================================
File f = new File(file_name);
BufferedReader br =
   new BufferedReader(new FileReader(f));

long size = f.length();
System.out.println( " f.length=" + size );
int sz = (int) size;
			
char[] cbuf = new char[sz];
int n = br.read( cbuf, 0, sz );
TextArea ta= new TextArea( new String(cbuf), 24, 20);
====================================================
(Review ID: 95675) 
======================================================================

Comments
WORK AROUND Name: skT88420 Date: 09/24/99 unknown ======================================================================
11-06-2004