Hirdetés
- Android alkalmazások - szoftver kibeszélő topik
- Milyen okostelefont vegyek?
- Apple iPhone 13 - hízott, de jól áll neki!
- Külföldi prepaid SIM-ek itthon
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Samsung Galaxy Watch6 Classic - tekerd!
- A piac legerősebb kameráját ígéri a Xiaomi 17 Ultra
- Xiaomi 14 Ultra - Leica hercegnő
- Yettel topik
- Szép órával jubilál a Huawei Watch
Ú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?:))
- HiFi műszaki szemmel - sztereó hangrendszerek
- Gerincsérv műtéti kezelése
- Vigneau interaktív lokálblogja
- sziku69: Szólánc.
- Gerincsérv, derékfájás
- Le Mans Ultimate
- Trollok komolyan
- Milyen belső merevlemezt vegyek?
- Android alkalmazások - szoftver kibeszélő topik
- Milyen monitort vegyek?
- További aktív témák...
- ÚJ, bontatlan APPLE Pencil Pro, fehér (MX2D3ZM/A) 1 év Apple garancia!
- Inno3D GeForce RTX 4070 Ti X3 12G - Karácsonyi akcióban!
- Redragon Kumara K552 RGB Brown Switch magyar billentyűzet
- Lenovo Thinkpad P1 Gen 6 - i9-13980HX, 32GB, 2TB SSD, 16" WQUXGA (3840 2400), RTX 4090
- 15.gen! Intel Core Ultra 9 285K +16-32GB DDR5 RAM +hűtött VRM-es Z890 lap! GAR/SZÁMLA (a Te nevedre)
- Keresünk iPhone 14/14 Plus/14 Pro/14 Pro Max
- Samsung Galaxy S23 / 8/256GB / Kártyafüggetlen / 12Hó Garancia
- Lenovo ThinkPad L16 Gen 1 - 16" WUXGA IPS - Ultra 5 135U - 16GB - 512GB - Win11 - 2,5 év gari
- HIBÁTLAN iPhone 15 Pro 128GB Blue Titanium -1 ÉV GARANCIA -Kártyafüggetlen
- iKing.Hu - Samsung Galaxy S25 Ultra - 12/256 GB Használt, karcmentes 6 hónap garancia
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


