Ps2RealityControlCenter(String dir) throws IOException { try { byte[] abIcon; InputStream inputstreamIcon = this.getClass().getResourceAsStream("icon.gif"); int iIconSize = inputstreamIcon.available(); abIcon = new byte[iIconSize]; inputstreamIcon.read(abIcon); this.setIconImage(new ImageIcon(abIcon).getImage()); } catch (Exception ex) { // the default icon will be used } panelChooser = new Ps2RealityFileChooser(dir); }
public void run() { try { final byte[] lBuf = new byte[1024]; int lBytesRead; while (in.read(lBuf, 0, 1) != -1) { synchronized (JConsole.this) { lBytesRead = in.read(lBuf, 1, 1023) + 1; print(new String(lBuf, 0, lBytesRead), attr); while (in.available() > 0) { lBytesRead = in.read(lBuf); print(new String(lBuf, 0, lBytesRead), attr); } } } } catch (IOException e) { e.printStackTrace(); } }