Hirdetés
- Milyen okostelefont vegyek?
- Merész dizájn és új teleobjektív az iPhone 17 Pro mobilokban
- iPhone topik
- Yettel topik
- Kézbe fogható paradoxon lett az iPhone Air
- Pulzust is mér az Apple az AirPods Pro 3
- Az Apple bemutatta az iPhone 17-et
- Nagyon erős ajánlat lett az Apple Watch SE 3
- Android alkalmazások - szoftver kibeszélő topik
- Apple iPhone 13 Pro Max - őnagysága
Ú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?:))
- Tésztagyártó géppark egyben eladó / Pasta manufacturing machine park for sale as a single package
- Apple iPhone 13 Pro 256gb - Független
- DELL OptiPlex 3050 Micro / i5-7500T / NVME M.2 / DDR4 / USB 3.1 / WIFI+BT / HDMI / több db / számla
- Eladó DJI OSMO360 kamera S(tandard Combo)
- Eladó - Acer Predator Helios 300 (PH317-55-71VR) + 2026.05-ig garanciális.
- Azonnali készpénzes AMD Radeon RX 6000 sorozat videokártya felvásárlás személyesen/csomagküldéssel
- Dell 14 Latitude 9410 FHD IPS 2in1 Touch i7-10610U 4.9Ghz 16GB 512GB SSD Intel UHD W11 Pro Garancia
- Xiaomi Redmi 12C 64GB, Kártyafüggetlen, 1 Év Garanciával
- DELL PowerEdge R630 rack szerver - 2xE5-2650v3 (20 mag / 40 szál, 2.3/3.0GHz), 32GB RAM, 55992Ft+ÁFA
- Apple iPhone 13 256GB, Kártyafüggetlen, 1 Év Garanciával
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest