Hirdetés
- Toomy: FOXPOST: régen jó volt, de már jobban jársz, ha elfelejted
- ubyegon2: Airfryer XL XXL forrólevegős sütő gyakorlati tanácsok, ötletek, receptek
- Luck Dragon: Asszociációs játék. :)
- droidic: Safe Mode az agyban
- sziku69: Fűzzük össze a szavakat :)
- sziku69: Szólánc.
- urandom0: Mégsem számőzöm az AI-t az életemből :(
- Magga: PLEX: multimédia az egész lakásban
- Samus: Linkin Park - In The End (Demo)
- gban: Ingyen kellene, de tegnapra
Ú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?:))
- Asus P8P67 EVO LGA 1155 alaplap
- Zsír Lenovo ThinkPad X13 G3 "Golyóálló" Laptop 13.3" -35% Brutál i5-1245U 12Magos 16GB 512GB FHD+
- Macbook Retina 12 2017 8/256 (A1534)
- Dobozos Lenovo Thinkpad T14s G6 Tartós Laptop 14" -60% Snapdragon X Elite 32/1TB FHD+ 22Hó Gar
- Samsung Odyssey LS49CG954SU OLED Monitor
- IKEA Format lámpák eladóak (Egyben kedvezménnyel vihető!)
- HIBÁTLAN iPhone 15 Pro 128GB Natural Titanium -1 ÉV GARANCIA - Kártyafüggetlen, MS4226
- Frissen pasztázva! Playstation 4 Pro 1 TB + kontroller 6 hó garancia, számlával!
- LG 34WQ75X-B - 34" Ívelt IPS Panel - 3440x1440 2K QHD - 60Hz 5ms - FreeSync - USB Type-C 90W
- Telefon felvásárlás!! Samsung Galaxy A50/Samsung Galaxy A51/Samsung Galaxy A52/Samsung Galaxy A53
Állásajánlatok
Cég: Laptopszaki Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest

