This page is in Pre Alpha. That means no grammer checks, no editting and speeling mistakes galore! The explanations and the final version will come soon. Check it out at your own risk! Program 1 z1.java import java.io.*; import java.util.zip.*; class z1 { public static void main(String args[]) { InputStream jarStream=null; ZipInputStream zis=null; try{ InputStream is=new FileInputStream(args[0]); jarStream= new BufferedInputStream(is); zis=new ZipInputStream(jarStream); ZipEntry ent = null; while((ent=zis.getNextEntry())!=null){ System.out.println(ent.getName()); } }catch(Exception e){} } } Program 2 z1.java package sun.beanbox; import java.io.*; import java.util.zip.*; class z1 { public static void main(String args[]) { InputStream jarStream=null; ZipInputStream zis=null; try { InputStream is=new FileInputStream(args[0]); jarStream=new BufferedInputStream(is); zis=new ZipInputStream(jarStream); ZipEntry ent=null; while((ent=zis.getNextEntry())!=null) { if (Manifest.isManifestName(ent.getName())) { BufferedInputStream bufis = new BufferedInputStream(zis); char s[]=new char[1300]; int j=0; int i = bufis.read(); while(i != -1) { s[j] = (char)i; System.out.print(s[j]); i = bufis.read(); j++; } } } }catch(Exception e){} } } Program 3 zzz.java package sun.beanbox; import java.io.*; import java.util.zip.*; import java.awt.*; import java.beans.*; class z1 extends Panel { private static Frame frame; JarLoader jl=null; JarInfo ji; BeanInfo bi=null; Image img=null; z1(Frame frame,String s) { this.frame = frame; setLayout(null); try { jl = new JarLoader(s); ji = jl.loadJar(); for (int i=0; i= 0) { label = beanName[ij].substring(ix+1); } img = null; } beanLabels.addElement(label); beanIcons.addElement(img); height = height + 20; jarname[ij]=label; jary[ij]=height; resize(200,height); ij++; } } } } } }catch(Exception e){} } } public void paint(Graphics g) { for (int i = 0; i < beanLabels.size(); i++) { String name = (String)beanLabels.elementAt(i); Image img = (Image)beanIcons.elementAt(i); g.drawString(name, 41,35+(20*i)); if (img != null) { boolean status = g.drawImage(img, 22, 22+(20*i), 16, 16, this); } } } } class zzz extends Frame { public static void main(String args[]) { Frame f=new Frame("ToolBox"); f.setLayout(null); f.setSize(300,300); f.add(new z1(f)); f.show(); new WindowCloser(f, true); } } Program 8 zzz.java package sun.beanbox; import java.io.*; import java.util.*; import java.util.zip.*; import java.beans.*; import java.awt.*; import java.applet.Applet; class j1 extends Frame { Component b=new Button("Start"); Applet apl=null; j1(){ super("BeanBox"); setSize(200,200); move(200,50); show(); b.setLocation(10,175); b.resize(75,20); this.add(b); JarLoader jl=null; JarInfo ji; Object bean=null; try{ jl = new JarLoader("c:\\bdk1.0\\jars\\juggler.jar"); ji = jl.loadJar(); bean=Beans.instantiate(SimpleClassLoader.ourLoader,"sunw.demo.juggler.Juggler"); apl=(Applet)Beans.getInstanceOf(bean,Applet.class); add((Component)Beans.getInstanceOf(bean,Component.class)); ((Component)Beans.getInstanceOf(bean,Component.class)).invalidate(); apl.resize(200,200); apl.move(25,25); resize(199,199); }catch(Exception e){ return;} } public boolean handleEvent(Event e){ if (e.target == b){ if (e.id==1001){ if (((Button)b).getLabel()=="Stop"){ ((Button)b).setLabel("Start"); apl.stop(); }else{ setTitle("Juggler"); ((Button)b).setLabel("Stop"); apl.start(); } return true; } } if( e.id == Event.WINDOW_DESTROY){ System.exit(0); return true; } return true; } } class zzz{ public static void main(String args[]) { new j1(); } } Program 9 s9.java package sun.beanbox; import java.io.*; import java.awt.event.*; import java.util.*; import java.util.zip.*; import java.beans.*; import java.awt.*; import java.applet.Applet; import java.lang.reflect.*; class s9 extends Panel implements MouseListener, MouseMotionListener{ public static String BeanXX; public static Frame frame,f; private static String label=null ; private static Image img=null ; private static Vector beanLabels = new Vector(); private static Vector beanIcons = new Vector(); private static String beanName[]=new String[20]; private String jarname[]=new String[20]; private int jary[]=new int[20]; JarLoader jl=null; JarInfo ji; BeanInfo bi=null; Vector jnames = new Vector(); s9(Frame frame) { this.frame = frame; setLayout(null); addMouseListener(this); addMouseMotionListener(this); File jars = new File(System.getProperty("user.dir")); String names[]; names = jars.list(new FileExtension(".jar")); for (int i=0; i= 0) { label = beanName[ij].substring(ix+1); } img = null; } beanLabels.addElement(label); beanIcons.addElement(img); height = height + 20; jarname[ij]=label; jary[ij]=height; resize(200,height); f.resize(200,height); ij++; } } } } } }catch(Exception e){} } } public void mouseClicked(MouseEvent evt) { for(int i=0;i (jary[i]-20) && evt.getY() < jary[i]){ System.out.println(beanName[i]); BeanXX=beanName[i]; try{ jl = new JarLoader((String)jnames.elementAt(i)); ji = jl.loadJar(); bi = ji.getBeanInfo(i); }catch(Exception ex){} } } } public void mousePressed(MouseEvent evt){} public void mouseEntered(MouseEvent evt){} public void mouseExited(MouseEvent evt){} public synchronized void mouseDragged(MouseEvent evt){} public synchronized void mouseMoved(MouseEvent evt){} public void mouseReleased(MouseEvent evt){} public void paint(Graphics g) { for (int i = 0; i < beanLabels.size(); i++) { String name = (String)beanLabels.elementAt(i); Image img = (Image)beanIcons.elementAt(i); g.drawString(name, 41,35+(20*i)); if (img != null) { boolean status = g.drawImage(img, 22, 22+(20*i), 16, 16, this); } } } public static void main(String args[]) { f=new Frame("ToolBox"); f.setLayout(null); f.setSize(300,300); f.add(new s9(f)); f.show(); new WindowCloser(f, true); new WindowCloser((new s91()), true); } } class s91 extends Frame implements MouseListener, MouseMotionListener{ Frame prop; s91(){ super("BeanBox"); setSize(200,400); move(200,0); show(); addMouseListener(this); addMouseMotionListener(this); } public void mouseClicked(MouseEvent evt){ if(s9.BeanXX != null){ Object bean=null; Applet apl=null; try{ bean=Beans.instantiate(SimpleClassLoader.ourLoader,s9.BeanXX); if (bean instanceof Applet) { apl=(Applet)Beans.getInstanceOf(bean,Applet.class); } add((Component)Beans.getInstanceOf(bean,Component.class)); ((Component)Beans.getInstanceOf(bean,Component.class)).invalidate(); if (bean instanceof Applet) { apl.resize(200,200); apl.move(evt.getX(),evt.getY()); apl.start(); }else{ ((Component)Beans.getInstanceOf(bean,Component.class)).resize(50,20); ((Component)Beans.getInstanceOf(bean,Component.class)).move(evt.getX(),evt.getY()); resize(199,399); } s9.BeanXX=null; }catch(Exception be){ return; } } } public void mousePressed(MouseEvent evt){} public void mouseEntered(MouseEvent evt){} public void mouseExited(MouseEvent evt){} public synchronized void mouseDragged(MouseEvent evt){} public synchronized void mouseMoved(MouseEvent evt){} public void mouseReleased(MouseEvent evt){} } Program 10 s10.java package sun.beanbox; import java.io.*; import java.awt.event.*; import java.util.*; import java.util.zip.*; import java.beans.*; import java.awt.*; import java.applet.Applet; import java.lang.reflect.*; class s10 extends Panel implements MouseListener, MouseMotionListener{ public static String BeanXX; public static Frame frame,f; public static PropertyDescriptor p[]; private static String label=null ; private static Image img=null ; private static Vector beanLabels = new Vector(); private static Vector beanIcons = new Vector(); private static String beanName[]=new String[20]; private String jarname[]=new String[20]; private int jary[]=new int[20]; JarLoader jl=null; JarInfo ji; BeanInfo bi=null; Vector jnames = new Vector(); // private PropertyDescriptor properties[]; s10(Frame frame) { this.frame = frame; setLayout(null); addMouseListener(this); addMouseMotionListener(this); File jars = new File(System.getProperty("user.dir")); String names[]; names = jars.list(new FileExtension(".jar")); for (int i=0; i= 0) { label = beanName[ij].substring(ix+1); } img = null; } beanLabels.addElement(label); beanIcons.addElement(img); height = height + 20; jarname[ij]=label; jary[ij]=height; resize(200,height); f.resize(200,height); ij++; } } } } } }catch(Exception e){} } } public void mouseClicked(MouseEvent evt) { for(int i=0;i (jary[i]-20) && evt.getY() < jary[i]){ BeanXX=beanName[i]; try{ jl = new JarLoader((String)jnames.elementAt(i)); ji = jl.loadJar(); bi = ji.getBeanInfo(i); p=bi.getPropertyDescriptors(); }catch(Exception ex){} } } } public void mousePressed(MouseEvent evt){} public void mouseEntered(MouseEvent evt){} public void mouseExited(MouseEvent evt){} public synchronized void mouseDragged(MouseEvent evt){} public synchronized void mouseMoved(MouseEvent evt){} public void mouseReleased(MouseEvent evt){} public void paint(Graphics g) { for (int i = 0; i < beanLabels.size(); i++) { String name = (String)beanLabels.elementAt(i); Image img = (Image)beanIcons.elementAt(i); g.drawString(name, 41,35+(20*i)); if (img != null) { boolean status = g.drawImage(img, 22, 22+(20*i), 16, 16, this); } } } public static void main(String args[]) { f=new Frame("ToolBox"); f.setLayout(null); f.setSize(300,300); f.add(new s10(f)); f.show(); new WindowCloser(f, true); new WindowCloser((new s101()), true); } } class s101 extends Frame implements MouseListener, MouseMotionListener{ boolean flag =false; Frame prop; Object bean=null; s101(){ super("BeanBox"); setSize(200,400); move(200,0); show(); prop = new Frame("Properties"); prop.setLayout(null); prop.setSize(250,400); prop.move(400,0); prop.show(); addMouseListener(this); addMouseMotionListener(this); } public void mouseClicked(MouseEvent evt){ if(s10.BeanXX != null){ Applet apl=null; try{ bean=Beans.instantiate(SimpleClassLoader.ourLoader,s10.BeanXX); if (bean instanceof Applet) { apl=(Applet)Beans.getInstanceOf(bean,Applet.class); } add((Component)Beans.getInstanceOf(bean,Component.class)); ((Component)Beans.getInstanceOf(bean,Component.class)).invalidate(); if (bean instanceof Applet) { apl.resize(200,200); apl.move(evt.getX(),evt.getY()); apl.start(); }else{ ((Component)Beans.getInstanceOf(bean,Component.class)).resize(50,20); ((Component)Beans.getInstanceOf(bean,Component.class)).move(evt.getX(),evt.getY()); resize(199,399); } addprops(); s10.BeanXX=null; }catch(Exception be){ return; } } } public void addprops(){ int x=25; int y=50; int j=0; Object args[] = { }; Object value=null; Object target=bean; for(int i=0;i<(s10.p).length;i++){ PropertyDescriptor pa=(s10.p)[i]; if (pa.getReadMethod() == null || pa.getWriteMethod() == null) { continue; } if (pa.isHidden() || pa.isExpert()) { continue; } Method getter = pa.getReadMethod(); Method setter = pa.getWriteMethod(); if (getter == null || setter == null) { continue; } PropertyEditor editor = null; Class pec = pa.getPropertyEditorClass(); if (pec != null) { try { editor = (PropertyEditor)pec.newInstance(); }catch (Exception ex) {} } if (editor == null) { editor = PropertyEditorManager.findEditor(pa.getPropertyType()); } if (editor == null) { continue; } Component l1=new Label(pa.getName()); l1.setLocation(x,y+j); l1.resize(85,30); prop.add(l1); l1.show(); TextComponent l2=new TextField(); try{ getter=pa.getReadMethod(); value=getter.invoke(target,args); System.out.println(value); l2.setText((String)value); }catch(Exception e){ } l2.setLocation(x+85,y+j); l2.resize(100,30); prop.add(l2); l2.show(); j=j+40; } } public void mousePressed(MouseEvent evt){} public void mouseEntered(MouseEvent evt){} public void mouseExited(MouseEvent evt){} public synchronized void mouseDragged(MouseEvent evt){} public synchronized void mouseMoved(MouseEvent evt){} public void mouseReleased(MouseEvent evt){} }