Ú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?:))
- sziku69: Szólánc.
- Windows 7
- Le Mans Ultimate
- Battlefield 6
- Fortnite - Battle Royale & Save the World (PC, XO, PS4, Switch, Mobil)
- Xbox tulajok OFF topicja
- Így tüzelt el százbillió forintot az AI a héten
- iPhone 18 Pro Max: kis kapacitásbővítés hoz nagy előrelépést üzemidőben
- Mérföldkő a szilárdtest akkuknál: fontos lépést tett a QuantumScape
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- További aktív témák...
- BeQuiet! GAMER alap! i9-14900K / Z790 / 32GB 6000MHz / 2TB Gen4 / 1000w Gold! BeszámíTOK
- SteelSeries Arctis Nova PRO PC-Xbox headset + GameDAC GEN 2 + fülpárnák
- HifiMan Arya Organic gyári fejhallgatókábel (6,3mm jack - 2x3,5mm jack) 1,5m
- iPad Pro 11 (M5) Wifi + Cellular 256GB (Bontatlan) 1 éb garancia
- Eladó Asus ROG Nuc15 (2025) - Ultra 9 275HX, RTX 5070 Ti Laptop, 32GB/1TB, hibátlan, magyar garis
- Behringer B-CONTROL BCF2000 USB/MIDI kontroller
- ÁRGARANCIA!Épített KomPhone Ryzen 7 9800X3D 64GB RAM RTX 5080 16GB GAMER PC termékbeszámítással
- Telefon felvásárlás!! Samsung Galaxy Note 10+/Samsung Galaxy Note 20/Samsung Galaxy Note 20 Ultra
- Dell Precision 7750,17.3" FHD,i7-10875H,32GB DDR4,256GB SSD,RTX 3000 6GB VGA,WIN11
- Apple iPhone 15 128 GB Pink 1 év Garancia Beszámítás Házhozszállítás
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Central PC számítógép és laptop szerviz - Pécs
Város: Pécs

