Event in jeditor pane

i am using jeditorpane for displaying webpages(with method jeditorpane.setPage(url))
Is there any event that can tell me when the webpage has loaded fully?

I did something similar using a popupmenu which displays at the caret position.
Point point = myEditorPane.getCaret().getMagicCaretPosition();
int x = (int)point.getX();
int y = (int)point.getY();
popup.show(myEditorPane, x, y);

Similar Messages

  • Jeditor pane cut, copy, paste

    I have an applet using jeditor panes. when you right click a popup shows and you can choose to cut, copy, paste, select all. I use the functions copy, cut, paste, selectAll which jeditorpane inherits. This works properly in java 1.3X but in java 1.41 it is not working. Is there cliboard communication problems with java 1.41?

    Hi dhhyde,
    If you are having issues with your cutting, copying and pasting items from your iPad, you may want to try some things to troubleshoot.
    First, quit all running applications and test again -
    iOS: Force an app to close
    Next, I would try restarting the iPad -
    Turn your iOS device off and on (restart) and reset
    If the issue is still present, you may want to restore the iPad as a new device -
    How to erase your iOS device and then set it up as a new device or restore it from backups
    Thanks for using Apple Support Communities.
    Best,
    Brett L  

  • JEditor pane does not look like the explorer.

    Hi
    I would like to display the following htmlc ode on JEditor pane.
    I want to have two lists of assets and a title to each one.
    the problem is that one of the titles (the second one) does not displayed in the same location as the first one (It displayes ans if it is part of the list)
    I copies the code to a htm page and it looks fine on my explorer.
    I will be happy if you will tell me what is wrong in the html code.
    thanks
    Liat
    JEditorPane summeryMessagePane;
    summeryMessagePane=new JEditorPane("text/html","");
    //html string
    String text="<html><body><font face = Verdana size =2 color=black>The following files were defined successfully:<li><font face = Verdana size =2 color=black>/LDRS/mummy2_opt8_pal_2500kbps_10m_l2_ar128kbps.m1s.mpg</font></li><li><font face = Verdana size =2 color=black>/LDRS/nely_opt2_10m_pal_1860kbps_l2_128kps.m1s.mpg</font></li><br>The definition for the following files failed:<li><font face = Verdana size =2 color=black>/LDRS/mummy2_opt8_pal_2500kbps_10m_l2_ar128kbps.m1s.mpg.meta</font></li><font face = Verdana size =2 color=black>Unsupported asset format.<li><font face = Verdana size =2 color=black>/LDRS/nely_opt2_10m_pal_1860kbps_l2_128kps.m1s.mpg.meta</font></li><font face = Verdana size =2 color=black>Unsupported asset format.</font></body></html>"
    //set the string
    summeryMessagePane.setText(text.toString());
    JScrollPane scrollPane = new JScrollPane(summeryMessagePane);
            add(scrollPane,BorderLayout.CENTER);

    What ever gave you the idea that HTML display on JEditorPane would look exactly like in IE?
    JEditorPane only supports HTML 3.2 (but no frames, I think), some CSS 1 and no Javascript. It's very far from being useful for displaying modern web pages.
    Furthermore....
    <font face = Verdana size =2 color=black>
    Bad bad bad bad bad HTML format. You are supposed to always quote tag attribute values:
    <font face="Verdana" size="2" color="black">

  • ANYONE CAN HELP IN JEDITOR PANE!!Help

    I am displaying the HTML form inthe Jeditor Pane..It is working,but the only problem now is when i embed flash inside HTML ,it output shown symbol ??\How to overcome this

    Thanks DR>CLAP for ur solution,Do u have any alternative plan for this

  • Issue with JEditor Pane

    Hello,
    I am trying to set a html page(which is converted from MS Word ) to a jeditorpane.The page loads fine but the hyperlinks doesn't work,they dont redirect to the appropriate topic.Its just a single page.It works fine as an individual html page but not with JEditorPane.
    Any clues,
    thanks
    Sree.

    sreecs wrote:
    The links are just table of contents in a MS Word.
    Coming from MS Word, I wonder if it's some flavor of non-standard HTML.then they shouldn't work in a standard html page too..why only when in a jeditor pane??
    thanks,
    Sree
    Edited by: sreecs on Nov 11, 2008 3:52 PMActually, MS Word-generated HTML often works fine in browsers, especially Internet Explorer. But everybody knows that it generates garbage for HTML (at least it used to, don't know about Office 2007). Browsers often go to great lengths to "get the gist" of non-compliant HTML and still render it properly (again, especially IE, which has been a criticism of web standards folks forever).
    JEditorPane has very simplistic HTML rendering support, and probably doesn't take much stuff that is non-standard. While it wasn't your problem, I am sure you could use pretty easily use Word to generate HTML that JEditorPane couldn't render properly.

  • Clicking on a line of text in JEditor Pane - how ?

    I have a line of (String) text which is displayed in a JEditorPane - I want to be able to click on the line of text (add a event handler/listener to it ?) which would then display some text in another jeditorPane.
    However, i cant seem to find anyway of adding a listener to a line of text and making it 'clickable' ?
    BTW i dont need to use a JEditorPane, I've only done so as i originally thought id use html to format the text.

    far left of the address bar - although depending on Safari version (which is what?) yours may be different.
    Please could you include a screenshot of what shows up & where.

  • Focus event with JTabbed pane

    How do I set FocusListener to fire with I select a specific tab in a JTabbed pane? If I put the FocusListener on the Tabben pane it fires rquardless of which tab I select and if I try to use an if statement to single out a specific tab nothing happens.

    If you are interested in listening to when a tab is selected you can use a ChangeListener:
    JTabbedPane tab = ...
    tab.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            // get the selected tab-index:
            int index = ((JTabbedPane)e.getSource()).getSelectedIndex();
    });Btw, Swing related posts should be posted in the Swing forum.

  • Html in JEditor pane (again)

    I know there are already loads of posts about this on the site (and I have hunted through them), but my problem is (I hope) different.
    I am trying to take an html string which was created by transforming some xml using xsl and setting it in a JEditorPane.
    I do the standard
    _MessageArea.setContentType("text/html");
    _MessageArea.setText(sMsg);where _MessageArea is the editor pane and sMsg is the string of the html.
    When I do getText() on the pane though I get
    <paragraph>
      <head>
      </head>
      <body>
        <p>
        </p>
      </body>
    </paragraph>My only guess is this has something to do with the new lines (hex 0D0A) produced by the xsl mapping which are after most of the tags?
    thanks
    for any help!

    The problem is that when I do
    setText(sMsg)
    sMsg=
    <html><body><div align="left"><table border="0" width="680"><tr><td width="320">TO:</td>
    <td width="340">WILLS SECURITIES EUROPE LTD</td>
    </tr>
    <tr><td width="320">ATTN:</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">FAX#:</td>
    <td width="340">90081355122800</td>
    </tr>
    <tr><td width="320">FROM:</td>
    <td width="340">XXXXX ASSET MANAGEMENT INTL LTD</td>
    </tr>
    </table>
    </div>
    <p>  </p>
    <div align="left"><table border="0" width="680"><tr><td colspan="2"><b><p align="center">PURCHASE (SALE) ADVICE</p>
    </b>
    </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Function of message</td>
    <td width="340">NEW</td>
    </tr>
    <tr><td width="320">Transaction reference</td>
    <td width="340">0061055</td>
    </tr>
    <tr><td width="320">Related transaction number</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Trade Date</td>
    <td width="340">20020612</td>
    </tr>
    <tr><td width="320">Settlement Date</td>
    <td width="340">20020612</td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Safekeeping account</td>
    <td width="340">Safe4</td>
    </tr>
    <tr><td width="320">Place of safekeeping</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Security Identification</td>
    <td width="340">JP3336600006</td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Quantity of shares</td>
    <td width="340">5000.000000</td>
    </tr>
    <tr><td width="320">Price</td>
    <td width="340">JPY5500.0000000000</td>
    </tr>
    <tr><td width="320">Gross Consideration</td>
    <td width="340">JPY27500000.0000</td>
    </tr>
    <tr><td width="320">Commission</td>
    <td width="340">JPY68750.0000</td>
    </tr>
    <tr><td width="320">Stamp Tax</td>
    <td width="340">JPY0.0000</td>
    </tr>
    <tr><td width="320">Local fees</td>
    <td width="340">JPY0.0000</td>
    </tr>
    <tr><td width="320">Other fees</td>
    <td width="340">JPY0.0000</td>
    </tr>
    <tr><td width="320">Charges</td>
    <td width="340">JPY0.0000</td>
    </tr>
    <tr><td width="320">Accrued Interest</td>
    <td width="340">JPY0.0000</td>
    </tr>
    <tr><td width="320">Net consideration</td>
    <td width="340">JPY27500000.0000</td>
    </tr>
    <tr><td width="320">FX instructed</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Deliverer / receiver</td>
    <td width="340">DAIWA SECURITIES</td>
    </tr>
    <tr><td width="320">CSD account number</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Beneficiary</td>
    <td width="340">DAIWA SEC SMBC E</td>
    </tr>
    <tr><td width="320">Account number</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Further beneficiary</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Account Number</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Further beneficiary</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Account Number</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Place of settlement</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320">Additional Information</td>
    <td width="340"> </td>
    </tr>
    <tr><td width="320"> </td>
    <td width="340"> </td>
    </tr>
    <tr><td colspan="2">Best Regards</td>
    </tr>
    </table>
    </div>
    </body>
    </html>but when I do getText() I get the paragraph nonsense!

  • JEditor pane not showing images

    the following piece of code displays a directory and the link displays all the files ,if it is an image it shows the preview but actually i am not getting the image ,can any one help me?
    thanks
    code:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.io.*;
    import java.util.Date;
    * This class implements a simple directory browser using the HTML
    * display capabilities of the JEditorPane component.
    public class FileTableHTML {
      public static void main(String[] args) throws IOException {
        // Get the name of the directory to display
        String dirname = (args.length>0)?args[0]:"C://Documents and Settings//400305//My Documents//SyncIT";
        // Create something to display it in.
        final JEditorPane editor = new JEditorPane();
        editor.setEditable(false);               // we're browsing not editing
        editor.setContentType("text/html");      // must specify HTML text
        editor.setText(makeHTMLTable(dirname));  // specify the text to display
        // Set up the JEditorPane to handle clicks on hyperlinks
        editor.addHyperlinkListener(new HyperlinkListener() {
          public void hyperlinkUpdate(HyperlinkEvent e) {
         // Handle clicks; ignore mouseovers and other link-related events
         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
           // Get the HREF of the link and display it.
           editor.setText(makeHTMLTable(e.getDescription()));
        // Put the JEditorPane in a scrolling window and display it.
        JFrame frame = new JFrame("FileTableHTML");
        frame.getContentPane().add(new JScrollPane(editor));
        frame.setSize(650, 500);
        frame.setVisible(true);
      // This method returns an HTML table representing the specified directory
      public static String makeHTMLTable(String dirname) {
        // Look up the contents of the directory
        File dir = new File(dirname);
        String[] entries = dir.list();
        // Set up an output stream we can print the table to.
        // This is easier than concatenating strings all the time.
        StringWriter sout = new StringWriter();
        PrintWriter out = new PrintWriter(sout);
        // Print the directory name as the page title
        out.println("<H1>" + dirname + "</H1>");
        // Print an "up" link, unless we're already at the root
        String parent ="C://Documents and Settings//400305//My Documents//SyncIT";
        if ((parent != null) && (parent.length() > 0))
          out.println("<A HREF=\"" + parent + "\">Up to parent directory</A><P>");
        // Print out the table
        out.print("<TABLE BORDER=1  WIDTH=600 height=500><TR>");
        out.print("<TH>Name</TH><TH>Size</TH><TH>Modified</TH>");
        out.println("<TH>Readable?</TH><TH>Writable?</TH></TR>");
        for(int i=0; i < entries.length; i++) {
          File f = new File(dir, entries);
    out.println("<TR><TD>" +
              (f.isDirectory() ?
                        "<a href=\""+f+"\">" + entries[i] + "</a>" : "<img src=\""+f+"\">"+
              entries[i]) +
              "</TD><TD>" + f.length() +
              "</TD><TD>" + new Date(f.lastModified()) +
              "</TD><TD align=center>" + (f.canRead()?"x":" ") +
              "</TD><TD align=center>" + (f.canWrite()?"x":" ") +
              "</TD><br><br><br><br><br></TR>");
    System.out.println("<TR><TD>" +
              (f.isDirectory() ?
                        "<a href=\""+f+"\">" + entries[i] + "</a>" : "<img src=\""+f+"\" align=left width=30 height=30 border=0>"+
              entries[i]) +
              "</TD><TD>" + f.length() +
              "</TD><TD>" + new Date(f.lastModified()) +
              "</TD><TD align=center>" + (f.canRead()?"x":" ") +
              "</TD><TD align=center>" + (f.canWrite()?"x":" ") +
              "</TD><br><br><br><br><br></TR>");
    //System.out.println("<img src=\""+f.toString()+"\""+" align=left width=30 height=30 border=0"+">");
    out.println("</TABLE>");
    out.close();
    // Get the string of HTML from the StringWriter and return it.
    return sout.toString();

    just work on getting one simple image to .jar OK
    e.g. this should .jar OK (after changing image names)
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      Image img;
      public void buildGUI()
        try
          java.net.URL url = new java.net.URL(getClass().getResource("Test.gif"), "Test.gif");
          if(url != null) img = javax.imageio.ImageIO.read(url);
        catch(Exception e){}//swallow exception - handled in paintComponent
        JPanel p = new JPanel(){
          public void paintComponent(Graphics g){
            super.paintComponent(g);
            if(img != null) g.drawImage(img,100,100,this);
            else g.drawString("this space for rent",100,100);
        JFrame f = new JFrame();
        f.getContentPane().add(p);
        f.setSize(400,300);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }put the image in the same folder, make .jar, then try the .jar on another pc
    if all OK, change code to locate image file in subfolder, make .jar, then try the .jar on another pc
    if all OK now, modify main program accordingly.
    note: in .jars, capitalization of the image file names counts
    e.g. in my above example, if I change Test.gif to test.gif, the image is not drawn

  • JEditor pane does not  show applets

    HOW TO SET THE CONTENT TYPE OF THE EDITOR SO THAT IT CAN OPEN ALL
    INCLUDING APPLICATIONS AND GRAPHICS,
    IT OPENS RTF'S, HTML AND TEXT AND FILE LIST, AND EVEN WHEN SET TO IMAGE/GIF IT DOES NOT OPEN THAM

    that's true, applets are not displayed...
    Text, RTF and HTML files are displayed because the Editor Pane uses a specific 'Document' (i I remember well) to open them. To be able to display other kind of information, you could need to create your own Documents...
    vincent

  • JEditor Pane & Html links

    Hello! I'm using a JEditorpane to display a HTML page but i'm experiencing the following problem:
    * I'm using images as links but link fonctionality only appears in some parts of the image, not all over it.
    I create the html code in a String :
    String code ="<a href=""><img ...></img></a>";
    and then
    jEditorPane.setText(code);
    Do you know what is happening??
    thanks!

    I used JTextPane, and it worked correctly, the only headache was Java's HTML rendering engine, which sucks.
    Anyway, try a code like this:
    JTextPane pa=new JTextPane();
    JScrollPane scroller=new JScrollPane(pa);
    TheComponentYouWantToDisplayTheRenderer.add(scroller);
    pa.setEditable(false);
    pa.setEditorKit(pa.createEditorKitForContentType("text/html"));
    // Here you can set the page you want to display
    // Unfortunately there is no progress meter,
    // you need to work around it...
    pa.setPage("http://java.sun.com/");If you want to follow links, you have to add a HyperlinkListener to the page, like this:
    pa.addHyperlinkListener(new Hyperactive());
    class Hyperactive implements HyperlinkListener {
         public void hyperlinkUpdate(HyperlinkEvent e) {
              if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                   if (e.getSource()==null) return;
                   JEditorPane pane = (JEditorPane) e.getSource();
                   if (e instanceof HTMLFrameHyperlinkEvent) {
                        HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent)e;
                        HTMLDocument doc = (HTMLDocument)pane.getDocument();
                        doc.processHTMLFrameHyperlinkEvent(evt);
                   } else {
                        try {
                             pane.setPage(e.getURL());
                        } catch (Throwable t) {
                             //t.printStackTrace();
    }I found this code in one of the tutorials, but it was long ago, and I don't remember which was it... :-)
    After this, you shouldn't have problems. But not that the img tag doesn't need to be closed, so try
    <img src="imgsrc">
    instead of
    <img src="imgsrc"></img>

  • How to know size of HTML page set to Jeditor pane  for printing

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

  • DOES JEDITOR PANE support flash

    I am trying to embed the Flash insided the HTML to be run on editorpane but it is not workign ..anyone got idea how todo this

    Andrew J wrote:
    Flash WORKS on Mac but _Apple has stopped support for versions 8 and beyond_. It was in their securities update notes several months ago.
    Really? Can you provide a link to any statement from Apple that they officially stopped supporting Flash, other than quoting language from a previous secutiry update which in no way explicitly states that Flash won't be supported? In fact, the text you copied/pasted is the description of the vulnerability being addressed by the update you copied the text from, which in and of itself is evidence of continued support for Flash.
    Perhaps you can explain why the Security Update 2008-003/Mac OS 10.5.3, released 5/28/08, included an update of the Flash Player Plug-in to version 9.0.124.0? That update addressed the most recent security risk associated with Flash as reported on Adobe's security tracking page (dated 4/8/08).
    So, I reiterate - Apple _has not_ "dropped" support for Flash.

  • Printing a HTML doc from a JEditor Pane

    I would like to print a HTML page from a JEditorPane. I've searched trhough the web, but haven't found any free libs yet... Does anybody have some tips?

    See
    JEditorPane.setPage(URL)
    once you've done that and its rendered you should be able to print by using my StandardPrint class. Search for StandardPrint.java on this site

  • Jeditor pane, html links opening external browers

    HI,
    i have serched the web for about half a day, i have a JEditorPane that loads a web page works fine,
    only i would really like for the links they click on to open the clients default file browser??
    so not even sure if this is the right forum as it has more to do with starting up applications?
    Thanks any links, i am sure it has been done, using somthing like Runtime? but now sure what to put in the argument.
    Thanks
    David

    i found this thread but it say it is only windows???If you follow the link to java world it shows you how to do it for other platforms as well.
    Is there any way to do this instandard java?I believen JDK6 has the Desktop API which will handle this otherwise your stuck with the hack above or a 3rd party package.

Maybe you are looking for