Printing a JEditorPane - can't get the true height

I'm trying to print the contents of a JEditorPane with a HTMLEditorKit.
The kicker is that
a) I need to constrain the width of the pane.
b) Once the width is constrained I need to find out how tall the resulting pane is so I can place it appropriately on the page and place other information after it.
My code is:
  private final JEditorPane mHtmlPane = new JEditorPane();
  mHtmlPane.setEditorKit(new HTMLEditorKit());
  mHtmlPane.setContentType("text/html");
  mHtmlPane.setDoubleBuffered(false);
  mHtmlPane.setText(buffer.toString());How would you do it? I've tried setting the size, preferred size, minimum size, etc. but have never gotten a good height back from any of the get<something>Size methods.
Any help appreciated!

hi,
current row available in <af:table> try it through selectionListener..

Similar Messages

  • Oj4632 I can't get the paper device out of my new printer? locked in somehow.

    oj4632 I can't get the paper device out of my new printer? locked in somehow. very frustratied

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

  • When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?

    When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?  Thanks

    sandrafromsilver spring wrote:
    When I try to print from my iPad I see a message "searching for printer" and then "no printer found.".  I have a printer application loaded and it finds my wireless printer.   How do I get the iPad to do the same so I can print from emails, the web, etc?  Thanks
    Go to the following link:
    http://jaxov.com/2010/11/how-to-enable-airprint-service-on-mac-os-x-10-6-5/

  • How can I get the template( word rtf )  for PO – Printed Purchase Order ?

    I want to convert the “PO - Printed Purchase Order” report from Oracle rdf format to BI Publisher. I am looking for the template but could not find in UNIX.
    As per the Oracle blog, the template is available. Please see the URL : https://blogs.oracle.com/xmlpublisher/resource/121BIPReports.pdf
    The template code is POXPRPOL_XML.rtf
    when I look at the $PO_TOP/patch/115/publisher/templates/US directory, I cannot find POXPRPOL_XML.rtf
    How can I get the template( word rtf ) for PO – Printed Purchase Order ?
    Thank you,
    Biju Varghese.

    How can I get the template( word rtf ) for PO – Printed Purchase Order ? XML Publisher Administrator -> Templates
    find by code or name
    open it and you can downloadtemplate by "download" button

  • When I try to print a photo downloaded from Facebook in iPhoto, I can't get the size I specify to print correctly. Example: 5x7 prints smaller than 5x7. What do I do to solve this problem?

    When I try to print a photo downloaded from Facebook in iPhoto, I can't get the size I specify to print correctly. Example: 5x7 prints smaller than 5x7. What do I do to solve this problem?

    Those pixel dimemsions have aspect ratios that are not the same as a 5 x7 print:
    1360 x 1360 = 1.0
    790 x 640 = 1.23
    2048 x 1366 = 1.5
    An 7 x 5 image = 1.4.
    So you'll need to crop the images to 5 x 7 before printing.  The first two images are a little light in the pixels to produce a high resolution 5 x 7 print. 
    Happy Holidays

  • I have a networked HP L7780 all in one printer and I can not get it to fax through my Macbook Pro.  I have downloaded all the drivers and it has passed all the tests.  Every time I try to fax it shows the job paused.

    I have a networked HP L7780 all in one printer and I can not get it to fax through my Macbook Pro.  I have downloaded all the drivers and it has passed all the tests.  Every time I try to fax it shows the job paused.  I can manually send and receive faxes but I can not do it through the computer. 

    Try deleting the printer, deleting the job queue and reinstalling the printer again.

  • I can't get the pop up preview to come up when printing shipping labels through paypal.

    I can't get the pop up preview to come up when printing shipping labels through paypal. When I click the pay and print I get nothing but it does charge me. I can see it and print no problem through IE but not Firefox. I also can do a reprint of the label through my email confirmation. Paypal is listed under the exceptions in pop up blocker. I have tried re-installing Firefox and turning off pop up blocker but nothing seems to work. Thanks for any help or suggestions you may have.

    Usually, you receive this notification if you enabled the option to back up via iCloud but you have not backed up for a while. If you want to back up your device via iTunes then you have to disable the option to back up to iCloud (Settings > iCloud > Storage & Backup > iCloud Backup off).

  • I have an Imac running snow leopard and have recently installed a cannon i-sensys lbp7750Cdn printer since then I can't get the printer working and the air port has lost the DNS servers; if it ever had them!!! but it dose not look happy. Can any one help

    I have an Imac running snow leopard and have recently installed a cannon i-sensys lbp7750Cdn printer since then I can't get the printer working and the air port has lost the DNS servers; if it ever had them!!! but it dose not look happy and it is telling me so. Can any one help please?

    Snow Leopard breaks quite a few drivers - my Canon exhibited the same problem.
    I eventually found updated drivers on the Canon website. You can try that with the HP, but if the all-in-one is more than a year or so old, don't hold your breath.
    You can also try Software Update to see if it will offer new drivers, or failing that go to the Support Downloads site and search for HP updates.
    In fact there's a new one for HP at the top of the list just now.
    You may not necessarily want the latest one, though - check the specs to see if your model is covered; if not, search for the previous update etc.

  • I can't get the HP 2600n to show up in Print Dialog

    I can't get the HP 2600n to show up in the Print settings.
    I've tried to reinstall with the original disk that came with the printer, but it says I have more updated software already on my computer. (i downloaded some drivers from the 'net)
    what do I do?

    cardigans1,
    Could you provide some additonal information so that I may help you with this issue:
    OS version number
    Sotware version number
    Working for HP and here to help!

  • I am using windows 7 and can't get the print drives to load for F2210 printer

    I am using windows 7 and can't get the print drives to load for F2210 printer and I keep receiving different fatal error codes.

    Hello @Imvertical 
    Welcome to the forums!
    I read about how you're attempting to install your Deskjet F2210 on your Windows 7 system and receive Fatal Error codes. I will do my best to help and make some suggestions for you to try. 
    To being, try a standard copy from the unit to see if it will copy. If copies work, continue troubleshooting. If not, let me know what happened when you made a copy.
    Next:
    Perform a Level 3 uninstall.
    There are 2 ways you can run the uninstall:
    From Original installation CD:
    1. Insert CD into drive, and then cancel the installer
    2. Click Start and open 'Computer', and then right click on the CD drive and open
    3. Open folder Util
    4. Open folder CCC
    5. If you have an HP computer run the L3uninstall.exe. If you have a non-HP computer run the L4uninstall.exe
    6. When the uninstall has completed restart the computer
    7. Run Disk cleanup from Accessories\ System Tools
    8. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    9. Download the full feature software and drivers: HP Deskjet F2200/F2224 All-in-One Printer series Full Feature Software and Driver
    10. Run the download to reinstall the printer
    If software was downloaded and extracted to your system:
    1. Click Start and type %temp% in the run field
    2. Look for, and open the folder starting with 7z (Example: 7zS2356) (If there is more than one, choose the most recent folder)
    3. Open folder Util
    4. Open folder CCC
    5. If you have an HP computer run the L3uninstall.exe. If you have a non-HP computer run the L4uninstall.exe
    6. When the uninstall has completed restart the computer
    7. Run Disk cleanup from Accessories\ System Tools
    8. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    9. Download the full feature software and drivers: HP Deskjet F2200/F2224 All-in-One Printer series Full Feature Software and Driver
    10. Run the download to reinstall the printer
    Please let me know if the installation worked after the Level 3 uninstall.
    Good luck and have a nice Wednesday!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • I connected my Canon printer to time capsule, and can print OK. However, I can't get the printer scanner to work. How do you set up the scanner with Time Capsule?

    I connected my Canon printer to time capsule, and can print OK. However, I can't get the printer scanner to work. How do you set up the scanner with Time Capsule?

    You cannot use USB. It has to be a network capable printer.. is it?? You did not indicate how it is connected.. but by wireless or ethernet then scanning is possible otherwise not.

  • Now that my operating system was updated to OSX 10.9.2 (Mavericks) I can not get the print drivers installed

    Now that my operating system was updated to OSX 10.9.2 (Mavericks) I can not get the print drivers installed

    For an existing printer, see > OS X Mavericks: Reset the printing system
    To setup a new printer, see > OS X Mavericks: Set up a printer

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

  • How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    How can I get the 23 July update to load onto my iPad. I haven't been able to access my documents or work for weeks and need to use it. Has anyone else had similar problems?

    Hello Arthur,
    Thank you for the reply.
    You were correct that deleting the app and reinstalling it was the only thing to make it work but unfortunately I lost all the documents I made, even though they were backed up to iCloud before i deleted the app. At the same time as deleting pages I had to delete keynote and numbers too, so I've lost all the documents in them too.
    The mb of data which was assigned to each programme in iCloud has reduced, so. I guess they are gone for good. Is there any other way to reaccess them?
    Not your fault but I am a bit fed up the the iPad. I have lost work that I've done and have no other copy apart from what was in iCloud, as I don't have a printer and couldn't email them too myself as I couldn't get into the programme and  i've also got episodes of tv series I purchased that I can't download and albums that are half downloaded with songs missing, so I feel a bit swindled out of time and money and am going back to DVD ,  pen and paper and CDs .
    Instead of using iCloud I guess the only way to make sure I don't loose any more documents it to email them to myself each time I save them on the iPad. Is there anything else you could suggest please?
    I don't have any other apple products apart from iPods, so I can't access the iCloud on anything else can I?
    Thanks
    Amanda

  • Can't get the attachment filename out of a Part (with non ascii characters)

    Hello, all and happy new year :)
    My issue is with non ascii filename in attachments... Yes i've read the FAQ : http://www.oracle.com/technetwork/java/faq-135477.html#encodefilename
    I can't get the filename out of the BodyPart for those kind of attachments
    here's my unit test :
         * contains various parts from various mailer encoded in different ways...
         private enum EncodedFileNamePart{
              OUTLOOK("Content-Type: text/plain;\n name=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename=\"=?iso-8859-1?Q?c'estd=E9j=E0no=EBl=E7ac'estcool.txt?=\" \n\nnoel 2010\n","c'estdéjànoëlçac'estcool.txt"),
              GMAIL("Content-Type: text/plain; charset=US-ASCII; name=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Disposition: attachment; filename=\"=?ISO-8859-1?B?ZOlq4G5v62znYWNlc3Rjb29sLnR4dA==?=\"\nContent-Transfer-Encoding: base64\nX-Attachment-Id: f_giityr5r0\n\namluZ2xlIGJlbGxzIQo=\n","déjànoëlçacestcool.txt"),
              THUNDERBIRD("Content-Type: text/plain;\n name=\"=?ISO-8859-1?Q?d=E9j=E0no=EBl=E7acestcool=2Etxt?=\"\nContent-Transfer-Encoding: 7bit\nContent-Disposition: attachment;\n filename*0*=ISO-8859-1''%64%E9%6A%E0%6E%6F%EB%6C%E7%61%63%65%73%74%63%6F;\n filename*1*=%6F%6C%2E%74%78%74\n\njingle bells!\n","déjànoëlçacestcool.txt"),
              EVOLUTION("Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt\nContent-Type: text/plain; name*=ISO-8859-1''d%E9j%E0no%EBl.txt; charset=\"UTF-8\" \nContent-Transfer-Encoding: 7bit\n\njingle bells\n","déjànoël.txt"),
              String content=null;
              String target=null;
              private EncodedFileNamePart(String content,String target){
                   this.content=content;
                   this.target=target;
              public Part get(){
                   try{
                   ByteArrayInputStream bis = new ByteArrayInputStream(this.content.getBytes());
                   Part part = new MimeBodyPart(bis);
                   bis.close();
                   return part;
                   catch(Throwable e){
                        return null;
              public String getTarget(){
                   return this.target;
         @Test
         public void testJavamailDecode() throws MessagingException, UnsupportedEncodingException{
              System.setProperty("mail.mime.encodefilename", "true");
              System.setProperty("mail.mime.decodefilename", "true");
              for(EncodedFileNamePart part : EncodedFileNamePart.values())
                   assertEquals(part.name(),MimeUtility.decodeText(part.get().getFileName()),part.getTarget());     
    I take a NullPointerExcepion in the decodeText because getFileName() return null for the EVOLUTION case, and work well with OUTLOOK, THUNDERBIRD and GMAIL.
    Evolution's content type is "Content-Disposition: attachment; filename*=ISO-8859-1''d%E9j%E0no%EBl.txt" wich doesn't look like the other (looks like the RFC 2616 or RFC5987 to do it.)
    How can i handle this situation except by writting my own decoder?
    Thanks for your answers!
    Edited by: user13619058 on 4 janv. 2011 07:44

    Set the System property "mail.mime.decodeparameters" to "true" to enable the RFC 2231 support.
    See the javadocs for the javax.mail.internet package for the list of properties.
    Yes, the FAQ entry should contain those details as well.

Maybe you are looking for

  • My ipod touch 3 generation will not change orientation in any apps except for movies. The orientation is not locled either.... Not sure what to do.

    My ipod touch 3 generation willnot change orientation for any apps except movie apps. I purchased this One from a friend and my previous Ipod touch changed with no problem. The orientation lock is not on either...., has anyone had a similar experienc

  • Get sales order in condition routine of VF01

    Hi I need to get the sales order number (or at least the delivery number) in a condition routine which is called in VF01. I can't find any structure/internal table/variable where it is passed. Does anybody have an idea where to find the information?

  • Not able to open page in R12

    Hi all, I have developed a page in 9i jdevoloper, I registerd page in oracle applications. It is working fine in 11i instance. But I am not able to run the page from R12 instance. It is showing the below error when i open page in oracle applications.

  • Itunes fails updating

    Every time if i try to update to a new itunes it would fail and if i do the install maully then some would say "The windows installler service could not be accessed" error and the others it would say "The system administrator has set policies to bloc

  • Help: Panic Log

    Hi, I recently switched to using Macs, and I bought the new macbook intel core 2 duo, 13 inch, black with 2GB of memory and 160GB hard drive. After a week, I got the following panic log. I am not exactly sure how to read this and find the error or wh