Package javax.swing

Examples of javax.swing.JEditorPane.addHyperlinkListener()


    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


        JLabel image = new JLabel(getLogoImage());
        image.setBounds(4, 4, 4, 4);

        JEditorPane infoPanel = new JEditorPane("text/html", getInfoString());
        infoPanel.setEditable(false);
        infoPanel.addHyperlinkListener(this);
        infoPanel.setBackground(getParent().getBackground());

        JPanel panel = new JPanel();
        panel.setLayout(new BorderLayout(10, 10));
View Full Code Here

        // info area
        JEditorPane infoText = new JEditorPane("text/html", infoHTML());
        infoText.setBackground(pane.getBackground());
        infoText.setEditable(false);
        // popup hyperlinks
        infoText.addHyperlinkListener(this);

        JPanel infoPanel = new JPanel();
        infoPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        infoPanel.add(infoText);
        pane.add(infoPanel, BorderLayout.NORTH);
View Full Code Here

        // info area
        JEditorPane infoText = new JEditorPane("text/html", infoHTML());
        infoText.setBackground(pane.getBackground());
        infoText.setEditable(false);
        // popup hyperlinks
        infoText.addHyperlinkListener(this);

        JPanel infoPanel = new JPanel();
        infoPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        infoPanel.add(infoText);
        pane.add(infoPanel, BorderLayout.NORTH);
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

    try {
      String manFileName = "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

                String[] options = {Language.INSTANCE.localize("common.ok"),
                        Language.INSTANCE.localize("common.cancel")};
                JEditorPane ep = new JEditorPane("text/html", "<html>" + this.pack.getUpdateMessage(this.version
                        .getVersion()) + "</html>");
                ep.setEditable(false);
                ep.addHyperlinkListener(new HyperlinkListener() {
                    @Override
                    public void hyperlinkUpdate(HyperlinkEvent e) {
                        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                            Utils.openBrowser(e.getURL());
                        }
View Full Code Here

                String[] options = {Language.INSTANCE.localize("common.ok"),
                        Language.INSTANCE.localize("common.cancel")};
                JEditorPane ep = new JEditorPane("text/html", "<html>" + this.pack.getInstallMessage(this.version
                        .getVersion()) + "</html>");
                ep.setEditable(false);
                ep.addHyperlinkListener(new HyperlinkListener() {
                    @Override
                    public void hyperlinkUpdate(HyperlinkEvent e) {
                        if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                            Utils.openBrowser(e.getURL());
                        }
View Full Code Here

                    message="We recommend you add JAI to classpath";
                 
                    JEditorPane p = new JEditorPane("text/html",message);
                    p.setEditable(false);
                    p.setOpaque(false);
                    p.addHyperlinkListener( new HyperlinkListener() {
                        public void hyperlinkUpdate(HyperlinkEvent e) {
                            if (e.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) {
                                try {
                                    BrowserLauncher.openURL("http://java.sun.com/products/java-media/jai/current.html");
                                } catch (IOException e1) {
View Full Code Here

    // myStyleSheet.addRule("body {" + normalTextStyle + "}");
    // myStyleSheet.addRule("p {" + normalTextStyle + "}");
    // myStyleSheet.addRule("div {" + normalTextStyle + "}");
    // htmlKit.setStyleSheet(myStyleSheet);
    editorPane.setEditorKit(htmlKit);
    editorPane.addHyperlinkListener(this);
    editorPane.addKeyListener(new KeyListener() {

      @Override
      public void keyTyped(KeyEvent keyEvent) {
      }
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.