Package javax.swing

Examples of javax.swing.JTextPane


        }
        JOptionPane.showMessageDialog(null, comp, "Software Updates", JOptionPane.INFORMATION_MESSAGE);
    }

    private JTextPane createMessagePane(String msg) {
        JTextPane msgpane = new JTextPane();
        msgpane.setEditable(false);
        msgpane.setFocusable(false);
        msgpane.setText(msg);
        return msgpane;
    }
View Full Code Here


    this.currentTypeName = typeName;
    String defaultAnnotStyleName = CAS.TYPE_NAME_ANNOTATION;
    Style defaultAnnotStyle = this.styleMap.get(defaultAnnotStyleName);
    GridLayout layout = new GridLayout(0, 1);
    JPanel topPanel = new JPanel(layout);
    this.textPane = new JTextPane();
    Style style = this.styleMap.get(typeName);
    if (style == null) {
      style = defaultAnnotStyle;
    }
    Style defaultStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
View Full Code Here

 
  public TextPaneAppender(Layout layout, String name) {
    this();
    this.layout = layout;
    this.name = name;
    setTextPane(new JTextPane());
    createAttributes();
    createIcons();
  }
View Full Code Here

    createIcons();
  }
   
  public TextPaneAppender() {
    super();
    setTextPane(new JTextPane());
    createAttributes();
    createIcons();
    this.label="";
    this.sw = new StringWriter();
    this.qw = new QuietWriter(sw, errorHandler);
View Full Code Here

    super(null);
  }

  @Override
  protected JTextComponent createTextComponent() {
    return new JTextPane();
  }
View Full Code Here

    return new JTextPane();
  }

  @Override
  protected Component newWidget() {
    return new JTextPane();
  }
View Full Code Here

public class FindById implements Testlet
{

  public void test(TestHarness harness)
  {
    JTextPane html = new JTextPane();
    html.setContentType("text/html");
   
    html.setText("<p id = myOne>my text<i><b id = myTwo>myBold</b></i>xxx");

    HTMLDocument doc = (HTMLDocument) html.getDocument();

    Element el = doc.getElement("myOne");

    harness.check(true, el != null, "p with id must be found");
    harness.check(
View Full Code Here

      font = new Font("Dialog", Font.PLAIN, 10);// NON-NLS
    }

    final JPanel contentPane = new JPanel();
    contentPane.setLayout(new GridBagLayout());
    final JTextPane messageLabel = new JTextPane();
    messageLabel.setFont(font.deriveFont(Font.BOLD));
    messageLabel.setText(Messages.getInstance().getString("VersionCheckerUtility.Message"));
    messageLabel.setFocusable(false);
    messageLabel.setBackground(null);

    final String url = Messages.getInstance().getString("VersionCheckerUtility.URL");
    final HyperLink linkLbl = new HyperLink(url);
    linkLbl.addMouseListener(new HyperlinkHandler(url, linkLbl));

    final String questionText = Messages.getInstance().getString("VersionCheckerUtility.Question");
    final JTextPane questionLabel = new JTextPane();
    questionLabel.setFont(font.deriveFont(Font.BOLD));
    questionLabel.setText(questionText);
    questionLabel.setBackground(null);
    questionLabel.setFocusable(false);

    final GridBagConstraints c = new GridBagConstraints();
    c.insets = new Insets(10, 10, 0, 10);
    c.gridx = 0;
    c.gridy = 0;
View Full Code Here

        ERLConsole console = new ERLConsole("Erjang Console");

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

        final JTextPane text = new JTextPane();

        text.setMargin(new Insets(8,HINSET,8,HINSET));
        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.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        pane.setViewportView(text);
        pane.setBorder(BorderFactory.createLineBorder(Color.darkGray));
        console.getContentPane().add(pane, BorderLayout.CENTER);
View Full Code Here

    final JPanel panel = new JPanel();
    final JFrame frame = this.createSmallFrame(panel, "Enter Query...");

    // create components for query input with syntax highlighting...
    final LuposDocument document = new LuposDocument();
    final JTextPane tp_query = new LuposJTextPane(document);
    document.init(SPARQLParser.createILuposParser(new LuposDocumentReader(document)), false, 100);

    tp_query.addKeyListener(this.getKeyListener(frame));
    tp_query.setFont(new Font("Courier New", Font.PLAIN, 12));
    tp_query.setPreferredSize(new Dimension(794, 200));
    tp_query.setText("PREFIX dc:      <http://purl.org/dc/elements/1.1/>\nPREFIX dcterms: <http://purl.org/dc/terms/>\n\nSELECT DISTINCT ?author ?yr\nWHERE {\n  ?doc1 dc:author ?author.\n  ?doc1 dc:ref ?doc2.\n  ?doc2 dc:ref ?doc3.\n  ?doc3 dc:ref ?doc1.\n  OPTIONAL {\n    ?doc1 dcterms:issued ?yr. FILTER(?yr < 1950)\n  }\n}\nORDER BY ASC(?author)");

    new LinePainter(tp_query, new Color(202, 223, 245));

    final JScrollPane scroll = new JScrollPane(tp_query);

    // create OK button, which starts query evaluation...
    final JButton bt_ok = new JButton("OK");
    bt_ok.addActionListener(new ActionListener() {
      public void actionPerformed(final ActionEvent ae) {
        try {
          visualGraphs.get(0).clearAll();

          // evaluate query and show graph...
          evaluateQuery(tp_query.getText());

          repaint();

          frame.setVisible(false); // hide query input frame
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.