Exemplo n.º 1
0
 private void createContent() {
   infopane = new HTMLPaneWithButtons();
   try {
     infopane.appendHTML(method.getInfo());
   } catch (Exception e) {
     infopane.setText("An error occured and no info is available...");
     ErrorHandler.getInstance()
         .makeErrDialog("An error occured and no info is available...", e, false);
   }
 }
Exemplo n.º 2
0
  public MethodDialog(JFrame parent, Method method) {
    super(parent, "Method: " + method.getLabel());
    this.method = method;

    createContent();

    GridBagConstraints c = new GridBagConstraints();

    c.fill = GridBagConstraints.BOTH;
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 1;
    c.gridheight = 1;
    c.ipadx = 5;
    c.ipady = 5;
    c.insets = new Insets(5, 5, 5, 5);
    c.weightx = 0.5;
    c.weighty = 1;

    getContentPane().setLayout(new GridBagLayout());

    getContentPane().add(getArgumentPanel(), c);
    c.gridx++;
    c.weightx = 1;
    JScrollPane scrollPane = new JScrollPane(infopane);
    getContentPane().add(scrollPane, c);
    c.gridy++;

    c.gridx = 0;
    OkCancelButtonPane buttonPane = new OkCancelButtonPane();
    buttonPane.addActionListener(this);
    c.gridwidth = 2;
    c.weighty = 0;
    getContentPane().add(buttonPane, c);
    this.setSize(700, 500);
    this.setLocationRelativeTo(parent);
    setVisible(true);

    JViewport jv = scrollPane.getViewport();
    jv.setViewPosition(new Point(0, 0));
    infopane.setCaretPosition(0);
  }