List of usage examples for javax.swing ProgressMonitorInputStream available
public int available() throws IOException
From source file:Main.java
public static void main(String args[]) throws Exception { ProgressMonitorInputStream monitor; monitor = new ProgressMonitorInputStream(null, "Loading ", new FileInputStream("fileName.txt")); while (monitor.available() > 0) { byte[] data = new byte[38]; monitor.read(data);/*w ww.j av a2 s . co m*/ System.out.write(data); } }
From source file:Main.java
public static void main(String args[]) { ProgressMonitorInputStream monitor; try {//from w w w. ja v a 2 s .c om monitor = new ProgressMonitorInputStream(null, "Loading ", new FileInputStream("yourFile.dat")); while (monitor.available() > 0) { byte[] data = new byte[38]; monitor.read(data); System.out.write(data); } } catch (Exception e) { JOptionPane.showMessageDialog(null, "Unable to find file: yourFile.dat", "Error", JOptionPane.ERROR_MESSAGE); } }
From source file:MainClass.java
public MainClass(String filename) { ProgressMonitorInputStream monitor; try {//from ww w . j a va 2s . com monitor = new ProgressMonitorInputStream(null, "Loading " + filename, new FileInputStream(filename)); while (monitor.available() > 0) { byte[] data = new byte[38]; monitor.read(data); System.out.write(data); } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "Unable to find file: " + filename, "Error", JOptionPane.ERROR_MESSAGE); } catch (IOException e) { ; } }
From source file:ProgressMonitorInputExample.java
public ProgressMonitorInputExample(String filename) { ProgressMonitorInputStream monitor; try {//from w w w . ja v a 2 s.c o m monitor = new ProgressMonitorInputStream(null, "Loading " + filename, new FileInputStream(filename)); while (monitor.available() > 0) { byte[] data = new byte[38]; monitor.read(data); System.out.write(data); } } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(null, "Unable to find file: " + filename, "Error", JOptionPane.ERROR_MESSAGE); } catch (IOException e) { ; } }