Package javax.swing

Examples of javax.swing.JFrame


   *
   * @param args The arff file and the index of the attribute to use
   */
  public static void main(String [] args) {
    if(args.length!=3) {
      final JFrame jf = new JFrame("AttribVisualization");
      AttributeVisualizationPanel ap = new AttributeVisualizationPanel();
      try {
        Instances ins = new Instances( new FileReader(args[0]) );
        ap.setInstances(ins);
        System.out.println("Loaded: "+args[0]+
                           "\nRelation: "+ap.m_data.relationName()+
                           "\nAttributes: "+ap.m_data.numAttributes());
        ap.setAttribute( Integer.parseInt(args[1]) );
      }
      catch(Exception ex) { ex.printStackTrace(); System.exit(-1); }
      System.out.println("The attributes are: ");
      for(int i=0; i<ap.m_data.numAttributes(); i++)
        System.out.println(ap.m_data.attribute(i).name());
     
      jf.setSize(500, 300);
      jf.getContentPane().setLayout( new BorderLayout() );
      jf.getContentPane().add(ap, BorderLayout.CENTER );
      jf.setDefaultCloseOperation( jf.EXIT_ON_CLOSE );
      jf.setVisible(true);
    }
    else
      System.out.println("Usage: java AttributeVisualizationPanel"+
                         " [arff file] [index of attribute]");
  }
View Full Code Here


             
              Component jf;
              if(evt.getSource() instanceof JPanel)
                  jf = ((JPanel)evt.getSource()).getParent();
              else
                  jf = new JFrame();
              JOptionPane.showMessageDialog(jf, message,
                                            "error",
                                            JOptionPane.WARNING_MESSAGE);
              if(jf instanceof JFrame)
                  ((JFrame)jf).dispose();

            } else {
        System.err.println(ex.getTargetException().getClass().getName()+
         " while updating "+ property.getName() +": "+
         ex.getTargetException().getMessage());
              Component jf;
              if(evt.getSource() instanceof JPanel)
                  jf = ((JPanel)evt.getSource()).getParent();
              else
                  jf = new JFrame();
              JOptionPane.showMessageDialog(jf,
                                            ex.getTargetException().getClass().getName()+
                                            " while updating "+ property.getName()+
                                            ":\n"+
                                            ex.getTargetException().getMessage(),
View Full Code Here

    m_TestInstances.setClassIndex(-1)// make sure that no class attribute is set!
  }
      });
      // Add propertychangelistener to update m_TestInstances whenever
      // it changes in the settestframe
      m_SetTestFrame = new JFrame("Test Instances");
      sp.setParentFrame(m_SetTestFrame);   // enable Close-Button
      m_SetTestFrame.getContentPane().setLayout(new BorderLayout());
      m_SetTestFrame.getContentPane().add(sp, BorderLayout.CENTER);
      m_SetTestFrame.pack();
    }
View Full Code Here

   * @param args ignored
   */
  public static void main(String [] args) {

    try {
      final JFrame jf = new JFrame("Weka Explorer: Preprocess");
      jf.getContentPane().setLayout(new BorderLayout());
      final PreprocessPanel sp = new PreprocessPanel();
      jf.getContentPane().add(sp, BorderLayout.CENTER);
      weka.gui.LogPanel lp = new weka.gui.LogPanel();
      sp.setLog(lp);
      jf.getContentPane().add(lp, BorderLayout.SOUTH);
      jf.addWindowListener(new WindowAdapter() {
  public void windowClosing(WindowEvent e) {
    jf.dispose();
    System.exit(0);
  }
      });
      jf.pack();
      jf.setSize(800, 600);
      jf.setVisible(true);
    } catch (Exception ex) {
      ex.printStackTrace();
      System.err.println(ex.getMessage());
    }
  }
View Full Code Here

    } catch (Exception ex) {
      System.err.println("Problem setting up "
             +"visualization (DataVisualizer)");
      ex.printStackTrace();
    }
    final JFrame jf = new JFrame("Visualize");
    jf.setSize(800,600);
    jf.getContentPane().setLayout(new BorderLayout());
    jf.getContentPane().add(vis, BorderLayout.CENTER);
    jf.addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent e) {
    jf.dispose();
    m_framePoppedUp = false;
        }
      });
    jf.setVisible(true);
    m_popupFrame = jf;
  } else {
    m_popupFrame.toFront();
  }
      } catch (Exception ex) {
View Full Code Here

  public void showResults() {
    if (m_resultsFrame == null) {
      if (m_outText == null) {
  setUpResultHistory();
      }
      m_resultsFrame = new JFrame("Text Viewer");
      m_resultsFrame.getContentPane().setLayout(new BorderLayout());
      final JScrollPane js = new JScrollPane(m_outText);
      js.setBorder(BorderFactory.createTitledBorder("Text"));
      m_resultsFrame.getContentPane().add(js, BorderLayout.CENTER);
      m_resultsFrame.getContentPane().add(m_history, BorderLayout.WEST);
View Full Code Here

    m_TestClassIndex = sp.getClassIndex();
  }
      });
      // Add propertychangelistener to update m_TestLoader whenever
      // it changes in the settestframe
      m_SetTestFrame = new JFrame("Test Instances");
      sp.setParentFrame(m_SetTestFrame);   // enable Close-Button
      m_SetTestFrame.getContentPane().setLayout(new BorderLayout());
      m_SetTestFrame.getContentPane().add(sp, BorderLayout.CENTER);
      m_SetTestFrame.pack();
    }
