- Apple Watch Sport - ez is csak egy okosóra
- Honor Magic V5 - méret a kamera mögött
- Samsung Galaxy S25 Ultra - titán keret, acélos teljesítmény
- Samsung Galaxy S23 és S23+ - ami belül van, az számít igazán
- Telekom mobilszolgáltatások
- Samsung Galaxy A55 - új év, régi stratégia
- Google Pixel topik
- Motorola Edge 50 Neo - az egyensúly gyengesége
- Hivatalosnak tűnő képeken a Galaxy S25 FE
- iPhone topik
Ú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?:))
- HIBÁTLAN iPhone 15 Pro Max 256GB Natura Titanium -1 ÉV GARANCIA - Kártyafüggetlen, MS3007, 91% Akksi
- BESZÁMÍTÁS! MSI MAG 325CQRXF QHD VA 240Hz 1ms monitor garanciával hibátlan működéssel
- BESZÁMÍTÁS! Lenovo Legion Go S 32GB/1TB kézikonzol garanciával hibátlan működéssel
- Apple iPhone 13 Mini 128GB, Kártyafüggetlen, 1 Év Garanciával
- ÁRGARANCIA!Épített KomPhone Ryzen 9 5900X 16/32/64GB RAM RTX 5070 12GB GAMER PC termékbeszámítással
Állásajánlatok
Cég: FOTC
Város: Budapest