public void evaluate() { try { // clear problems and console messages problemsView.setText(""); consoleView.setText(""); // update status view statusView.setText(" Parsing ..."); tabbedPane.setSelectedIndex(0); LispExpr root = Parser.parse(textView.getText()); statusView.setText(" Running ..."); tabbedPane.setSelectedIndex(1); // update run button runButton.setIcon(stopImage); runButton.setActionCommand("Stop"); // start run thread runThread = new RunThread(root); runThread.start(); } catch (SyntaxError e) { tabbedPane.setSelectedIndex(0); System.err.println( "Syntax Error at " + e.getLine() + ", " + e.getColumn() + " : " + e.getMessage()); } catch (Error e) { // parsing error System.err.println(e.getMessage()); statusView.setText(" Errors."); } }
private JTabbedPane buildProblemsConsole() { // build the problems/console editor JTabbedPane tp = new JTabbedPane(); ImageIcon consoleIcon = makeImageIcon("stock_print-layout-16.png"); tp.addTab("Problems", addScrollers(problemsView)); tp.addTab("Console", consoleIcon, addScrollers(consoleView)); // empty border to give padding around tab pane tp.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); return tp; }
public int getSelectedTab() { return tabbedPane.getSelectedIndex(); }
public void setSelectedTab(int pos) { tabbedPane.setSelectedIndex(pos); }