1 26 27 import java.awt.BorderLayout ; 28 import javax.swing.JFrame ; 29 30 import org.objectweb.util.browser.core.api.StatusBar; 31 import org.objectweb.util.browser.core.api.ViewPanel; 32 import org.objectweb.util.browser.core.common.DefaultStatusBar; 33 import org.objectweb.util.browser.core.common.DefaultTreePanel; 34 import org.objectweb.util.browser.core.common.DefaultViewPanel; 35 import org.objectweb.util.browser.core.common.DynamicTree; 36 37 46 public class MapConsole 47 { 48 49 public static void main(String [] args) 50 { 51 JFrame frame = new JFrame ("Browser GUI"); 53 54 ViewPanel viewPanel = new DefaultViewPanel(); 56 57 StatusBar statusBar = new DefaultStatusBar(); 59 60 DynamicTree tree = new DynamicTree(); 62 63 tree.addEntry("Object 1", new Object ()); 65 tree.addEntry("Object 2", new Object ()); 66 tree.addEntry("Map", new java.util.HashMap ()); 67 68 tree.setNewBrowserProperty(new String []{args[0]}); 70 tree.setTargetPanel(viewPanel); 71 tree.setStatusBar(statusBar); 72 73 frame.getContentPane().setLayout(new BorderLayout ()); 75 frame.getContentPane().add(new DefaultTreePanel((DynamicTree)tree), 76 BorderLayout.CENTER); 77 frame.getContentPane().add(((DefaultViewPanel)viewPanel), BorderLayout.EAST); 78 frame.getContentPane().add((DefaultStatusBar)statusBar, BorderLayout.SOUTH); 79 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 80 frame.pack(); 81 frame.setVisible(true); 82 } 83 84 } 85 | Popular Tags |