Package javax.swing

Examples of javax.swing.JEditorPane.addHyperlinkListener()


    }

    pane.setEditable(false);
    pane.setAutoscrolls(true);
    pane.setBounds(0, 0, Integer.MAX_VALUE, Integer.MAX_VALUE);
    pane.addHyperlinkListener(new HyperlinkListener(){
      public void hyperlinkUpdate(HyperlinkEvent e) {
        if (e.getEventType()== HyperlinkEvent.EventType.ACTIVATED)
          BrowserControl.displayURL(e.getURL().toExternalForm());
      }});
    return pane;
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 ep = new JEditorPane("text/html",
            String.format("<html><body style=\"%s\">%s<br /><a href=\"%s\">%s</a></body></html>",
                style, i18n.get("menubar.about.dialog"), link, link));

        // handle link events
        ep.addHyperlinkListener(new HyperlinkListener() {
          @Override
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
              MenuBar.launchUrl(e.getURL().toString());
            }
View Full Code Here

      JEditorPane ep = new JEditorPane("text/html", "<html>" + err
          + "<br>Remove it from your coremods folder and check <a href=\"http://teamcofh.com/\">here</a> for updates" + "</html>");

      ep.setEditable(false);
      ep.setOpaque(false);
      ep.addHyperlinkListener(new HyperlinkListener() {

        @Override
        public void hyperlinkUpdate(HyperlinkEvent event) {

          try {
View Full Code Here

            JEditorPane editor = new JEditorPane(resource);
            editor.setContentType("text/html");
            editor.setEditable(false);
            editor.setBackground(Color.WHITE);
            editor.setPreferredSize(new Dimension(400, 250));
            editor.addHyperlinkListener(this);
            dialog.add(editor);
            dialog.pack();
            dialog.setVisible(true);
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

                "https://github.com/slabua/dicomreader</a>&nbsp;&nbsp;&nbsp;" +
                "<br /></body></html>";
         
          JEditorPane infoPane = new JEditorPane("text/html", info);
         
          infoPane.addHyperlinkListener(new HyperlinkListener() {
           
              @Override
                public void hyperlinkUpdate(HyperlinkEvent e) {
                if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED))
                try {
View Full Code Here

            JEditorPane editor = new JEditorPane(resource);
            editor.setContentType("text/html");
            editor.setEditable(false);
            editor.setBackground(Color.WHITE);
            editor.setPreferredSize(new Dimension(400, 250));
            editor.addHyperlinkListener(this);
            dialog.add(editor);
            dialog.pack();
            dialog.setVisible(true);
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

    try {
      String manFileName = "tools/tools.html";
      JFrame manFrame = new JFrame("CVD Manual");
      JEditorPane editorPane = new JEditorPane();
      editorPane.setEditable(false);
      editorPane.addHyperlinkListener(new Hyperactive());
      URL manURL = ClassLoader.getSystemResource(manFileName);
      if (manURL == null) {
        String manpath = System.getProperty(CVD.MAN_PATH_PROPERTY, null);
        if (manpath != null) {
          File manDir = new File(manpath);
View Full Code Here

            JEditorPane editor = new JEditorPane(resource);
            editor.setContentType("text/html");
            editor.setEditable(false);
            editor.setBackground(Color.WHITE);
            editor.setPreferredSize(new Dimension(400, 250));
            editor.addHyperlinkListener(this);
            dialog.add(editor);
            dialog.pack();
            dialog.setVisible(true);
        } catch (IOException e) {
            e.printStackTrace();
View Full Code Here

        help.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              JEditorPane editor = new JEditorPane("text/html", propDescriptor.getTooltip());
                editor.setEditable(false);
                editor.setOpaque(false);
                editor.addHyperlinkListener(new HyperlinkListener() {
                  public void hyperlinkUpdate(HyperlinkEvent hle) {
                    if (HyperlinkEvent.EventType.ACTIVATED.equals(hle.getEventType())) {
                      OpenURLAction a = new OpenURLAction(hle.getDescription(),hle.getDescription());
                      a.doAction();
                    }               
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.