Package javax.swing

Examples of javax.swing.JTextArea


            default: throw new IllegalStateException("We should not be here");
        }
        JPanel imagePanel = new JPanel(new BorderLayout());
        imagePanel.add(label, BorderLayout.NORTH);
        //
        JTextArea textArea = new JTextArea(message);
        textArea.setEditable(false);
        textArea.setBackground(new JLabel().getBackground());
       
        JPanel result = new JPanel(new BorderLayout());
        result.add(imagePanel, BorderLayout.WEST);
        result.add(textArea, BorderLayout.CENTER);
        return result;
View Full Code Here


  public boolean configurePlugin(ConfigNode node, ViewFrame viewFrame) {
    if (viewFrame.getDataModel().getGeneHeaderInfo().getIndex("ALN") >= 0) {
      node.setAttribute("headerName", "ALN", null);
      return true;
    } else {
      JOptionPane.showMessageDialog(viewFrame, new JTextArea("Cannot find aligned sequence.\nPlease put aligned sequence in column titled \"ALN\"."));
      return false;
    }
  }
View Full Code Here

  /* (non-Javadoc)
   * @see edu.stanford.genetics.treeview.PluginFactory#createPlugin(edu.stanford.genetics.treeview.ConfigNode)
   */
  public MainPanel restorePlugin(ConfigNode node, ViewFrame viewFrame) {
    if (viewFrame.getDataModel().aidFound() == false) {
      JOptionPane.showMessageDialog(viewFrame, new JTextArea("DataModel does not have array tree"));
      return null;
    } else {
      // make sure the annotation columns are there...
      HeaderInfo info = viewFrame.getDataModel().getAtrHeaderInfo();
      info.addName("NAME", info.getNumNames());
View Full Code Here

  /* (non-Javadoc)
   * @see edu.stanford.genetics.treeview.PluginFactory#createPlugin(edu.stanford.genetics.treeview.ConfigNode)
   */
  public MainPanel restorePlugin(ConfigNode node, ViewFrame viewFrame) {
    if (viewFrame.getDataModel().gidFound() == false) {
      JOptionPane.showMessageDialog(viewFrame, new JTextArea("DataModel does not have a gene tree"));
      return null;
    } else {
      // make sure the annotation columns are there...
      HeaderInfo info = viewFrame.getDataModel().getGtrHeaderInfo();
      info.addName("NAME", info.getNumNames());
View Full Code Here

        pCommand.setLayout(new BorderLayout());
        pResult.setLayout(new BorderLayout());

        Font fFont = new Font("Dialog", Font.PLAIN, 12);

        txtCommand = new JTextArea(5, 40);

        txtCommand.setMargin(new Insets(5, 5, 5, 5));
        txtCommand.addKeyListener(this);

        txtCommandScroll = new JScrollPane(txtCommand);
        txtResult        = new JTextArea(20, 40);

        txtResult.setMargin(new Insets(5, 5, 5, 5));

        txtResultScroll = new JScrollPane(txtResult);
View Full Code Here

      int width = 0;
      int height = 0;

      for (int i = 0; i < lines.length; i++) {
        String line = lines[i];
        JTextArea textArea = new JTextArea();
        textArea.setText(line.trim());
        textArea.setEditable(false);
        textArea.setLineWrap(true);
        textArea.setWrapStyleWord(true);
        textArea.setOpaque(false);
        textArea.setBorder(null);
        textArea.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
        textArea.setForeground(WidgetUtils.BG_COLOR_BRIGHTEST);
        textArea.setColumns(30);

        Dimension ps = textArea.getPreferredSize();
        height += ps.height + 8;
        width = Math.max(ps.width, width);

        WidgetUtils.addToGridBag(textArea, panel, 1, i + 1);
      }
View Full Code Here

      for (AnalyzerResult analyzerResult : _results) {
        Renderer<? super AnalyzerResult, ? extends JComponent> renderer = _rendererFactory.getRenderer(analyzerResult,
            SwingRenderingFormat.class);
        JComponent component;
        if (renderer == null) {
          component = new JTextArea(analyzerResult.toString());
        } else {
          component = renderer.render(analyzerResult);
        }

        addRenderedResult(component);
View Full Code Here

       
        JPanel panel = new JPanel(new BorderLayout());
        JLabel label = new JLabel("Unexpected error occurred: '" + th.getMessage() + "' with stack trace:", UIManager.getIcon("OptionPane.errorIcon"), SwingConstants.LEFT);
        label.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        panel.add(label, BorderLayout.NORTH);
        final JTextArea text = new JTextArea(new String(bos.toByteArray()));
        text.setEditable(false);
        text.setRows(10);
        text.setColumns(50);
        panel.add(new JScrollPane(text), BorderLayout.CENTER);
       
        final JDialog dialog = new JDialog(getOwner(), "SQLJet Error", true);
        dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
        panel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
        JButton button = new JButton("Close");
        button.setMnemonic('C');
        button.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dialog.setVisible(false);
                dialog.dispose();
            }
        });
        JButton copyButton = new JButton("Copy");
        copyButton.setMnemonic('o');
        copyButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                StringSelection trace = new StringSelection(text.getText());
                Clipboard cp = Toolkit.getDefaultToolkit().getSystemClipboard();
                cp.setContents(trace, trace);
            }
        });
        buttonPanel.add(copyButton);
View Full Code Here

    super(new BorderLayout());

    panel = this;

    try {
      text = new JTextArea("", 8, 80);
      text.setEditable(false);
      String bootText =
        "Knopflerfish OSGi console. Copyright (c) 2004 Knopflerfish.";

      // See if we're using the knopflerfish framework. If so, grab
View Full Code Here

          }
        }

        JPanel panel = new JPanel(new BorderLayout());

        JTextArea text = new JTextArea(Math.min(3, urls.length), 40);
        text.setText(sb.toString());
        //        text.setPreferredSize(new Dimension(300, 100));
        JScrollPane scroll =
          new JScrollPane(text,
                          JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                          JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

        scroll.setPreferredSize(new Dimension(300, 100));

        panel.add(scroll, BorderLayout.CENTER);
        panel.add(new JLabel("Repository URLs."), BorderLayout.NORTH);
        int option = JOptionPane.showConfirmDialog(this,
                                                   panel,
                                                   "Repository URLs",
                                                   JOptionPane.YES_NO_OPTION);

        String r2 = text.getText();
        if(option == 0 && !r2.equals(sb.toString())) {
          StringTokenizer st = new StringTokenizer(r2, "\n");
          urls = new String[st.countTokens()];
          int i = 0;
          while (st.hasMoreTokens()) {
View Full Code Here

TOP

Related Classes of javax.swing.JTextArea

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.