Esempio n. 1
0
 private void showStack(ThreadInfo tinfo, int selectFrame) {
   StackTraceListModel model = new StackTraceListModel(tinfo);
   stackModel = model;
   list.setModel(stackModel);
   list.setSelectedIndex(selectFrame);
   list.ensureIndexIsVisible(selectFrame);
 }
Esempio n. 2
0
  public StackTraceTool(Environment env) {

    super(new BorderLayout());

    this.env = env;
    this.runtime = env.getExecutionManager();
    this.context = env.getContextManager();

    stackModel = new DefaultListModel(); // empty

    list = new JList(stackModel);
    list.setCellRenderer(new StackFrameRenderer());

    JScrollPane listView = new JScrollPane(list);
    add(listView);

    // Create listener.
    StackTraceToolListener listener = new StackTraceToolListener();
    context.addContextListener(listener);
    list.addListSelectionListener(listener);

    // ### remove listeners on exit!
  }