Package javax.swing

Examples of javax.swing.JFrame


    public static JFrame getFrame(String title, int width, int height,
                                  MapHandler mapHandler, Background background,
                                  int contentMask) {

        JFrame frame = new JFrame(title);
        frame.setSize(width, height);
        frame.getContentPane().setLayout(new BorderLayout());
        MapContentManager mc3d = new MapContentManager(mapHandler, background, contentMask);
        mc3d.compileUniverse();
        frame.getContentPane().add("Center", mc3d.getCanvas());
        return frame;
    }
View Full Code Here


    public static JFrame getFrame(String title, int width, int height,
                                  MapHandler mapHandler,
                                  NavBehaviorProvider controller,
                                  Background background, int contentMask) {

        JFrame frame = new JFrame(title);
        frame.setSize(width, height);
        frame.getContentPane().setLayout(new BorderLayout());
        ControlledManager c3d = new ControlledManager(mapHandler, controller, background, contentMask);
        c3d.compileUniverse();
        frame.getContentPane().add("Center", c3d.getCanvas());
        return frame;
    }
View Full Code Here

            setFullScreen(false);
            return;
        }
        fullScreenDevice = device;     
        if (fullScreenFrame==null) {
            fullScreenFrame = new JFrame();
            fullScreenFrame.setUndecorated(true);
            fullScreenFrame.setResizable(false);
            if(_param.backgr!=null) fullScreenFrame.setBackground(_param.backgr);
        }
        if (!fullScreen) windowedModeParent = getParent();
View Full Code Here

   * For testing
   * @param args
   */
  public static void main(final String[] args) {
    if(args.length>0){
      JFrame f=new JFrame("Reading XML");
      LoggingBufferPanel lp=new LoggingBufferPanel(f,"test",null);
      f.getContentPane().add(lp);

      final LoggingEntryByteBuffer buffer=lp.getBuffer();
      try {
        buffer.readXML(new File(args[0]));
      } catch (ParserConfigurationException e1) {
        e1.printStackTrace();
        System.exit(0);
      } catch (SAXException e1) {
        e1.printStackTrace();
        System.exit(0);
      } catch (IOException e1) {
        e1.printStackTrace();
        System.exit(0);
      }

      f.addWindowListener( new WindowAdapter() {
        public void windowClosing(WindowEvent e){
          new TestBinary(buffer,args[0]);
        }
      });

      f.pack();
      f.show();
    }
    else{
      JFrame f=new JFrame("Reading Binary Socket");
      LoggingBufferPanel lp=new LoggingBufferPanel(f,"test",null);
      f.getContentPane().add(lp);

      final LoggingEntryByteBuffer buffer=lp.getBuffer();
      try {
        buffer.openServer(4321);
        ((LoggingBufferTableModel)lp.getLogbookModel()).startRefreshLoop();
      } catch(IOException ie){
        ie.printStackTrace();
        System.exit(0);
      }
      Logger lr = null;
      try {
        SocketBufferHandler sbh=new SocketBufferHandler("localhost",4321);
        lr=Logger.getLogger("TEST");
        lr.addHandler(sbh);
        lr.setUseParentHandlers(false);
        lr.warning("Start");
      } catch (IOException e) {
        e.printStackTrace();
        System.exit(0);
      }
      f.addWindowListener( new WindowAdapter() {
        public void windowClosing(WindowEvent e){
          try {
            buffer.closeServer();
          } catch (IOException e1) {
            e1.printStackTrace();
            System.exit(0);
          }
          new TestBinary(buffer,"TEST");
        }
      });

      f.pack();
      f.show();

      int i=0;
      while(true){
        lr.info("Write "+i);
        i++;
View Full Code Here

        buffer.save(new File(fileName+".bin"));
      } catch (IOException e1) {
        e1.printStackTrace();
        System.exit(0);
      }
      JFrame f2=new JFrame("Reading binary");
      LoggingBufferPanel lp2=new LoggingBufferPanel(f2,"test",null);
      f2.getContentPane().add(lp2);

      LoggingEntryByteBuffer buffer2=lp2.getBuffer();
      try {
        buffer2.read(new File(fileName+".bin"));
      } catch (IOException e1) {
        e1.printStackTrace();
        System.exit(0);
      }

      f2.addWindowListener( new WindowAdapter() {
        public void windowClosing(WindowEvent e){
          System.exit(0);
        }
      });

      f2.pack();
      f2.show();

    }
View Full Code Here

   
  protected void createPeer(Object owner){
      SceneNodeJava3D scene = (SceneNodeJava3D)owner;
    canvas = scene.getCanvas3D();

    frame=new JFrame(SimpleUniverse.getPreferredConfiguration());
    frame.getContentPane().setLayout(new BorderLayout());
    frame.setLocation(x, y);
    frame.setSize(width,height);
    frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
    frame.getContentPane().add("Center", canvas);
View Full Code Here

  /**
   * For testing
   * @param args
   */
  public static void main(String[] args) {
    JFrame f=new JFrame("Logging");
    f.addWindowListener( new WindowAdapter() {
      public void windowClosing(WindowEvent e){
        System.exit(0);
      }
    });
    LoggingPanel lp=new LoggingPanel(f,"test",null);
    f.getContentPane().add(lp);

    LoggingTableModel lm=(LoggingTableModel)lp.getLogbookModel();
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.SEVERE,"DEAD")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.WARNING,"CAUTION")));
        lm.add(new LogRecordLoggingEntry(new LogRecord(SimtoolsLevel.USER_WARNING,"titi")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.INFO,"YES")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.CONFIG,"NO")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.FINE,"WHY")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.FINER,"WHO")));
    lm.add(new LogRecordLoggingEntry(new LogRecord(Level.FINEST,"WHEN")));
   
    f.pack();
    f.show();
  }
