Package javax.swing

Examples of javax.swing.JTextPane


    // Test panel
    JPanel testPanel = new JPanel(new GridLayout(1, 0));
    testPanel.setBorder(BorderFactory.createTitledBorder(
        BorderFactory.createEtchedBorder(),
        GT._("Test automatic replacements")));
    paneOriginal = new JTextPane();
    JScrollPane scrollOriginal = new JScrollPane(paneOriginal);
    scrollOriginal.setMinimumSize(new Dimension(50, 50));
    scrollOriginal.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    testPanel.add(scrollOriginal);
    paneResult = new JTextPane();
    paneResult.setEditable(false);
    JScrollPane scrollResult = new JScrollPane(paneResult);
    scrollResult.setMinimumSize(new Dimension(50, 50));
    scrollResult.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    testPanel.add(scrollResult);
View Full Code Here


      textInformation = new HtmlPanel();
      ucontextInformation = new SimpleUserAgentContext();
      rcontextInformation = new MWHtmlRendererContext(textInformation, ucontextInformation);
      component = textInformation;
    } else {
      textPane = new JTextPane();
      textPane.setEditable(false);
      JScrollPane scrollPane = new JScrollPane(textPane);
      scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
      scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
      component = scrollPane;
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 localOldTitle = oldTitle;
    if ((localElement != null) && (localOldTitle == null)) {
      Object attrPage = localElement.getAttributes().getAttribute(MWPaneFormatter.ATTRIBUTE_PAGE);
      if (attrPage instanceof Page) {
View Full Code Here

    constraints.weightx = 1;
    panelComment.add(chkForceWatch, constraints);
    constraints.gridy++;

    // Contents
    textNewSection = new JTextPane();
    textNewSection.setBackground(Color.WHITE);
    textNewSection.setEditable(true);
    JScrollPane scrollContents = new JScrollPane(textNewSection);
    scrollContents.setMinimumSize(new Dimension(100, 100));
    scrollContents.setPreferredSize(new Dimension(1000, 500));
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 localText = text;
    if ((localElement != null) && (localText == null)) {
      Object attrText = localElement.getAttributes().getAttribute(MWPaneFormatter.ATTRIBUTE_TEXT);
      if (attrText instanceof String) {
View Full Code Here

    // The location of the text to display has been set as a Resource in the
    // property descriptionTextPath. So, use that resource to obtain a URL
    // and set that as the page for the text pane.

    JTextPane textPane = new JTextPane();
    JScrollPane spDescription = getComponentFactory().createScrollPane(textPane);
    try {
      textPane.setPage(getDescriptionTextPath().getURL());
    }
    catch (IOException e) {
      throw new RuntimeException("Unable to load description URL", e);
    }
View Full Code Here

  JTextPane textPane;
  JButton loadCollectedStringsBtn;
  private String text;
 
  public SliderPanel() {
    textPane = new JTextPane();
    loadCollectedStringsBtn = new JButton("Load Processed Strings");
    JPanel loadBtnPanel = new JPanel();
    loadBtnPanel.add(loadCollectedStringsBtn);
   
    startColumnSldr = new JSlider(0,MAX_SLIDER_VAL,0);
View Full Code Here

   *  
   * @return javax.swing.JTextPane 
   */
  private JTextPane getJTextPane() {
    if (jTextPane == null) {
      jTextPane = new JTextPane();
    }
    return jTextPane;
  }
View Full Code Here

    treePane.setPreferredSize(new Dimension(200, 300));
    return treePane;
  }

  private Component createResponseMetadataPanel() {
    stats = new JTextPane();
    stats.setEditable(false);
    stats.setBackground(getBackground());

    // Add styles to use for different types of status messages
    StyledDocument doc = (StyledDocument) stats.getDocument();
View Full Code Here

   
    /**
     * Creates a non-editable widget to display the detailed stack trace.
     */
    JScrollPane createDetailedMessage(Throwable t) {
        _stacktrace = new JTextPane();
        _stacktrace.setEditable(false);
        JScrollPane pane = new JScrollPane(_stacktrace,
                JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
       
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.