tn5250j/src/org/tn5250j My5250.java,1.42,1.43
"Kenneth J. Pouncey" <[email protected]> Sat, 18 Jun 2005 09:25:16 +0000
| Newsgroups | gmane.comp.java.tn5250j.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20068/src/org/tn5250j
Modified Files:
My5250.java
Log Message:
a little cleanup
Index: My5250.java
===================================================================
RCS file: /cvsroot/tn5250j/tn5250j/src/org/tn5250j/My5250.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** My5250.java 17 Jun 2005 04:47:00 -0000 1.42
--- My5250.java 18 Jun 2005 09:25:14 -0000 1.43
***************
*** 859,940 ****
}
- /**
- * This routine will read our jar file and extract the image data from
- * the jar file. If the file is found it will then create the image
- * data from the data bytes read
- *
- * I think I got this example from the JavaWorld site or maybe from another
- * magazine I can not remember. I took it from another program I had written
- * which had the same functionality.
- *
- */
- // protected ImageIcon createImageIcon(String image) {
- //
- // String jarFileName = "my5250.jar";
- // int zeSize = 0;
- // byte[] b= null;
- // ImageIcon ii = null;
- //
- // try {
- //
- // ZipFile zf = new ZipFile("my5250.jar");
- //
- // Enumeration e = zf.entries();
- // ZipEntry ze = null;
- //
- // while (e.hasMoreElements()) {
- //
- // ze = (ZipEntry)e.nextElement();
- // if (ze.getName().equals(image)) {
- // zeSize = (int)ze.getSize();
- // }
- // }
- //
- // // extract the resource if found
- // FileInputStream fis=new FileInputStream(jarFileName);
- // BufferedInputStream bis=new BufferedInputStream(fis);
- // ZipInputStream zis=new ZipInputStream(bis);
- // ze=null;
- //
- // while ((ze=zis.getNextEntry())!=null) {
- // if (ze.isDirectory()) {
- // continue;
- // }
- //
- // // check if the resource entry read is the one we are looking for
- // if (ze.getName().equals(image)) {
- // int size=(int)ze.getSize();
- //
- // // -1 means unknown size so default to one found from above.
- // if (size==-1) {
- // size = zeSize;
- // }
- //
- // b=new byte[(int)size];
- // int rb=0;
- // int chunk=0;
- // while (((int)size - rb) > 0) {
- // chunk=zis.read(b,rb,(int)size - rb);
- // if (chunk==-1) {
- // break;
- // }
- // rb+=chunk;
- // }
- // ii = new ImageIcon(b);
- // }
- // }
- // zis.close();
- // fis.close();
- //
- // }
- // catch( ZipException zexc) {
- // System.out.println("ze " + zexc.getMessage());
- // }
- // catch( IOException ioe) {
- // System.out.println("ioe " + ioe.getMessage());
- // }
- //
- // return ii;
- // }
-
}
--- 859,861 ----
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click