Hirdetés
- Redmi Note 9S néven érkezett meg a Redmi Note 9 Pro
- Xiaomi 14 - párátlanul jó lehetne
- Samsung Galaxy A54 - türelemjáték
- Okosóra és okoskiegészítő topik
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Szerkesztett és makrofotók mobillal
- Android alkalmazások - szoftver kibeszélő topik
- Bemutatkozott a Poco X7 és X7 Pro
- Milyen okostelefont vegyek?
- uleFone Power
Ú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?:))
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Kínai és egyéb olcsó órák topikja
- Redmi Note 9S néven érkezett meg a Redmi Note 9 Pro
- OLED TV topic
- Black Friday november 29. / Cyber Monday december 2.
- Elemlámpa, zseblámpa
- Bestbuy játékok
- LEGO klub
- Itt a Microsoft szörnyprocesszora, ami 132 maggal tarolhatja le a felhőt
- Melyik tápegységet vegyem?
- További aktív témák...
- DELL latitude 5410 Tartós Üzleti Laptop 14" -70% i5-8365U 4Mag 8Gb 256GB SSD FHD IPS
- Apple iPhone 13 Pro Max 128GB,Újszerű,Dobozával,12 hónap garanciával
- Apple iPhone 14 128GB,Újszerű,Dobozával,12 hónap garanciával
- Samsung Galaxy Tab S6 Lite 64GB,Átlagos,Dobozával,12 hónap garanciával
- Apple Watch Ultra 2,Újszerű,Dobozával,12 hónap garanciával
- Apple iPhone 13 Pro 128 GB Graphite 1 év Garancia Beszámítás Házhozszállítás
- Felújított laptopok számlával, garanciával! Ingyen Foxpost!
- BESZÁMÍTÁS! MSI B450 R7 5700X 32GB DDR4 512GB SSD RTX 3070Ti 8GB Zalman Z1 Plus Cooler Master 750W
- LG 32SQ700S-W - 32" VA Smart - 3840x2160 4K UHD - 62Hz 5ms - WebOS - Wifi + BT - USB-C - Hangszórók
- GYÖNYÖRŰ iPhone 11 Pro 64GB Space Grey-1 ÉV GARANCIA - Kártyafüggetlen, MS3668, 100% Akkumulátor
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: Laptopműhely Bt.
Város: Budapest


