Hirdetés
- Android alkalmazások - szoftver kibeszélő topik
- Xiaomi 15T Pro - a téma nincs lezárva
- Samsung Galaxy Watch (Tizen és Wear OS) ingyenes számlapok, kupon kódok
- Xiaomi 14 - párátlanul jó lehetne
- Bemutatkozott a Poco X7 és X7 Pro
- iPhone topik
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Samsung Galaxy Z Fold4 - egyre megy, honnan nézed
- Magisk
- Samsung Galaxy A56 - megbízható középszerűség
Ú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?:))
- Multimédiás / PC-s hangfalszettek (2.0, 2.1, 5.1)
- Soundbar, soundplate, hangprojektor
- Allegro vélemények - tapasztalatok
- Milyen monitort vegyek?
- Luck Dragon: Asszociációs játék. :)
- Horgász topik
- Anglia - élmények, tapasztalatok
- Android alkalmazások - szoftver kibeszélő topik
- A fociról könnyedén, egy baráti társaságban
- Autós topik
- További aktív témák...
- GYÖNYÖRŰ iPhone 13 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS4350
- 198 - Lenovo Legion Pro 5 (16IAX10) - Intel Core U9 275HX, RTX 5070 (FOGLALVA)
- GYÖNYÖRŰ iPhone 14 128GB Midnight -1 ÉV GARANCIA - Kártyafüggetlen, MS3972
- GYÖNYÖRŰ iPhone 15 Plus 128GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3355, 100% Akkumulátor
- Keresünk iPhone 14/14 Plus/14 Pro/14 Pro Max
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


