Hirdetés
- ThinkPad (NEM IdeaPad)
- Nem indul és mi a baja a gépemnek topik
- Adatmentés - HDD - SSD - Flash
- Intel Core i5 / i7 / i9 "Alder Lake-Raptor Lake/Refresh" (LGA1700)
- VR topik (Oculus Rift, stb.)
- Nvidia GPU-k jövője - amit tudni vélünk
- RAM topik
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Panasonic LCD és LED TV-k
- Vezetékes FÜLhallgatók
Hirdetés
Talpon vagyunk, köszönjük a sok biztatást! Ha segíteni szeretnél, boldogan ajánljuk Előfizetéseinket!
Ú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?:))
- ThinkPad (NEM IdeaPad)
- ARMA Reforger
- Okosóra és okoskiegészítő topik
- Bestbuy játékok
- Nem indul és mi a baja a gépemnek topik
- Miért álltak az oldalak egy hétig, mi történt?
- A hagyományos (nem okos-) telefonok jelene és jövője
- Kínai és egyéb olcsó órák topikja
- Adatmentés - HDD - SSD - Flash
- D1Rect: Nagy "hülyétkapokazapróktól" topik
- További aktív témák...
- PS 5 kontroller // Számla // Garancia //
- NYÁRI BOMBA AKCIÓK! PSN, STEAM, UBISOFT CONNECT, EA APP, XBOX EREDETI KULCSOK 100% GARANCIA
- Gamer Notebook! Lenovo Ideapad Gaming3! I7 10750H / GTX 1650Ti / 8GB DDR4 / 256GB SSD
- GYÖNYÖRŰ iPhone 11 64GB Purple -1 ÉV GARANCIA - Kártyafüggetlen, MS2190, 100% Akkumulátor
- 137 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080
Állásajánlatok
Cég: FOTC
Város: Budapest