View Full Code Here

  public void runSetupAssistant() {

    ProgressWindow progWin = new ProgressWindow(this, mLocalizer.msg(
        "loadingAssistant", ""));
    final JFrame parent = this;
    progWin.run(new Progress() {
      public void run() {
        try {
          UIThreadRunner.invokeAndWait(new Runnable() {
View Full Code Here

    public static void main(String[] args) {
        SwingUtilities.invokeLater(new Runnable() {

            @Override
            public void run() {
                JFrame frame = new JFrame("TimeFinder Planner");
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                CalendarSettings settings = new CalendarSettings();

                // set 1/4h as one timeslot, now even half of an hour will be displayed
                settings.setMillisPerTimeslot(15 * 60 * 1000L);
                settings.setTimeslotsPerDay(4 * 8);

                settings.setStartDate(new DateTime(2009, 4, 6, 8, 0, 0, 0));
                TimeFinderPlanner planner = new TimeFinderPlanner(settings);

                // monday
                planner.addInterval(new IntervalLongImpl("Interval 1", 2009, 4, 6, 8, 30, 60));
                planner.addInterval(new IntervalLongImpl("Interval 2", 2009, 4, 6, 9, 0, 60));

                planner.addInterval(new IntervalLongImpl("Interval A", 2009, 4, 6, 10, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval B", 2009, 4, 6, 10, 0, 180));
                planner.addInterval(new IntervalLongImpl("Interval C", 2009, 4, 6, 11, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval D", 2009, 4, 6, 13, 0, 180));
                planner.addInterval(new IntervalLongImpl("Interval E", 2009, 4, 6, 14, 0, 120));

                // tuesday
                planner.addInterval(new IntervalLongImpl("Interval 3", 2009, 4, 7, 8, 30, 30));
                planner.addInterval(new IntervalLongImpl("Interval 3", 2009, 4, 7, 9, 0, 60));
                planner.addInterval(new IntervalLongImpl("Interval 4a", 2009, 4, 7, 10, 0, 120));

                planner.addInterval(new IntervalLongImpl("Interval 4b", 2009, 4, 7, 13, 0, 180));
                planner.addInterval(new IntervalLongImpl("Interval 4c", 2009, 4, 7, 14, 0, 60));

                // wednesday
                planner.addInterval(new IntervalLongImpl("Interval 5", 2009, 4, 8, 9, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval 6 more description "
                        + "to show line breaking", 2009, 4, 8, 10, 0, 120));

                // explicit line breaking
                planner.addInterval(new IntervalLongImpl("brok\nken", 2009, 4, 9, 15, 0, 30));
                // implicit
                planner.addInterval(new IntervalLongImpl("Interval 7 show line breaking and "
                        + "clipping not shown ? 123 ********", 2009, 4, 9, 9, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval 8", 2009, 4, 9, 11, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval 9", 2009, 4, 9, 10, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval 10", 2009, 4, 9, 11, 0, 120));
                planner.addInterval(new IntervalLongImpl("Interval 11", 2009, 4, 9, 13, 0, 120));

                planner.addInterval(new IntervalLongImpl("Interval 12", 2009, 4, 10, 8, 30, 60));
                planner.addInterval(new IntervalLongImpl("Interval 13 smaller than one hour", 2009, 4, 10, 9, 30, 30));

                frame.setContentPane(planner);
                frame.setSize(1000, 640);
                frame.setVisible(true);
            }
        });
    }
View Full Code Here

    final FurnitureLibrary furnitureLibrary = new FurnitureLibrary();
    final EditorController editorController = createEditorController(furnitureLibrary);
    final View editorView = editorController.getView();
   
    final JFrame furnitureFrame = new JFrame() {
        {
          if (editorView instanceof JRootPane) {
            setRootPane((JRootPane)editorView);
          } else {
            add((JComponent)editorView);
          }
        }
      };
    furnitureFrame.setIconImage(new ImageIcon(
        FurnitureLibraryEditor.class.getResource("resources/frameIcon.png")).getImage());
    furnitureFrame.setLocationByPlatform(true);
    furnitureFrame.pack();
    furnitureFrame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    furnitureFrame.setVisible(true);
    furnitureFrame.addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent ev) {
          editorController.exit();
        }
      });
    if (furnitureFrame.getJMenuBar() == null) {
      installAccelerators(furnitureFrame, editorController);
    }
   
    if (OperatingSystem.isMacOSX()) {
      MacOSXConfiguration.bindToApplicationMenu(editorController);
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.