JEditorPane POST [1.5.0]

Hi out there!
I use a JEditorPane to POST data in an HTML form. With Java 1.4.2 (Linux) everything works fine. The same code however, using Java 1.5.0 (Linux) doesn't work any more: The CGI script does not receive any of the posted data.
I don't have any ideas, since the pressing of buttons in a JEditorPane is handled internally by JEditorPane, I don't know how to influence its behaviour. Any ideas how to fix this problem? Or what am I doing wrong?
Thanks for your help,
Nicolas Michael

Some additional information: I wrote a little test program:
import java.awt.*;
import javax.swing.*;
public class JEditorPaneTest extends JFrame {
  JEditorPane pane = new JEditorPane();
  public JEditorPaneTest() {
    try {
      pane = new JEditorPane();
      pane.setEditable(false);
      this.getContentPane().add(pane, BorderLayout.CENTER);
      pane.setPage("http://www.nmichael.de/efaWett/drv/einsenden.html");
    catch(Exception e) {
      e.printStackTrace();
  public static void main(String[] args) {
    JEditorPaneTest frame = new JEditorPaneTest();
    frame.show();
}Using Java 1.4.2 it works fine, but with Java 1.5.0 I get the following exception when clicking on the button in the HTML form:
Exception in thread "AWT-EventQueue-0" javax.swing.text.StateInvariantError: Illegal cast to MutableAttributeSet
at javax.swing.text.AbstractDocument$AbstractElement.checkForIllegalCast(AbstractDocument.java:2055)
at javax.swing.text.AbstractDocument$AbstractElement.removeAttribute(AbstractDocument.java:2000)
at javax.swing.text.html.HTMLDocument.updateFrame(HTMLDocument.java:623)
at javax.swing.text.html.HTMLDocument.processHTMLFrameHyperlinkEvent(HTMLDocument.java:517)
at javax.swing.text.html.FrameView.hyperlinkUpdate(FrameView.java:307)
at javax.swing.JEditorPane.fireHyperlinkUpdate(JEditorPane.java:320)
at javax.swing.text.html.FormView$SubmitThread$1.run(FormView.java:477)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Any ideas?
Thanks,
Nick

Similar Messages

  • JEditorPane can't handle POST from HTML form?

    I posted this before but i never got an answer so i'll try again :-)
    Im running a tomcat server were i have a jsp script that uploads files to the server. What i need to do to is to use a regular java application for the rest of the "project" im working on.
    And i can get the JSP page to be displayed properly using JEditorPane but i cant get the html FORM POST in the JSP to execute... i dont know if theres some limits in JEditorPane or if im just using the wrong type of approach on this one.
    This is the server
    http://chilly-schrimp.kicks-ass.org/uploadbean/SimpleUpload.jsp
    (only works if my computer is turned on)
    Heres the code:
    =======================================================================
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    public class JSPtest {
    public static void main(String[] args) {
    JEditorPane pane = null;
    try {
    pane = new JEditorPane("http://chilly-schrimp.kicks-ass.org/uploadbean/SimpleUpload.jsp");
    catch (IOException ex) {
    ex.printStackTrace(System.err);
    System.exit(1);
    pane.setEditable(false);
    // Add a hyperlink listener.
    final JEditorPane finalPane = pane;
    pane.addHyperlinkListener(new HyperlinkListener() {
    public void hyperlinkUpdate(HyperlinkEvent ev) {
    try {
    if (ev.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
    finalPane.setPage(ev.getURL());
    } catch (IOException ex) { ex.printStackTrace(System.err); }
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setContentPane(new JScrollPane(finalPane));
    frame.setSize(350,400);
    frame.setVisible(true);
    =======================================================================
    any suggestions??
    thanx
    /eric

    I am using request.getParameter(passed variable name)
    to pass data from HTML form to JSP with no problem.
    WHen I try to pass data from HTML form of
    multipart/form-dta type to JSP as following:
    < form enctype="multipart/form-data" name="theForm"
    method="post"
    ACTION="http://titan.ssd.loral.com:7778/ifs/jsp-bin/if
    -cts/stringsecond.jsp">
    The passed value is null. Why?because the jsp most likely does not handling of POST parameters like this.
    How can I pass data successfully from this form to
    JSP?jsp's are not meant to read such amounts of data. this (= uploading) is a typical task for a specialized servlet. there you have full control over input and output. if you need to, you can still forward to a jsp after processing in the servlet.
    How can I pass data from JavaScript to JSP???? i'm not sure what exactly you mean. normally you put it into an url and submit it.
    robert

  • POSTing from JEditorPane

    Hello,
    I am writing an applet where I need to direct users to a web form, which uses the POST method. I am able to use a JEditorPane to load and display the form almost properly. However, when I click the submit button, no data is sent to the server.
    The code is fairly simple, and is attached below.
    Any suggestions?
    Thanks,
    John.
    =============================
    * SurveyPanel.java
    * Created on November 21, 2002, 3:14 PM
    import java.io.IOException;
    * @author jjanmaat
    public class SurveyPanel extends javax.swing.JFrame {
    /** Creates new form SurveyPanel */
    public SurveyPanel() {
    initComponents();
    try {
    m_SurveyPane.setPage("http://descartes.acadiau.ca/~jjanmaat/socks/SocksParticipantSurvey.html");}
    catch(IOException e) {debug(e.toString());}
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    jScrollPane1 = new javax.swing.JScrollPane();
    m_SurveyPane = new javax.swing.JEditorPane();
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    m_SurveyPane.setEditable(false);
    m_SurveyPane.setContentType("text/html");
    jScrollPane1.setViewportView(m_SurveyPane);
    getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
    pack();
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new SurveyPanel().show();
    // Variables declaration - do not modify
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JEditorPane m_SurveyPane;
    // End of variables declaration
    * Method to output a string to the console, if the debug flag is set true.
    public void debug(String message) {
    if(m_Debug) System.out.println(this.getClass().getName() + ": " + message);
    private boolean m_Debug = true;
    public void setDebug(boolean flag) {m_Debug = flag;}
    public boolean getDebug() {return m_Debug;}

    ...YAY...thanks Bas...got sound...here...
    ...tip...download and unzip in a Windows 32-bit OS...XP 64-Bit doesn't recognize zip and has no right-click option to extract...might just be me   ...
    ...getting a few pop-behind ads...???...
    ...I visit a forum that uses Flash and the Macromedia install notice showed up everytime I went to a new page until I checked the "Alway Trust Macromedia" box and clicked Install...heh heh...
    ...Paint Shop Pro 8 locked up once but Task Manager got me out of it...
    ...one odd thing...when I start up Windows loads and I get the desktop but then My Computer opens to the F-drive Program Files (XP 64-Bit) page...???...everytime...
    ...'nuff said...  

  • Get / Post in JEditorPane

    I have written a simple browser using JEditorPane and it works in so
    far as selecting url's and displaying the new page. However, when a
    'get or post' is issued as a result of a html button in a form being
    selected the request is sent to the web server, the server replyies
    but the result is not shown in the JEditorPane. Is there anyone here
    how can point me at an example of this type of activity either
    articals or sample code.
    Regards,
    Robert
    www.fishcroft.ca

    When a user clicks on a submit button within a form in JEditorPane the method protected void submitData(String data) in javax.swing.text.html.FormView is called. This method starts a new thread.
    The new thread submits the form and try's to load the action url.
    Just check this part and see if it helps you. I am sure you have to play with this class.

  • How to retrieve data from the HTML form in the JEditorPane?

    I could quite easily use JEditorPane to render and display a simple HTML file.
    My HTML looks like this:
    <html>
    <head>
    <title> simple form</title>
    </head>
    <body bgcolor="cccccc">
    <center><h1>SURVEY THING</h1>
    </center>
    <form id="survey">
    <p>1.Type something in.</p>
    <textarea cols=25 rows=8>
    </textarea>
    <BR>
    <p>2.Pick ONLY one.</p>
    <input type="radio" name="thing" value="0" Checked> NO choice <BR>
    <input type="radio" name="thing" value="1"> First choice <BR>
    <input type="radio" name="thing" value="2"> Second choice
    <BR>
    <p>3.Pick all you like.</p>
    <input type="checkbox" name="stuff" value="A"> A <BR>
    <input type="checkbox" name="stuff" value="B"> B <BR>
    <input type="checkbox" name="stuff" value="C"> C <BR>
    <input type="submit" value="give data">
    <input type="reset" value="do clensing">
    </form>
    </body>
    </html>
    It gets diplayed fine and I can type in text, select radio buttons (they behave mutualy-exclusive,
    as they should) and check checkboxes.
    The problem I have is with retrieving the values which were entered into the form.
    If I, after editing, try to write the html to the file using HTMLWriter,
    it records the changes I made into the textarea, however all the radio and checkbox selections are lost.
    Maybe the problem is that when I enter the values I do not use any methods like
    insertBeforeStart and so on, but I believe I shouldn't need to use them to populate a form.
    Especially I never change the structure of the HTML.
    Also, when I try to traverse the Element tree and see the input elements attributes,
    I can never see a change in the entered values. However it is probably b/c I am traversing through
    the model and the changes are in the view (just a guess.)
    Anyway, if anybody could direct me onto the right path: how to retrieve the values typed in the form,
    or if it is possible at all in the JEditorPane, I would greatly appreciate.
    thanks
    maciej
    PS. I have seen the answer to a similar question posted some time last year. However, I am trying
    to find a soultion which allows forms/surveys to be built by people who have no java and only basic
    html knwledge. And Axualize way is probably a little bit too "high-tech."

    Maybe helpful for u.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.Container;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    public class TestHtmlInput extends JFrame {
         JEditorPane pane=new JEditorPane();
         public TestHtmlInput() {
              super();
              pane.setEditorKit(new HTMLEditorKit());
              pane.setText("<HTML><BODY><FORM>" +
              "<p>1.Input your name.</p>" +
              "<INPUT TYPE='text' name='firstName'>" +
              "<p>2.Input your information.</p>" +
              "<TEXTAREA rows='20' name='StationDescriptions' cols='100'>" +
              "<p>3.Pick ONLY one.</p>" +
              "<input type='radio' name='thing' value='0' Checked> NO choice <BR>" +
              "<input type='radio' name='thing' value='1'> First choice <BR>" +
              "<input type='radio' name='thing' value='2'> Second Choice <BR>" +
              "<p>4.Pick all you like.</p>" +
              "<input type='checkbox' name='stuff' value='A'> A <BR>" +
              "<input type='checkbox' name='stuff' value='B'> B <BR>" +
              "<input type='checkbox' name='stuff' value='C'> C <BR>" +
              "<p>5.Choose your nationality.</p>" +
              "<select name='natio'>" +
              "<option>12</option>" +
              "<option selected>13</option>" +
              "</select>" +
              "</FORM></BODY></HTML>");
              this.getContentPane().add(new JScrollPane(pane));
              JButton b=new JButton("print firstName text");
              b.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        System.out.println("Number of Components in JTextPane: " + pane.getComponentCount());
                        for (int i = 0; i <  pane.getComponentCount(); i++) {
                             //NOTE FOR BELOW: know its a Container since all Components inside a JTextPane are instances of the inner class
                             //ComponentView$Invalidator which is a subclass of the Container Class (ComponentView$Invalidator extends Container)
                             Container c = (Container)pane.getComponent(i);
                             //the component of this containers will be the Swing equivalents of the HTML Form fields (JButton, JTextField, etc.)
                             //Get the # of components inside the ComponentView$Invalidator (the above container)
                             Component swingComponentOfHTMLInputType = c.getComponent(0);
                             //each ComponentView$Invalidator will only have one component at array base 0
                             //DISPLAY OF WHAT JAVA CLASS TYPE THE COMPONENT IS
                             System.out.println(i + ": " + swingComponentOfHTMLInputType.getClass().getName());
                             //this will show of what type the Component is (JTextField, JRadioButton, etc.)
                             if (swingComponentOfHTMLInputType instanceof JTextField) {
                                  JTextField tf = (JTextField)swingComponentOfHTMLInputType;
                                  //downcast and we have the reference to the component now!! :)
                                  System.out.println("  Text: " + tf.getText());
                                  tf.setText("JTextField found!");
                             } else if (swingComponentOfHTMLInputType instanceof JButton) {
                             } else if (swingComponentOfHTMLInputType instanceof JComboBox) {
                                     JComboBox combo = (JComboBox)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected index: " + combo.getSelectedIndex());
                                } else if (swingComponentOfHTMLInputType instanceof JRadioButton) {
                                     JRadioButton radio = (JRadioButton)swingComponentOfHTMLInputType;
                                     System.out.println("  Selected: " + new Boolean(radio.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JCheckBox) {
                                     JCheckBox check = (JCheckBox)swingComponentOfHTMLInputType;
                                     check.setSelected(true);
                                     System.out.println("  Selected: " + new Boolean(check.isSelected()).toString());
                             } else if (swingComponentOfHTMLInputType instanceof JScrollPane) {
                                  JScrollPane pane = (JScrollPane)swingComponentOfHTMLInputType;
                                  for (int j=0; j<pane.getComponentCount(); j++) {
                                       //JTextArea area = (JTextArea)swingComponentOfHTMLInputType.getComponent(0);
                                       Container c2 = (Container)pane.getComponent(j);
                                       for (int k=0; k<c2.getComponentCount(); k++) {
                                            Component c3 = (Component)c2.getComponent(k);
                                            if (c3 instanceof JTextArea) {
                                                 JTextArea area = (JTextArea)c3;
                                                 System.out.println("  " + area.getClass().getName());
                                                 System.out.println("     Text: " + area.getText());
                                                 area.setText("JTextArea found!");
                             } else {
              this.getContentPane().add(b,BorderLayout.SOUTH);
         public static void main(String args[]) {
              TestHtmlInput app = new TestHtmlInput();
              app.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              app.setSize( 400, 900 );
              app.setVisible( true );
    }

  • In JEditorPane the links in HTML file are not working

    hi,
    I am using JEditorPane to dispaly HTML file.
    In the html files there are some links to some other pages.
    The JEditorPane is showing the links but it didn't work when i click.
    Is there any Events which i have to add?

    Try posting in the Mac Number forum.
    https://discussions.apple.com/community/iwork/numbers
    Also, specify the version of Numbers you are using.

  • Space after hyperlink in JEditorPane

    Hi all!
    I am displaying an html document in a JEditorPane, which has some hyperlinks. Everything is wotking, except that all the hyperlinks have an extra space after the text which is underlined and is a part of the hyperlink.
    I saw this problem in the bug database but marked as closed. However I still have this problem using jdk 1.4.1.
    http://developer.java.sun.com/developer/bugParade/bugs/4303958.html
    Thanks in advance for your help!

    I'm sorry but I posted this by mistake. The topic is duplicated, but the other one has the subject corrected and has duke dollars assigned.

  • Urgent-- Display a MS Word document in a JEditorPane

    Hi All, When i try to display the contents of MS word document using a JEditorPane, certain junk value gets displayed before and after the actual text... can i get any help...
    Thanx in advance...

    Desktop.open(File)
    And as an aside, you are lucky I am so bored. Usually I would close a post offering just one Duke, without any reply.

  • JeditorPane text selection problem due to line feeds and carriage returns

    Hi folks,
    I have a jEditorPane (text/plain) that contains a document in which the user has highlighted some text. I want to pull the selected text from the pane, do some processing on it, and then put the altered text back in the same position.
    First I get the starting and ending position of the highlighted text
    int mySelStart = myJEditorPane.getSelectionStart();
    int mySelEnd = myJEditorPane.getSelectionEnd();Then I get all the text from the pane and (in theory) strip out the portion the user highlighted
    String myPaneText = myJEditorPane.getText();
    String mySelectedText = myPaneText.substring(mySelStart,mySelEnd);But the text string in mySelectedText never matches what the user originally highlighted. The starting and ending positions are off by the number of carriage returns that proceed the highlighted text in the document. It appears that while in the jEditorPane Java treats the carriage return as one characters, but once the info is in the myPaneText field Java treats the carriage return as two characters.
    Has anyone encountered this before? Am I doing something wrong? To fix the problem I'm looping through the entire document to find out how many carriage returns proceed the highlighted text, but there has to be an easier way.
    Thanks

    It appears that while in the jEditorPane Java treats the carriage return as one
    characters, but once the info is in the myPaneText field Java treats the carriage
    return as two characters.Correct on a Windows platform. Check out my posting here for a one line solution:
    http://forum.java.sun.com/thread.jspa?forumID=31&messageID=1464594

  • JEditorPane with automated linewrapping and no horizontal scroll bar.

    Hello.
    I am working with a JEditorPane which is added insisde a JScrollPane, the thing is that i want to have
    [1]Automatic line wrapping, although this works good with the method .setText(String str) i am not using that method, instead of that i prefer to have an HTMLDocument object inside the JEditorPane and use the method insertBeforeEnd(...) . When i do that, i do not have automatic line wrapping.
    [2]Not having that line wrapping means that i see an ugly scroll bar in the horizontal position, which i want to avoid, since this is for an IM application.
    Before i used a JTextArea with the method .setLineWrap(true) and everyghing was ok, so is there any way to do the same in a JEditorPane with an HTMLDocument? Any help will be apreciated.
    Thanks

    But what i want to do is ....Well instead of telling us what you want to do, why don't you post a 20 line executable demo program that shows us exactly what you are doing and what the problem is. A picture is worth a thousand words.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

  • Render html form & send forms's input values as params via HTTP POST

    Hello,
    I'm using appache commons http client to send HTTP post queries to a given url and receive HTTP response then process it.
    one of the requirements of my Application is the following: one of these HTTP Post requests is supposed to return an HTML form with different html types (text filed, text area etc..) that i will need to display in my swing application. one important requirement is that i can't know in advance what the html form field types will be.. it depends on a given parameters that my application send as part of HTTP Post method (using apache http client).
    I Longly searched for a simple solution to this problem . There are many solutions but each one has it's limitations :
    1-i can render the html form inside a JEditorPane .but how can I collect the user entered data inside JEditorPane ? i'm not sure this swing component offers the capability to detect its html contents and more it will be difficult to know what are the values entered by user inside html form rendered by JEditorPane.
    2-are there any Java Embedded browsers that offer some API to enable me detect the html form fields ,capture the data entered by user inside the html form ?
    3-the solution i currently opted for is : parse html & convert html form to swing dialog. currently this solution i use works well but the cost of implementing it is high : it involves difficult parsing logic. this makes me worried .I'm not sure if i'm now using the right & easiest solution.
    I need some advice on What is the simplest and clean solution to render a html form & yet be able to collect user entered inputs & send the user input values as params via java HTTP POST request ?

    dragzul wrote:
    In my opinion, your actual solution is what you need to do. You're trying to "merge" two different kinds of view. Actually, the "easiest" way may be: if you have your data to display, you decide to show it on html or swing.Yes i believe that my current solution may be the unique one for my special requirements. when doing research about this problem i found a multitude of java libraries to convert xml to swing (ex: www.swixml.org) .However i was surprised there are no java libraries to convert HTML forms to swing dialogs -as far as i know-. this is a bit strange. The Limitation is that the developers of the server API are not Java guys and are reluctant to use an xml format that i can easily convert to swing . probably they have their own reasons as they might be using the HTML Response for some other server side work. So I was obliged to deal with an HTML stream that i need to display in my client application and process its data. in my opinion the only way to do this is by developing a HTML form to swing converter package. that's what i did now. i was only worried if i'm complicating things and if there are some easier solutions to this issue.
    thanks

  • /n problem with JEditorPane

    I wonder if anyone can help. I am developing an editor to edit java programs. I have a compile and run button as you would expect. When I compile the program in my editor, if I have an error I wish to highlight the line. I am using the select(int, int) method where the first int is the starting position and the second int is the ending position in the JEditorPane. The problem is that my editor takes into account the /n charachter wheras if I create a java program in any other editor and load it up in my editor, the /n is ignored. So you can see that I will have different starting and ending positions depending on where the java file was created. Can anyone help??

    no-one seems to understand the problem.You are absolutely right because I still have no idea what you are doing. In your latest post, you are copying the contents of the JEditorPane into a JTextArea just so you can figure out where the line starts and stops. Since you only posted a snippet of code, I can tell you that the following two lines look suspicious:
    values[0] = tx.getLineStartOffset(lineNo - 1) - lineNo;
    values[1] = tx.getLineEndOffset(lineNo - 1) - lineNo;
    because I can see no reason for subtracting lineNo to the start and end offsets!
    Again, your answer can be found at the link shown below:
    http://forum.java.sun.com/thread.jsp?thread=482553&forum=57&message=2251721
    Since you couldn't figure out how to solve you problem, I'll elaborate:
    For a JTextPane/JTextPane, you use the javax.swing.text.Utilities.getRowStart (instead of getLineStartOffset) and javax.swing.text.Utilities.getRowEnd (instead of getLineEndOffset) methods to get the start and end offsets. If you looked at the documentation, you'll see that all you needed to do is set the initial value of the second argument of the getRowEnd method to 0 (or the very first character of your JTextComponent) and iterate until you find the info you're looking for. For example:
    int line=1;
    int start=0,stop=-1;
    while (line<lineNo) {
       try {
          stop=javax.swing.text.Utilities.getRowEnd(editor,start);
          start+=stop;
          line++;
       } catch (BadLocationException e) {
          stop=-1;
    System.out.println(start+" "+stop);   // if stop is -1 or line!-lineNo, you've got a problem;o)
    V.V.

  • JEditorPane html

    I have a simple JEditorPane set up so that I can view source code and rendered version of an html page. I toggle between rendered and source view by setting the content type:
    setContentType("text/plain") - displays source code
    setContentType("text/html") - dispalys the rendered view
    The problem I have is with offsets. It would be natural to me that the first letter in the rendered view starts at 0 and ends at 1. That's not the case however. In any test page I have, the first letter has offset 3-4. The same things happen inside the text as well. When I count offsets by hand, they are different that what getSelectionStart() and getSelectionEnd() show.
    I'm assuming that there must be some characters that get rendered by JEditorPane but don't get displayed - but quite frankly I have no clue as to why it's happening.
    Any ideas would be appreciated. I wrote a simple algorithm (irrelevant to this post) that uses the rendred view offsets to mark things in the source view, but since my rendered view offsets are screwed up - I'm not able to mark things properly.
    Thanks
    M

    Have you tried displaying the characters between offsets 0-2 ? It could give you an idea of what it concerns...

  • Problem with Hyperlink  in JEditorPane!!

    hi all!
    I have some problem.
    I create html page with hyperlink to myProgram.jar and when i open this html page in JEditorPane and click on hyperlink i have the some text but my program don't run.
    How write HyperlinkListener for run the my program and setUrl for open other html pages.
    thanks!

    In the future, Swing related questions should be posted in the Swing forum.
    But, there is no need to repost the question because you can just read the JEditorPane API to find an example of how to write a HyperlinkListener.

  • S�ace after hyperlink in JEditorPane

    Hi all!
    I am displaying an html document in a JEditorPane, which has some hyperlinks. Everything is wotking, except that all the hyperlinks have an extra space after the text which is underlined and is a part of the hyperlink.
    I saw this problem in the bug database but marked as closed. However I still have this problem using jdk 1.4.1.
    http://developer.java.sun.com/developer/bugParade/bugs/4303958.html
    Thanks in advance for your help!

    I'm sorry but I posted this by mistake. The topic is duplicated, but the other one has the subject corrected and has duke dollars assigned.

Maybe you are looking for