Package javax.swing

Examples of javax.swing.JEditorPane.addHyperlinkListener()


    final JToolBar tutorialToolbar = new JToolBar();
    tutorialToolbar.setFloatable(false);
    tutorialToolbar.add(startButton);
    tutorialToolbar.add(stopButton);
    container.add(tutorialToolbar, BorderLayout.NORTH);
    tutorialArea.addHyperlinkListener(
      new HyperlinkListener() {
        public void hyperlinkUpdate(HyperlinkEvent e) {
          if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            if (e.getDescription().equals("StartTutorial")) {
              startTutorial.actionPerformed(null);
View Full Code Here


    }

    JEditorPane editorPane = new JEditorPane( "text/html", content );
    editorPane.setCaretPosition( 0 );
    editorPane.setEditable( false );
    editorPane.addHyperlinkListener( new DefaultHyperlinkListener( editorPane ) );

    JScrollPane scrollPane = new JScrollPane( editorPane );
    scrollPane.setBorder( BorderFactory.createCompoundBorder( BorderFactory.createEmptyBorder( 5, 5, 5, 5 ),
        scrollPane.getBorder() ) );
View Full Code Here

    JEditorPane htmlPane = new JEditorPane();

    htmlPane.setEditorKit(new ExtendedHTMLEditorKit());
    htmlPane.setEditable(false);

    htmlPane.addHyperlinkListener(new HyperlinkListener() {
      public void hyperlinkUpdate(HyperlinkEvent evt) {
        if (evt.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
          URL url = evt.getURL();
          if (url != null) {
            Launch.openURL(url.toString());
View Full Code Here

    ta.setBackground(c);
    ta.setOpaque(true);
    ta.setFocusable(true);
    ta.setText(licenseTxt);

    ta.addHyperlinkListener(new HyperlinkListener() {
      private String mTooltip;
      public void hyperlinkUpdate(HyperlinkEvent evt) {
        if (evt.getEventType() == HyperlinkEvent.EventType.ENTERED) {
          mTooltip = ta.getToolTipText();
          ta.setToolTipText(evt.getURL().toString());
View Full Code Here

                    "http://code.google.com/p/automatic-sites-registrator</a></b><br>" +
                    "Autors: Karasev R.A., Filonov R.I., Yutsis A.V.</body></html>";

            final JEditorPane editorPane = new JEditorPane("text/html", message);
            editorPane.setEditable(false);
            editorPane.addHyperlinkListener(new HyperlinkListener() {
                public void hyperlinkUpdate (HyperlinkEvent e)
                {
                    if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED))
                        try {
                            Desktop.getDesktop().browse(e.getURL().toURI());
View Full Code Here

    @SuppressWarnings("serial")
  private void init() {
        final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, createHTMLUrlTaggedString(value));
        editorPane.setEditable(false);
        editorPane.setBackground(Color.WHITE);
        editorPane.addHyperlinkListener(new HyperlinkListener() {
            public void hyperlinkUpdate(HyperlinkEvent event) {
                logger.debug("Event:" + event);
                if (event.getEventType() == EventType.ACTIVATED) {
                    URL url = event.getURL();
                    try {
View Full Code Here

     
      jep.setEditable(false);
    jep.setContentType ( "text/html" )
    jep.setText ((titre.equals("titreAide") ? gd.getAide() : gd.getLicences()));
    jep.setCaretPosition(0);
    jep.addHyperlinkListener(this);
    this.add(new JScrollPane(jep));
      //rendre la fenêtre visible
      this.setVisible(true);
  }
 
View Full Code Here

    //le texte du JeditorPane
    jep.setText (texte);
    //positionné au début
    jep.setCaretPosition(0);
    //il réagit aux liens hypertextes
    jep.addHyperlinkListener(this);
    //le JEditorPane est dans JScrollPane
    this.add(new JScrollPane(jep));
      //rendre la fenêtre visible
      this.setVisible(true);
  }
View Full Code Here

        _jgraph.setBackground(BasicGraphFrame.BACKGROUND_COLOR);
        descriptionPanel.add(_jgraph);
        descriptionPanel.add(Box.createRigidArea(horizontalSpace));
        // Create a pane in which to display the description.
        final JEditorPane descriptionPane = new JEditorPane();
        descriptionPane.addHyperlinkListener(this);
        descriptionPane.setContentType("text/html");
        descriptionPane.setEditable(false);
        JScrollPane scroller = new JScrollPane(descriptionPane);
        scroller.setPreferredSize(new Dimension(_DESCRIPTION_WIDTH,
                _ICON_WINDOW_HEIGHT));
View Full Code Here

        contentPane.add(bottom);
        contentPane.add(Box.createRigidArea(verticalSpace));
        bottom.add(Box.createRigidArea(horizontalSpace));
        // Pane for author, etc.
        JEditorPane authorPane = new JEditorPane();
        authorPane.addHyperlinkListener(this);
        authorPane.setContentType("text/html");
        authorPane.setEditable(false);
        JScrollPane authorScroller = new JScrollPane(authorPane);
        Dimension authorSize = new Dimension(_AUTHOR_WINDOW_WIDTH,
                _BOTTOM_HEIGHT);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.