Display FrameSet inside JEditorPane

Hello all,
I have the problem with JEditorPane, when I preview a html page with frameset. The html page contains two part
1,) Navigation links on top
2.)Body page, where anchors are used, so that when each navigation link is clicked the appropriate anchor is scrolled down in the JEditorPane.
     editorPane.addHyperlinkListener(new HyperlinkListener() {
     public void hyperlinkUpdate(final HyperlinkEvent e) {
          try{
          URL url = e.getURL();
     JEditorPane src = (JEditorPane) e.getSource();
src.setPage(url);
          catch(IOException io){
               io.printStackTrace();
Here the problem is the frameset is lost and the body part is previewd inside the JEditorPane. That is the navigation part is gone and it doesnt scroll down to the anchor also.
So can anyone please write how to support frameset in the JEditorPane.
Thanks
Joseph

//try this
//add this import
import javax.swing.text.html.*;
// use this hyperlinkUpdate
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() != javax.swing.event.HyperlinkEvent.EventType.ACTIVATED) return;
JEditorPane editorPane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
HTMLDocument doc = (HTMLDocument) editorPane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
} else {
try {
editorPane.setPage(e.getURL());
} catch (Throwable t) {
t.printStackTrace();
}

Similar Messages

  • Problem in displaying text inside the item label - JFREECHART

    Hi All,
    I dont know whether this is the right place or not to post the queries related to jfreechart here .
    I am facing a problem in displaying the text inside the item label in jfreeChart. I am trying to print the text in 2 lines one below the other at the top of each bar in waterfall chart.
    Please find the code below in next post. The problem i am facing is it is neglecting the new line character . If any one knows how to display the text one below the other please help me out .
    Thanks in advance .
    Regards,
    Diw

    i am facing the problem in pasting the complete code as its exceeds the message text limitiation, please find the link below for the code .
    http://www.java-forums.org/java-2d/12087-problem-displaying-text-inside-item-label-jfreechart.html#post36648
    Early response will be appreciated . Thanks in advance
    Regards,
    Diw
    Edited by: Diw on Sep 30, 2008 11:15 AM
    Edited by: Diw on Sep 30, 2008 11:16 AM

  • Display popup inside applyResult method of ovs?

    Hi,
    I have implemented an object value selector for a field.
    Now what I want to do is to display a popup window when   the user selects a row inside ovs popup (ie. inside the applyResult method).
    The popup window (with ok and cancel buttons) is being displayed, but when I try to destroy it inside the event handler for a popup ok or cancel buttons, the exception gets thrown. The exception says something about No item found on the list??
    I guess it has something to do with trying to display it inside applyresult method?
    The details:
    Popup is being displayed inside applyResult method of a customController (MaterialIndexCust)
         IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("ConfirmExpandSpecWindow");
         IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
         window.setWindowPosition(WDWindowPos.CENTER);
         window.setTitle("Question");
         wdContext.currentPopupElement().setWindowInstance(window);
         window.show();
    Here's the code from the event handler which is from the same custom controller :
            IWDWindow window = wdContext.currentPopupElement().getWindowInstance();
            window.destroyInstance();
    The actual event had to be defined in another controller.
    I've tried these things with IWDConfirmationDialog as well  as my custom dialog.
    Any help is appreciated.
    Regards,
    Ladislav

    Here's the exception:
    java.util.NoSuchElementException
         at java.util.LinkedList.remove(LinkedList.java:579)
         at java.util.LinkedList.removeFirst(LinkedList.java:131)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.popModalWindow(ApplicationWindow.java:162)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doClose(WebDynproWindow.java:400)
         at com.sap.tc.webdynpro.clientserver.window.Window.doClose(Window.java:195)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handle(ApplicationWindow.java:288)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handleWindowEvents(ApplicationWindow.java:260)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:149)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:707)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:661)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:229)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

  • Need help displaying shapes inside jframe

    Hi, Im trying to display shapes inside a jframe but I cant work out why I am only getting one shape to show up, any suggestions on how I can get 2 or more shapes showing on the same jframe?, the code bellow shows what ive done so far. thank you
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.*;
    public class Draw extends JFrame
         public void paint(Graphics g)
             Graphics2D g2 = (Graphics2D)g;
             super.paint(g2);
             Rectangle2D.Double mySquare = new Rectangle2D.Double(150, 150, 50, 50);
             g2.setColor(Color.green);
             g2.fill(mySquare);
        public void paint(Graphics g)
            Graphics2D g3  = (Graphics2D)g;
            super.paint(g3);
            Rectangle2D.Double mySquare2 = new Rectangle2D.Double(100, 100, 60, 60);
            g3.setColor(Color.green);
            g3.fill(mySquare2);
         public static void main(String[] args)
              Draw p = new Draw();
              p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              p.setSize(500,500);
              p.setVisible(true);
    }

    extremely sorry
    this is the code which is compileable, accidently showed a previous version
    import javax.swing.*;
    import java.awt.*;
    import java.awt.geom.*;
    public class Draw extends JFrame
         public void paint(Graphics g)
             Graphics2D g2 = (Graphics2D)g;
             super.paint(g2);
             Rectangle2D.Double mySquare = new Rectangle2D.Double(150, 150, 50, 50);
             g2.setColor(Color.green);
             g2.fill(mySquare);
            Graphics2D g3  = (Graphics2D)g;
            super.paint(g3);
            Rectangle2D.Double mySquare2 = new Rectangle2D.Double(100, 100, 60, 60);
            g3.setColor(Color.green);
            g3.fill(mySquare2);
         public static void main(String[] args)
              Draw p = new Draw();
              p.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              p.setSize(500,500);
              p.setVisible(true);
    }Edited by: jakal121 on Nov 30, 2009 12:02 PM

  • JEditorPane extra blank when display "image inside table"

    Hi,
    I try to use the JEditorPane to view the html file. Everythings work fine except
    shows the following
    <table border="1">
    <tr><td><img src="http://somewhere/a.jpg"></td></tr>
    <tr><td><img src="http://somewhere/b.jpg"></td></tr>
    </table>It can shows out the image inside the table cell.
    But there is an "extra blank line" follow the images. This "extra blank line" is inside the table cell.
    It likes following
    [image]
    [image]
    But it supposes to be like this
    [image]
    [image]
    I try some sample code in web. It also shows the same problem. Any one have ideas and solutions?
    Thanks a lot.
    kfchu

    Worked fine for me. Here is my test program:
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    public class EditorPaneLoad extends JFrame
         public EditorPaneLoad()
              throws Exception
              FileReader reader = new FileReader("blank.html");
              JEditorPane editor = new JEditorPane();
              editor.setContentType( "text/html" );
    //          editor.setEditable( false );
              editor.read(reader, null);
              JScrollPane scrollPane = new JScrollPane( editor );
              scrollPane.setPreferredSize( new Dimension(300, 200) );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              throws Exception
              EditorPaneLoad frame = new EditorPaneLoad();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setLocationRelativeTo( null );
              frame.setVisible(true);
    }

  • Print HTML file inside JEditorPane

    Hi Guys,
    I'm trying to print the contents of a JEditorPane - actually, a html file that I read and display in that component from the underlying file system. I've had the class that manages the JEditorPane implement Printable - the following is my print() implementation:
    public int print(Graphics graphics, PageFormat pageFormat, int pageIndex)
              throws PrinterException {
              if (pageIndex > 0) {
                   return (NO_SUCH_PAGE);
              } else {
                   Graphics2D g2d = (Graphics2D) graphics;
                   g2d.translate(
                        pageFormat.getImageableX(),
                        pageFormat.getImageableY());
                   ivTextArea.paint(g2d);
                   return (PAGE_EXISTS);
    }I've got another method that gets called when a print button is clicked:
    class .... {
      PrintJob pj;
      PageFormat pf;
    private void printMe() {
               if (pj == null) {
                   pj = PrinterJob.getPrinterJob();
                   pf = pj.defaultPage();
                   pf.setOrientation(PageFormat.PORTRAIT);
              pf = pj.pageDialog(pf);
              pj.setPrintable(this, pf);
              try {
                   pj.print();
              } catch (PrinterException e) {
                   throw new RuntimeException(e);
    }Clearly I'm doing smth wrong, since only a single page gets printed and moreover the formatting is awful [text gets cut instead of moving on the next line]. Can someone help?
    Thanks much!

              if (pageIndex > 0) {
                   return (NO_SUCH_PAGE);This is why you only get a single page.
    page gets printed and moreover the formatting is
    awful [text gets cut instead of moving on the next
    line]. Can someone help?Yeah. Your best bet is either to put the editorpane in a scrollpane and just print what's visible, OR, you can take the print graphics object, convert it into a graphics2D object, and call scale on that by comparing component.getWidth/height to PageFormat.getImageableWidth/Height
    I'm attaching my StandardPrint class. It uses the pageable interface to carry the number of pages + page format as well. I'm not sure if I did the scaling here or not, but I've done it before so I know it works :-) Also, I've got methods for previewing the print, which can save a lot of paper.
    Please feel free to have and use this class, but please do not change the package or portray this as your own work
    =============================
    package tjacobs.print;
    import java.awt.*;
    import java.awt.image.BufferedImage;
    import java.awt.print.*;
    import javax.print.PrintException;
    public class StandardPrint implements Printable, Pageable {
        Component c;
        SpecialPrint sp;
        PageFormat mFormat;
        public StandardPrint(Component c) {
            this.c = c;
            if (c instanceof SpecialPrint) {
                sp = (SpecialPrint)c;
        public StandardPrint(SpecialPrint sp) {
            this.sp = sp;
        public void start() throws PrinterException {
            PrinterJob job = PrinterJob.getPrinterJob();
            if (mFormat == null) {
                mFormat = job.defaultPage();
            job.setPageable(this);
            if (job.printDialog()) {
                job.print();
        public void setPageFormat (PageFormat pf) {
            mFormat = pf;
        public void printStandardComponent (Pageable p) throws PrinterException {
            PrinterJob job = PrinterJob.getPrinterJob();
            job.setPageable(p);
            job.print();
        private Dimension getJobSize() {
            if (sp != null) {
                return sp.getPrintSize();
            else {
                return c.getSize();
        public static Image preview (int width, int height, Printable sp, PageFormat pf, int pageNo) {
            BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
            return preview (im, sp, pf, pageNo);
        public static Image preview (Image im, Printable sp, PageFormat pf, int pageNo) {
            Graphics2D g = (Graphics2D) im.getGraphics();
    //        PageFormat pf = sp.getPageFormat(pageNo);
    //        int width = im.getWidth(null);
    //        int height = im.getHeight(null);
    //        g.setColor(Color.WHITE);
    //        g.fillRect(0, 0, width, height);
    //        double hratio = height / pf.getHeight();
    //        double wratio = width / pf.getWidth();
    //        g.scale(hratio, wratio);
            try {
                   sp.print(g, pf, pageNo);
              catch(PrinterException pe) {
                   pe.printStackTrace();
            g.dispose();
            return im;
        public int print(Graphics gr, PageFormat format, int pageNo) {
            mFormat = format;
            Graphics2D g = (Graphics2D) gr;
            g.translate((int)format.getImageableX(), (int)format.getImageableY());
            Dimension size = getJobSize();
            if (pageNo > getNumberOfPages()) {
                return Printable.NO_SUCH_PAGE;
            int horizontal = getNumHorizontalPages();
            int vertical = getNumVerticalPages();
            int horizontalOffset = (int) ((pageNo % horizontal) * format.getImageableWidth());
            int verticalOffset = (int) ((pageNo / vertical) * format.getImageableHeight());
            double ratio = getScreenRatio();
            g.scale(1 / ratio, 1 / ratio);
            g.translate(-horizontal, -vertical);
            if (sp != null) {
                sp.printerPaint(g);
            else {
                c.paint(g);
            g.translate(horizontal, vertical);
            g.scale(ratio, ratio);
            g.translate((int)-format.getImageableX(), (int)-format.getImageableY());
            return Printable.PAGE_EXISTS;
        public int getNumHorizontalPages() {
            Dimension size = getJobSize();
            int imWidth = (int)mFormat.getImageableWidth();
            int pWidth = 1 + (int)(size.width / getScreenRatio() / imWidth) - (imWidth == size.width ? 1 : 0);
            return pWidth;
        private double getScreenRatio () {
            double res = Toolkit.getDefaultToolkit().getScreenResolution();
            double ratio = res / 72.0;
            return ratio;
        public int getNumVerticalPages() {
            Dimension size = getJobSize();
            int imHeight = (int)mFormat.getImageableHeight();
            int pHeight = (int) (1 + (size.height / getScreenRatio() / imHeight)) - (imHeight == size.height ? 1 : 0);
            return pHeight;
        public int getNumberOfPages() {
            return getNumHorizontalPages() * getNumVerticalPages();
        public Printable getPrintable(int i) {
            return this;
        public PageFormat getPageFormat(int page) {
            if (mFormat == null) {
                PrinterJob job = PrinterJob.getPrinterJob();
                mFormat = job.defaultPage();
            return mFormat;
    }>
    Thanks much!

  • Display Chinese in JEditorPane

    Hi,
    I've a problem in displaying Chinese characters in Applet using JEditorPane. The java codes like this:
    JEditorPane editorPane = new JEditorPane();
    editorPane.setEditable(false);
    editorPane.setContentType("text/html; charset=big5");
    try {
    URL fileURL = getURL("testfile.html"); // get URL from getCodeBase()
    displayURL(fileURL, editorPane);
    } catch (Exception e) {}
    private void displayURL(URL url, JEditorPane editorPane) {
    try {
    editorPane.setPage(url);
    } catch (IOException e) {
    System.err.println("Attempted to read a bad URL: " + url);
    If I run these codes in JFrame, the Chinese characters can display correctly. But once I convert it to JApplet, all Chinese characters are changed to some squares or some special characters. Should I have something missing from my coding or I wrote something wrong in my code? Please help. Thanks.

    Hi,
    just a guess, i think u can use setContentType to set the MIME type
    Ashish

  • Display HTML in JEditorPane

    Hi
    I am trying to display a String containing HTML text on a JEditorPane.
    I have downloaded the HTML from a webpage using sockets, and now I want to display the downloaded page. I have a project in school about sockets.
    This is why I can't use getPage(URL);
    The following is the code I am using:
    String temp = "String with HTML text"
    HTMLEditorKit htmlEdKit = new HTMLEditorKit();
    JEditorPane.setEditorKit(htmlEdKit);
    JEditorPane.setContentType("text/html");
    JEditorPane.setEditorKitForContentType("text/html", htmlEdKit);
    JEditorPane.setContentType("text");
    JEditorPane.setText(temp);
    When I run the code, all that is displaying is the raw HTML code, with all the tags. As I understand it, this is how it should be done.
    What is wrong, would appreciate some help.
    /David Mossberg

    it's not necessary to use socket but if use socket get the inputstream from it.
    in = socket.getinputstream(); //return inputstream from socket
    htmldoc = JEditorPane.getDocument(); //return the htmldoc in JEditorPane
    if(htmldoc.getlength()>0)
    htmldoc.remove(0,htmlDoc.getLength());//if the htmldoc has some content then remove it
    reader = new InputStreamReader(in);//construct a new reader from in
    JEditorPane.getEditorKit.read(reader,htmldoc,0); //read new content into the htmldoc from reader
    Hope the above code helps you.
    joney

  • Displaying XML in JEditorPane

    Hi!
    Can someone please please help me, I'm new to java and having problems. IT migh tbe simple for you guys out there but its troubling me, been tryign to sort it out but no luck yet.Hopefully someone can help me out :)
    I'm currently uing a JEditorPane to display a HTML page which works fine. But I wanted it to display a XML page. The XMLfile with its DTD and XSL file loads up correctly in IE so theres no problem with syntax of these files. All i wanted it to do is display it on a JEditorPane. Am i right in thinking that JEditorPane is the right component to use. And if not then how do i solve this problem???
    Ive used the following code to call the xml file, it compiles and displays the actual code of the XML file not the visuals. Can someone please have a look.
    import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.URL;
    import java.io.IOException;
    public class testing extends JFrame
         public testing()
         { super("Testing");
              //Create an editor pane
              JEditorPane editorPane = createEditorPane();
              JScrollPane editorScrollPane = new JScrollPane(editorPane);
              editorScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
              editorScrollPane.setPreferredSize(new Dimension(600,600));
              JPanel p = new JPanel();
              p.add(editorScrollPane);
              p.setBorder(BorderFactory.createCompoundBorder(
                                            BorderFactory.createTitledBorder("Styled Text"),
                                            BorderFactory.createEmptyBorder(20, 20, 20, 20)));
              JPanel contentPane = new JPanel();
              BoxLayout box = new BoxLayout(contentPane, BoxLayout.X_AXIS);
              contentPane.setLayout(box);
              contentPane.add(p);
              setContentPane(contentPane);
         private JEditorPane createEditorPane()
         {     JEditorPane editorPane = new JEditorPane();
         editorPane.setEditable(false);
         String s = null;
         try {
                        s =
                        "file:"
                                  + System.getProperty("user.dir")
                                  + System.getProperty("file.separator")
                                  + "directory.xml";
                             System.out.println(s);
                        URL helpURL = new URL(s);
                        displayURL(helpURL, editorPane);
                   catch(Exception e)
                   { System.err.println(" Couldn't create help URL : " + s);
                   return editorPane;
         private void displayURL(URL url, JEditorPane editorPane)
         {     try {
                             editorPane.setPage(url);
                        catch (IOException e)
                        { System.err.println("Attempted to read a bad URL : " +url);
         public static void main(String[]args)
         {     JFrame frame = new testing();
              frame.addWindowListener(new WindowAdapter()
              { public void windowClosing(WindowEvent e)
                   { System.exit(0);}
              frame.pack();
              frame.setVisible(true);
    }Thanks a lot. Would really appreciate any help.

    Hey
    Thanks for the help. I did use the XSLT transformation to ocnvert the xml into html. I used the following code :
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import java.io.*;
    public class JavaTransform1
         public static void main(String args[])
         { try
                   TransformerFactory tf = TransformerFactory.newInstance();
                   Transformer transformer = tf.newTransformer(new StreamSource(new File(args[1])));
                   transformer.transform(new StreamSource(new File(args[0])),
                   new StreamResult(new File(args[2])));
              catch(Exception e) {}
    }Then using the command prompt i typed:
    java Transform1 directory.xml directory.xsl results.html
    This creates a HTML file but for some reason its blank :s
    I'm not sure why that is, when i call the html file in the JEditorPane it loads up a blank page which is what it looks like. for some reason even though it does create a HTML file its blank and not based on the XML file. What am I doing wrong here??
    Thanks alot.
    nat :)

  • HELP!!! character display problem in JEditorPane

    hi,
    I got a headache with my program which needs to display multiple language html page in a JEditorPane. For example, if user requests a Chinese page then page is read in from an inputstreamreader using Chinese charset encoding. But what JEditorPane displays is squares and this is a very common font problem. I did everything I can
    copy font.properties.zh to font.properties
    set JEditorPane font as Font("SIMSUN",Font.PLAIN,12)
    with the bug unsolved so far.
    I am using Windows 2000/ME in UK locale.
    Anybody could help please???

    yes, the input data, for example in the case of Chinese Simpilify Character, is read in using a decoder with charset GB2312. I think I can print them out on prompt console but in a unrecognizable format.
    Anyway, I would like to reconfirm the steps I took: (Presumably I know I am going to load a Chinese page)
    1. rename font.properties.zh to font.properties
    2. set the font of JEditorPane as ("SIMSUN",Font.PLAIN,12)
    3. when try to load a Chinese page, there should be a ChangedCharSetException. extract the charset from the exception and use it to construct a new InputStreamReader.
    4. I also set the content-type of JEditorPane as something like "text/html; charset=gb2312"
    5. read in the data and parse it into a HTMLDocument instance.
    6. finally use setDocument method to display the document on the JEditorPane.
    In this way, the page gets displayed in unknown characters.
    Anybody could show me something different but feasiable? Please!!!

  • How to display everything inside a canvas on a new HTML page

    Hi, im trying to display images, words and everything inside a canvas on a new HTML page. By a click of a button, a new window with HTML page will pop up display the canvas. Can anyone help me?

    Apps and other media from iTunes can only be used with the account they were bought with.

  • Displaying URL in JEditorPane

    Hi,
    I am trying to display a Webpage in a SWING Application, using the following code:
    try {
    htmlPane = new JEditorPane();
    htmlPane.setEditable(false);
    htmlPane.setContentType("text/html");
    URL url = new URL("http://www.google.co.uk/index.html");
    htmlPane.setPage (url);
    scrollPane = new JScrollPane(htmlPane);
    } catch (IOException ioe) {
    System.out.println("Cant build html pane");
    I get the following error:
    Cant build html pane
    java.lang.NullPointerException
    void gov.ons.alp.SplitPane.<init>()
    SplitPane.java:121
    void gov.ons.alp.ApplicationMain.<init>()
    ApplicationMain.java:43
    void gov.ons.alp.ApplicationMain.main(java.lang.String[])
    ApplicationMain.java:158
    Several people have posted this topic before but solutions have been posts to links to URL pages, which no longer exsist!! great!
    Any help appreciated.
    Thanks.
    P.s. the webpage won't be google - it will be a page on our server, however I was just trying to test it with google.

    It would help if you did "ioe.printStackTrace();" instead of dropping the exception and doing "System.out.println("Cant build html pane");"
    try this, I posted this some time ago, and it should work:
    import java.awt.BorderLayout;
    import java.io.IOException;
    import java.net.URL;
    import javax.swing.JEditorPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    public class HtmlViewer extends JPanel
      private JEditorPane editorPane;
      public HtmlViewer()
        super(new BorderLayout());
        this.editorPane = new JEditorPane();
        this.editorPane.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(this.editorPane);
        this.add(scrollPane, BorderLayout.CENTER);
      public HtmlViewer(URL url) throws IOException
        this();
        this.setURL(url);
       * Method setURL.
       * @param url
      public void setURL(URL url) throws IOException
        this.editorPane.setPage(url);
    }

  • Displaying Chinese in JEditorPane (in Linux)

    Hi,
    I'm writing a application in Linux OS(Redhat 7.2) which need to use JEditorPane to load some HTML pages. These HTML pages will have some content are chinese characters. When I use JEditorPane to load these pages, it only has some rectangle and cannot display chinese characters. How can I do this? I can use the Mozilla in Linux to see those pages correctly (with Big5 encoding). Thanks for all help.

    The boxes indicate that you haven't got the correct fontset for java to display in Chinese.
    I had a similar problem displaying Japanese, and one solution is to alter the font properties file to point to one of my Windows Japanese character font sets.
    If you try running your program on a Chinese Linux or Chinese Windows box, you'll probably find that it works OK.

  • Display powerpiont in JEditorPane

    I need small help. I want to display PowerPint presentation in my JEditorPane. Any Suggestions?

    Do you have any sample code for that?
    Thanks
    --Voonnab                                                                                                                                                                                                           

  • Display ListObject inside a List in

    Hi,
    is it possible to display the elements of a list object in the frontend?
    I use jsf 2.0.
    Code of Bean:
    package list;
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.bean.ManagedBean;
    @ManagedBean(name="list")
    public class ListB implements Serializable{
         //private data
         private List<ListDo> listDo;
         private int size;
         private List<String> testList;
         //Constructor
         public ListB(){
              listDo = new ArrayList<ListDo>();
              ListDo listDo1 = new ListDo(0);
              ListDo listDo2 = new ListDo(1);
              ListDo listDo3 = new ListDo(2);
              ListDo listDo4 = new ListDo(3);
              listDo.add(listDo1);
              listDo.add(listDo2);
              listDo.add(listDo3);
              listDo.add(listDo4);
              testList = new ArrayList<String>();
         testList.add("Mango");
         testList.add("Apple");
         testList.add("Banana");
         //getter setter
         public List<ListDo> getListDo() {
              return listDo;
         public void setListDo(List<ListDo> listDo) {
              this.listDo = listDo;
         public int getSize() {
              return size;
         public void setSize(int size) {
              this.size = size;
         public List<String> getTestList() {
              return testList;
         public void setTestList(List<String> testList) {
              this.testList = testList;
    DataObject
    package list;
    public class ListDo {
         private int index;
         public ListDo(int index){
              this.index = index;
         public int getIndex() {
              return index;
         public void setIndex(int index) {
              this.index = index;
    XHTML:
    <html xmlns="http://www.w3c.org/1999/xhtml"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:p="http://primefaces.prime.com.tr/ui"
         xmlns:c="http://java.sun.com/jsp/jstl/core"
         xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
    <title>index</title>
    </h:head>
    <h:body>
    <h1>List</h1>
    <c:forEach var="listDo" items="#{list.listDo.index}">
    ListDo-Size: <h:outputText value="#{listDo}" />
    </c:forEach>
    <h1>ListTest</h1>
    <c:forEach var="test" items="#{list.testList}">
    ListObjects: <h:outputText value="#{test}" />
    </c:forEach>     
    </h:body>
    </html>
    ListTest is displayed correctly.
    But i need to display the elements inside the ListDo object. (List)
    Thanks

    Hi,
    is it possible to display the elements of a list object in the frontend?
    I use jsf 2.0.
    Code of Bean:
    package list;
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    import javax.faces.bean.ManagedBean;
    @ManagedBean(name="list")
    public class ListB implements Serializable{
         //private data
         private List<ListDo> listDo;
         private int size;
         private List<String> testList;
         //Constructor
         public ListB(){
              listDo = new ArrayList<ListDo>();
              ListDo listDo1 = new ListDo(0);
              ListDo listDo2 = new ListDo(1);
              ListDo listDo3 = new ListDo(2);
              ListDo listDo4 = new ListDo(3);
              listDo.add(listDo1);
              listDo.add(listDo2);
              listDo.add(listDo3);
              listDo.add(listDo4);
              testList = new ArrayList<String>();
         testList.add("Mango");
         testList.add("Apple");
         testList.add("Banana");
         //getter setter
         public List<ListDo> getListDo() {
              return listDo;
         public void setListDo(List<ListDo> listDo) {
              this.listDo = listDo;
         public int getSize() {
              return size;
         public void setSize(int size) {
              this.size = size;
         public List<String> getTestList() {
              return testList;
         public void setTestList(List<String> testList) {
              this.testList = testList;
    DataObject
    package list;
    public class ListDo {
         private int index;
         public ListDo(int index){
              this.index = index;
         public int getIndex() {
              return index;
         public void setIndex(int index) {
              this.index = index;
    XHTML:
    <html xmlns="http://www.w3c.org/1999/xhtml"
         xmlns:f="http://java.sun.com/jsf/core"
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:p="http://primefaces.prime.com.tr/ui"
         xmlns:c="http://java.sun.com/jsp/jstl/core"
         xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
    <title>index</title>
    </h:head>
    <h:body>
    <h1>List</h1>
    <c:forEach var="listDo" items="#{list.listDo.index}">
    ListDo-Size: <h:outputText value="#{listDo}" />
    </c:forEach>
    <h1>ListTest</h1>
    <c:forEach var="test" items="#{list.testList}">
    ListObjects: <h:outputText value="#{test}" />
    </c:forEach>     
    </h:body>
    </html>
    ListTest is displayed correctly.
    But i need to display the elements inside the ListDo object. (List)
    Thanks

Maybe you are looking for

  • MS Office attachments won't open from external sources in Office 2013

    I have a client who is having an issue with MS Office attachments (.docx, .xlsx, .pptx) not opening.  The error message is "[Office program] experienced an error trying to open the file".  This is Office Pro Plus 2013 (no SP) on Win 7 SP1 x64. There

  • Storage controller driver for 4TB SATA drive

    Hi, I am having trouble initializing a brand new 4TB SATA drive (Seagate Barracuda 3.5") . I am connecting it to my HP Envy 17 (Windows 7 64-bit) through a USB 3.0 hard drive dock for backup purposes only. Initialised it using GPT but nevertheless it

  • Error in Create Views

    Hi All, Create view is giving the following error : com.waveset.exception.ItemNotFound. Below is the code as well the error in the trace....please suggest how to find the exact error and the error in the code: <Action id='1' name='Create Views' appli

  • Flat File with multiple record types (OWB 10.2.0.2)

    Hi! I`m using OWB 10.2.0.2 and I`m trying to load a flat file with multiple record types, using SQL LOADER. In the flat file editor in the Record tab, I`ve set the type values and the corresponding record names like this: Type Value Record Name =====

  • Replace AMD motherboard with a Intel motherboard????

    I have a DV9000 that has a AMD board with the bad video. This is the second motherboard and I'm done with this board. My question.... Is there a Intel version that will fit in this case? What motherboard number?