Preferred size of JEditorPane/ HTML page

Hi,
I've loaded an HTML page in a JEditorPane. Since I'm using a layout manager with absolute positioning, I need to know the pane's preferred size.But the preferred size I get is just about (6, 6), although it has a big picture in it. I tried validate() first or to add it with (1,1) to have it set up properly (visible etc.) and then resize it afterwards, but it had no effect. Is there a way to get a preferred size of an HTML page?
Thanks a lot.
Greets
Puce
Note: Using another layout manager is not a option, since this is a very specialized task.

I could use this as well. I'm tiling JEditorPanes vertically inside a JPanel using BoxLayout. The problem is that I need to limit the width of the panel, so I need to adjust the sizes accordingly. Any suggestions? I'll give another duke...
Max

Similar Messages

  • How to reduce size of generated html page?

    Hi,
    Is there an option in oc4j which will remove unneeded white space from the html generated by a jsp page? I have jsp page which generates a html page of 120kb (lots of lines containing only spaces). Formatting this html page using tidy results in an html page of 20kb. (considering that normal modems achieve about 5kb/s downloading these spaces could take about 20 seconds).
    I've tried setting the reduce_tag_code option to true but this didn't help. Are there any options in oc4j which might help?
    Thanks,
    Andrej

    Hi,
    Is there an option in oc4j which will remove unneeded white space from the html generated by a jsp page? I have jsp page which generates a html page of 120kb (lots of lines containing only spaces). Formatting this html page using tidy results in an html page of 20kb. (considering that normal modems achieve about 5kb/s downloading these spaces could take about 20 seconds).
    I've tried setting the reduce_tag_code option to true but this didn't help. Are there any options in oc4j which might help?
    Thanks,
    Andrej

  • How to get the HTML page size displayed in JEditorPane

    Hi All,
    I'm using a JEditorPane object in order to view/display an HTML page. The nature fo my program is that it does not know the size of the page in advance, but only on runtime. I'd like to get the size of the HTML page in order to determine the frame size according to the size of the HTML page.
    Is there a way to get the size of the HTML page from the JEditorPane?
    Thanks.

    after displaying the page in your editor pane you can get the diamension for the page by calling
    JComponent class method getSize();
    actually your question is not so clear
    use the JScroll pane then you don't need to worry about the size of the page.

  • Size of the "Precalculated HTML pages"?

    Hi Everybody,
        What will be the size of the "Precalculated HTML pages"?
    I downloaded the Precalculated HTML pages from the BW server to my DESKTOP using the BEX Download Scheduler,and the size of the Html pages are 0 KB.
    can any body tell what is going wrong?
    Waiting for reply,
    Thank's in advance
    Bhaskar

    Hi,
      Can you please recall it.Do you installed any patches or ......I had one more doubt,i.e. when i enter Data_mode=static, then HTML files will  be taken from my desktop and the path in the web browser changes to my desktop,i mean like(c:/programs/sap/frontend/bw,place where i downloaded the precalculated html pages)or it will be from report agent storage on BW server.
    waiting for your reply
    Thank you
    Message was edited by: Bhaskar Bysani

  • Can I use data from Servlet in my static html page?

    First of all, I can NOT use jsp because of web server's restriction.
    I have a servlet which will give me some image links in html file via doGET and doPOST method. I also need the sizes of the images and compress the images if too large.
    My question is how I can pass the image sizes to the html page and how I can use them in html files.
    Please advise me some solutions to this problem.

    Yeah, you have 2 choices:
    1) Change your web server to one that allows JSP.
    2) Re-build the JSP system from scratch so that the one you make will work in your server. This would involve changing your so called static HTML to have markings (like <% %> tags) where you should insert the values you need to insert. You would then have a servlet that reads the 'static' HTML, parses our the insertion tags, and inserts the values. It would then stream the results back to the user.
    Of course, your HTML is not really static, it is dynamic because the values you are inserting are capable of changing.
    If you don't want to upgrade the server to one that supports JSPs (if yours really doesn't), the have fun making your own system.

  • Calculate lenght of a html page

    How can I do calculate the lenght of a vertical scroll bar to
    estimate the vertical size of a html page.
    I dont't calculate the size of a windows but the size of a web page.
    In the class javax.swing.JScrollBar I didn't find never.
    regards
    ilCario -
    http://bingo.crema.unimi.it/cario/

    Don't know - never done it, but with swing components you can specify the sizes instead of using the layout API's with;-
    this.setLayout(null);
    myJThing.setBounds(int, int, int,int) // last int = vertical size
    Does that help? (If I'm off-track I shall flail myself with the kitchen mop and chain myself to the side of the house for couple of hours)
    - If that doesn't help try and re-phrase the question and please don't be embarrassed about your English speak, personally, my Swahili is getting quite rusty, so I don't mind.

  • JEditorPane HTML link in the same page

    Hi,
    I want to show an HTML page in JEditorPane.
    The HTML page have <a> tags that link to a bookmark in
    the same page, but I can�t show this because I get an error
    like this:
    MalformedURL or similiar.
    I try to do somethig like this:
    public void hyperlinkUpdate(HyperlinkEvent ev)
    ...Editor.setPage(ev.getURL());
    or
    ...Editor.setPage(ev.getDescription());
    without results.
    How can I listen for hyperlinksEvents than link in the same page.
    Thanks

    they dont want to see the first report.
    Is there a way in which the Prompts are also display along with the second report?Then create the same prompt on the second report also.
    Cheers
    Nawneet

  • Problem in displaying html page in JEditorPane....

    Hi All,
    i was trying to display a html page in a JEditorPane. i was able to do that when i'm displaying a html page from a local machine.. But when i try to get the page from some website, it giving me
    "exception access denied (java.net.SocketPermission www.java.sun.com resolve)"
    exception. But if i run the same code thru JBuilder, its working. But thru appletviewer or thru IE or Netscape its throwing the error.. Any suggestion or help is highly appreciated....
    Thanks
    Ragu

    Java Applets are very secure, what is good. Java applets are extremely secure
    what is bad. So Applet cannot open TCP connection to any host rather than its
    home host. So you cannot get the resources from any other server (what is common to
    HTTP).
    In JBuilder iit works cause JBuilder is used for development and security in deevelopment
    is not an issue. But it confuses then you see.
    vpanasenko_even

  • Working with JEditorPane to display HTML page

    iam loading html page into JEditorPane .
    how to get the html form data to validate
    give me soluation for this problem ...
    thanks ....
    karthi

    Search for occurences of <img> tags in the stream and replace its src="" contents by for example src="image?id=orginatingimagefilenameorso" and write kind of an ImageServlet mapped on "/image*" which streams the right images to the response.
    You may find this ImageServlet example useful: http://balusc.blogspot.com/2007/04/imageservlet.html
    After all, why are you streaming HTML files through a servlet instead of just linking to them? Aren't they public accessible or so? If this is the case, consider creating a virtual host on the application server so that you can just access those files through a simple plain vanilla URL.

  • Problem Printing html page with JEditorPane...

    Hello All,
    I Have a problem in printin html file with JEditorPane...
    My Html file contains a Table on it..
    Problem is that JEditorPane displays the html file correctly but
    it prints the file without print that Table..
    So pls help me...
    Thanx in advance,..
    Amit
    [email protected]

    I think you would know how to retrieve content of an HTML page using the URL object. Just in case.
    My apology if this short note doesn't help you at all.

  • JEditorPane printing a HTML PAGE

    Hi,
    Here is my problem. I am displaying a HTML Page in a JEditorPane. So far so good.
    when I try to print is printing to my printer. Here is the problem the Text or to say the font doesnot look good in the paper, each letter is not nice and smoth and it looks like some of the pixels in each letter were lost. This happens right when I initialize the JEditorPane with html code. I can also see the pixels in each letter are lost when I initilized it in a JEditorPane.
    Any help will be appreciate.

    How are you printing? Are you using the Printing API?
    You can try antialiasing the text before printing:
    http://www.exampledepot.com/egs/java.awt/AntiAlias.html

  • How does JEditorPane determine its preferred size?

    Could someone explain how JEditorPane determines the initial preferred
    size? Its default sizing is not giving me what I need and I'm not sure
    how to control it, other than explicitly setting the size with
    setPreferredSize().
    A simple example:
            String s = "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 10 20" +
                       "21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39";
            JEditorPane ed = new JEditorPane("text",s);
            JPanel pan = new JPanel();
            pan.setLayout(new BoxLayout(pan,BoxLayout.Y_AXIS));
            pan.add(ed);
            JFrame f = new JFrame();
            f.getContentPane().add(pan);
            f.pack();
            f.setVisible(true);This code generates a window that shows one line, with "1 2 3 4 5 6 7 8 9"
    showing. I'd like to have a larger area showing initially.
    Does the choice of layout manager effect this? (I actually prefer to use
    TableLayout; the above example with a 1x1 TableLayout and widths set to
    PREFERRED yields exactly the same results.)
    Thanks,
    bw

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • UIWebView html page size

    Hi, I use UIWebView in my app. I found the html page was rendered too small, user has to zoom in. Is there a way to set the page size in Interface builder?
    Thanks,
    fm

    Use
    webView.scalesPageToFit = NO;

  • Generated html page size

    Hello, do anybody know an approach how to check html page size generated by jsp (servlet) in run time ?
    Thanks.

    String myFile ="C:\\Path\\To\\File\\name.html";
    File repositFile = new File(myFile);
    long repositFileSize = repositFile.length();

  • Made new html page, I cannot find an pactual font size

    Doing DW in a book, Lesson 1 made a html page "two col fixed header footer" There is a text size, an h1, h2 & <p> text size and it is 100% in the body, and 100% in the header, and after lesson #1, it is 90% in the main content, however of what?  I went looking as a  follow-up of the lesson and I
    could not find a reference to an actual size in the css which is in the head. How big is it, where is it established?    

    All web browsers have a default size for text. Putting 100% in the body style rule means "use the browser default for all fonts". Using 90% later simply means "use 90% of the browser default". The actual size depends on the individual browser.

Maybe you are looking for