Hirdetés
- CPU léghűtés kibeszélő
- Azonnali alaplapos kérdések órája
- HiFi műszaki szemmel - sztereó hangrendszerek
- Vezetékes FEJhallgatók
- Azonnali notebookos kérdések órája
- Házi hangfal építés
- Videós, mozgóképes topik
- Hogy is néznek ki a gépeink?
- AMD Navi Radeon™ RX 9xxx sorozat
- A napi Windows-hiba? Teljes adatvesztés Bitlockerrel
Új hozzászólás Aktív témák
-
n00n
őstag
A legegyszerűbb, ha ideírom a forráskódot:
class Copy extends SwingWorker<Void, Void> {
private File selectedfile = new File("D:/Adatok/proba.file");
private File chosenDestination = new File("D:/Adatok/ide/proba.file");
@Override
protected Void doInBackground() throws Exception {
try {
FileInputStream fileInputStream = new FileInputStream(
selectedfile);
BufferedInputStream bufferedInputStream = new BufferedInputStream(
fileInputStream);
ProgressMonitorInputStream progressMonitorInputStream;
UIManager.put("ProgressMonitor.progressText", "Mentés másolása");
UIManager.put("OptionPane.cancelButtonText", "Mégse");
progressMonitorInputStream = new ProgressMonitorInputStream(MentesPanel.this, "Fájl másolása folyamatban", bufferedInputStream);
File outputFile = new File("" + chosenDestination);
FileOutputStream fileOutputStream = new FileOutputStream(
outputFile);
BufferedOutputStream bufferedOutputStream = new BufferedOutputStream(
fileOutputStream);
int data;
byte[] buffer = new byte[1024];
while ((data = progressMonitorInputStream.read(buffer)) > 0) {
bufferedOutputStream.write(buffer);
}
bufferedOutputStream.close();
progressMonitorInputStream.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
@Override
public void done() {
JOptionPane.showMessageDialog(MentesPanel.this, "A mentés másolása befejeződött!", "Kész", 1);
}
}
}
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- GYÖNYÖRŰ iPhone 13 mini 128GB Starlight -1 ÉV GARANCIA -Kártyafüggetlen, MS3892, 100% Akkumulátor
- Eredeti Lenovo 65W USB Type C notebook töltő
- ÚJ HP OmniBook Ultra Flip 14"OLED 2,8 K 120Hz - Ultra 7 256V - 16GB - 1TB - 2,5 év gari - MAGYAR
- GYÖNYÖRŰ iPhone 13 256GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3921, 100% Akkumulátor
- Bomba ár! HP EliteBook 745 G6 - Ryzen 7 3700U I 16GB I 512SSD I HDMI I 14" FHD I Cam I W10 I Gari!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


