Esempio n. 1
0
  public static void main(String[] args)
      throws BadLocationException, FileNotFoundException, UnsupportedEncodingException,
          IOException {
    m_form = new MainForm();
    m_form.setVisible(true);
    JTabbedPane j = m_form.getTabbedPane();

    if (!IO.loadFile(j)) {
      IO.setStatus("Welcome to ZeroVal.");
      SyntaxBox b = new SyntaxBox();
      b.setHighlightText("//New Tab Name\n//Press Alt + Enter to evaluate");
      j.insertTab("New Tab", null, b, "Blank Tab", 0);
    } else {
      IO.setStatus("Loaded tabs successfully.");
    }

    m_timer =
        new Timer(
            60,
            new java.awt.event.ActionListener() {
              @Override
              public void actionPerformed(ActionEvent e) {
                try {
                  ((SyntaxBox) m_form.getTabbedPane().getSelectedComponent())
                      .getPatternHandler()
                      .renderSyntaxHighlighting();
                } catch (BadLocationException ex) {
                  Logger.getLogger(Base.class.getName()).log(Level.SEVERE, null, ex);
                }
              }
            });
    m_timer.start();
    j.insertTab("+", null, null, "Create New Tab", j.getTabCount());
  }