Package javax.swing

Examples of javax.swing.JTextPane


   *       model backing the information about the displayed information
   */
  private void makeArea(InformationMessage iMessage) {
    GridBagConstraints constraints ;
   
    this.messageArea = new JTextPane() ;
    this.messageArea.setEditable(false) ;
    this.messageArea.setOpaque(false) ;
    this.messageArea.setBorder(BorderFactory.createEmptyBorder()) ;
    this.messageArea.setBackground(new Color(0, 0, 0, 0)) ;
   
View Full Code Here


  }

  add(toolbar, BorderLayout.NORTH);

  if (text == null) {
      text = new JTextPane();
      text.setEditable(false);
      text.setContentType("text/html");
      if (history != null) text.addHyperlinkListener(this);
  }
View Full Code Here

        final IRBConsole console = new IRBConsole("JRuby IRB Console");

        console.getContentPane().setLayout(new BorderLayout());
        console.setSize(700, 600);

        JEditorPane text = new JTextPane();

        text.setMargin(new Insets(8,8,8,8));
        text.setCaretColor(new Color(0xa4, 0x00, 0x00));
        text.setBackground(new Color(0xf2, 0xf2, 0xf2));
        text.setForeground(new Color(0xa4, 0x00, 0x00));
        Font font = console.findFont("Monospaced", Font.PLAIN, 14,
                new String[] {"Monaco", "Andale Mono"});

        text.setFont(font);
        JScrollPane pane = new JScrollPane();
        pane.setViewportView(text);
        pane.setBorder(BorderFactory.createLineBorder(Color.darkGray));
        console.getContentPane().add(pane);
        console.validate();
View Full Code Here

   *  
   * @return javax.swing.JTextPane 
   */
  private JTextPane getDescpane() {
    if (descpane == null) {
      descpane = new JTextPane();
      descpane.setBounds(new Rectangle(60, 128, 436, 284));
    }
    return descpane;
  }
View Full Code Here

   *  
   * @return javax.swing.JTextPane 
   */
  private JTextPane getPlotLog() {
    if (PlotLog == null) {
      PlotLog = new JTextPane();
      PlotLog.setBounds(new Rectangle(29, 381, 951, 370));
    }
    return PlotLog;
  }
View Full Code Here

     */
    public JTextPane getEventLogTexts()
    {
        if (eventLogTexts == null)
        {
            eventLogTexts = new JTextPane();
            eventLogTexts.setPreferredSize(new Dimension(400, 250));
        }
        return eventLogTexts;
    }
View Full Code Here

    start();
  }

  private void initComponents()
  {
    textPane = new JTextPane();
   
    styledDoc = textPane.getStyledDocument();

    //..Regulat Text Style
    Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
View Full Code Here

        return ((JTextPane)e.getSource()).getStyledDocument()
               .getStyle(StyleContext.DEFAULT_STYLE);
    }

    private void setDefaultStyle(final PropertyChangeEvent e) {
        final JTextPane pane = (JTextPane)e.getSource();
        if (pane.getStyledDocument() == null) {
            return;
        }

        final Font f = pane.getFont();
        if (f == null) {
            return;
        }

        final Style style = getDefaultStyle(e);

        updateFontAttributes(style, f);
        style.addAttribute(StyleConstants.Foreground, pane.getForeground());
   }
View Full Code Here

  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(ActionEvent e) {
    JTextPane localTextPane = textPane;
    if (localTextPane == null) {
      JTextComponent textComponent = getTextComponent(e);
      if (textComponent instanceof JTextPane) {
        localTextPane = (JTextPane) textComponent;
      }
    }
    Element localElement = element;
    if ((localTextPane != null) && (localElement == null)) {
      localElement = localTextPane.getStyledDocument().getCharacterElement(
          localTextPane.getSelectionStart());
    }
    String value = null;
    String[] tmpPossibleValues = null;
    if ((possibleValues != null) && (possibleValues.length > 0)) {
      tmpPossibleValues = possibleValues;
    }
    if (textProvider != null) {
      Collection<String> texts = textProvider.getTexts();
      if ((texts != null) && (texts.size() > 0)) {
        value = texts.iterator().next();
        if (tmpPossibleValues == null) {
          tmpPossibleValues = new String[texts.size()];
          tmpPossibleValues = texts.toArray(tmpPossibleValues);
        }
      }
    }
    if (value == null) {
      value = defaultValue;
    }
    if (tmpPossibleValues != null) {
      value = Utilities.askForValue(
          (localTextPane != null) ? localTextPane.getParent() : null,
          question,
          tmpPossibleValues, onlyList, value, checker);
    } else {
      value = Utilities.askForValue(
          (localTextPane != null) ? localTextPane.getParent() : null,
          question, value, checker);
    }
    if ((value != null) && (!value.isEmpty())) {
      StringBuilder newText = new StringBuilder();
      if (prefix != null) {
View Full Code Here

  /* (non-Javadoc)
   * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
   */
  public void actionPerformed(ActionEvent e) {
    JTextPane localTextPane = textPane;
    if (localTextPane == null) {
      JTextComponent textComponent = getTextComponent(e);
      if (textComponent instanceof JTextPane) {
        localTextPane = (JTextPane) textComponent;
      }
    }
    Element localElement = element;
    if ((localTextPane != null) && (localElement == null)) {
      localElement = localTextPane.getStyledDocument().getCharacterElement(
          localTextPane.getSelectionStart());
    }
    replace(newText, localElement, localTextPane);
  }
View Full Code Here

TOP

Related Classes of javax.swing.JTextPane

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.