Article View: borland.public.jbuilder.java.language
Article #16545jProgressBar and DataInputStream
From: Marcel Hell
Date: Thu, 11 Feb 1999 00:00
Date: Thu, 11 Feb 1999 00:00
32 lines
1457 bytes
1457 bytes
Hi, I have the following problem:
Inside an application I call a method, wich reads a File via DataInputStream
(each bit is evaluated and changed), and then written to another File via
DataOutputStream.
Now I want to show the user the progress of the operation using the
jProgressBar.
(this is the methos called:
public static void kodiere(String quelldatei,String zieldatei) throws
IOException {
FileInputStream quellenlaenge = new FileInputStream(quelldatei);
int i,laenge= (int) quellenlaenge.available();
DataInput quelle = new DataInputStream(new FileInputStream(quelldatei));
DataOutput ziel = new DataOutputStream(new FileOutputStream(zieldatei));
for (i=0;i<laenge;i++){
byte b = (byte) quelle.readByte(); //Einlesen eines Bytes aus der Quelle
b = (byte) ((b+3)%256);
ziel.writeByte(b);
}
}
But I can reference the JProgressBar only outside the method, or ?
So can anyone help me how to handle that task?
Thanx
Marcel
Technical Details
Message-ID:
<79t6se$dhm12@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,79b9b3bd820b05d4,start X-Google-Attributes: gidf74b3,public From: "Marcel Hell" <MLP.HELL@student.unimaas.nl> Subject: jProgressBar and DataInputStream Date: 1999/02/11 Message-ID: <79t6se$dhm12@forums.borland.com> X-Deja-AN: 443014616 Organization: Another Netscape Collabra Server User X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: borland.public.jbuilder.java.language