🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12087

JProgressBar???

#12087
From: Marcel Hell
Date: Mon, 22 Feb 1999 00:00
31 lines
1444 bytes
Hi I have the following problem:
I want to read a file with an DataInputStream, modify each byte and write
the modified file to another file.
Here I want  to use the JProgressBar to show the progress of the method.
But the JProgressBar does not get updated, until everything is finished!
What's the problem?
Here's the code of the method:

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));


  System.out.println(laenge);


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);
   JProgressBar jProgressBar1 = new JProgressBar();
   jProgressBar1.setValue(i); }


  }
Technical Details
Message-ID: <7asa65$s6f3@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c7a418e2d93c1eb4,start
X-Google-Attributes: gid111d45,public
From: "Marcel Hell" <MLP.HELL@student.unimaas.nl>
Subject: JProgressBar???
Date: 1999/02/22
Message-ID: <7asa65$s6f3@forums.borland.com>
X-Deja-AN: 447191733
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing