Package javax.swing

Examples of javax.swing.JEditorPane.addHyperlinkListener()


                .createEtchedBorder(EtchedBorder.RAISED));
        bottom.add(authorScroller);
        bottom.add(Box.createRigidArea(horizontalSpace));
        // Pane for "see also" information.
        JEditorPane seeAlsoPane = new JEditorPane();
        seeAlsoPane.addHyperlinkListener(this);
        seeAlsoPane.setContentType("text/html");
        seeAlsoPane.setEditable(false);
        JScrollPane seeAlsoScroller = new JScrollPane(seeAlsoPane);
        Dimension seeAlsoSize = new Dimension(_SEE_ALSO_WIDTH, _BOTTOM_HEIGHT);
        seeAlsoScroller.setPreferredSize(seeAlsoSize);
View Full Code Here


//        value = value.replaceAll("(?:https?|http?)://[\\w/%.-]+", "<html><body><a href='$0'>$0</a></body></html>");

        final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_XHTML, 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

      String helpFileUrl = resource.toString();
 
      try {
        final JEditorPane htmlPane = new JEditorPane(helpFileUrl);
        htmlPane.setEditable(false);
        htmlPane.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
              try {
                htmlPane.setPage(e.getURL());
              } catch (IOException e1) {
View Full Code Here

                occured = true;
            }
        }

        TestHyperlinkListener listener = new TestHyperlinkListener();
        pane.addHyperlinkListener(listener);

        action.actionPerformed(new ActionEvent(pane, 0, null));
        assertTrue(listener.occured);
    }
View Full Code Here

    private JEditorPane createContentWidget ()
    {
        JEditorPane aContent = new JEditorPane ();
        aContent.setEditable (false);
        aContent.addHyperlinkListener (new HyperlinkListener()
            {
                public void hyperlinkUpdate (HyperlinkEvent e)
                {
                    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
                        HelpWindow.Instance().loadURL (e.getURL());
View Full Code Here

    @SuppressWarnings("serial")
  private void init() {
        final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, StringUtil.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

        + "<br>&nbsp</body></html>";
        JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, message);
        editorPane.setEditable(false);
        editorPane.setBorder(BorderFactory.createEtchedBorder());
        editorPane.setBackground(buttonPanel.getBackground());
        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

    private JEditorPane createContentWidget ()
    {
        JEditorPane aContent = new JEditorPane ();
        aContent.setEditable (false);
        aContent.addHyperlinkListener (new HyperlinkListener()
            {
                public void hyperlinkUpdate (HyperlinkEvent e)
                {
                    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
                        HelpWindow.Instance().loadURL (e.getURL());
View Full Code Here

       
        JEditorPane info2 = new JEditorPane();
        info2.setContentType("text/html");
        info2.setPreferredSize(new Dimension(700,500));
        info2.setEditable(false);
        info2.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if(HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())){
              Window w = SwingUtilities.getWindowAncestor((Component)e.getSource());
              if(w != null){
                w.dispose();
View Full Code Here

       
        JEditorPane info2 = new JEditorPane();
        info2.setContentType("text/html");
        info2.setPreferredSize(new Dimension(700,500));
        info2.setEditable(false);
        info2.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
            if(HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())){
              Window w = SwingUtilities.getWindowAncestor((Component)e.getSource());
              if(w != null){
                w.dispose();
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.