View Full Code Here

  /**
   * For testing purpose
   * @param args
   */
  public static void main(String[] args) {
    JFrame f=new JFrame("Universes");
   
    VirtualUniverse v=new VirtualUniverse();
    Locale l=new Locale();
    l.setName("loc1");
    v.addLocale(l);
    BranchGroup bg=new BranchGroup();
    bg.setName("bg1");
    l.addBranchGraph(bg);
   
    Appearance a = new Appearance();
    a.setPolygonAttributes(new PolygonAttributes(PolygonAttributes.POLYGON_LINE, PolygonAttributes.CULL_NONE, 0));
    Shape3D sph = new Shape3D(TestUtils.createSphere(1.0f, 20), a);
    sph.setName("s1");
    TransformGroup sphereTrans = new TransformGroup();
    sphereTrans.addChild(sph);
    sphereTrans.setName("t1");

    bg.addChild(sphereTrans);

    AmbientLight aLgt = new AmbientLight(new Color3f(0.2f, 0.2f, 0.2f));
    aLgt.setName("l1");
    bg.addChild(aLgt);
   
    VirtualUniverse v2=new VirtualUniverse();
    Locale l2=new Locale();
    l2.setName("loc2");
    v2.addLocale(l2);
    BranchGroup bg2=new BranchGroup();
    bg2.setName("bg2");
    l2.addBranchGraph(bg2);

    SceneGraphModel tm=new SceneGraphModelXith3D();
    // TODO: use factories and test them by the same occasion
    //tm.insert(null, v, "v1", 0);
    //tm.insert(null, v2, "v2", 0);
   
    SceneGraphTree t=new SceneGraphTree(tm);
    f.getContentPane().add(t);
   
    f.pack();
    f.show();
  }
View Full Code Here

        StringTokenizer st = new StringTokenizer(defaultPlugins, ", ;:\t|");
        while (st.hasMoreTokens()) {
            Run.loadPlugin(st.nextToken());
        }

        HelpViewer e = new HelpViewer(new JFrame(), "JSynoptic help");
        e.setSize(1000, 600);
        e.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent ev) {
                System.exit(0);
            }
View Full Code Here

    central_panel.updateUI();
    this.repaint();
  }
 
  public static void main(String args[]) {
    JFrame frame = new JFrame("T e s t i n g   ! ! !");
    NewFilesDialg new_files_dialog = new NewFilesDialg(frame);
    frame.setSize(300,400);
    new_files_dialog.setSize(500, 300);
    frame.setVisible(true);
    new_files_dialog.setVisible(true);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.