- Fotók, videók mobillal
- iPhone topik
- Samsung Galaxy S25 FE - fenséges, felejthető vagy felesleges?
- Apple iPhone 17 - alap
- Rekordérdeklődés a Xiaomi hátsó kijelzője iránt
- Íme, a Moto X70 Air, vagyis Motorola Edge 70 minden oldalról
- Samsung Galaxy S25 - végre van kicsi!
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Sony Xperia 1 V - kizárólag igényeseknek
- Samsung Galaxy S23 és S23+ - ami belül van, az számít igazán
Ú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?:))
- Kerékpárosok, bringások ide!
- Fejhallgató erősítő és DAC topik
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
- Milyen billentyűzetet vegyek?
- Fotók, videók mobillal
- Építő/felújító topik
- Villanyszerelés
- Dacia topic
- iPhone topik
- Samsung Galaxy S25 FE - fenséges, felejthető vagy felesleges?
- További aktív témák...
- GYÖNYÖRŰ iPhone 12 mini 128GB Blue-1 ÉV GARANCIA - Kártyafüggetlen, MS3415 94% Akkumulátor
- MacBook felváráslás!! MacBook, MacBook Air, MacBook Pro
- GYÖNYÖRŰ iPhone 11 Pro Max 256GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3268, 100% Akkumulátor
- Telefon felvásárlás!! Samsung Galaxy A13/Samsung Galaxy A33/Samsung Galaxy A53
- Telenor 5G Indoor WiFi Router (FA7550) + töltő
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest