Problem with printing JFrame with several other components on it

Hi,
i am trying to print out a JFrame that contains other Swing and AWT components, such as JTables and menus etc.
The problem is that the options that i select from the pageformat dialog, do not get set when the printing is taking place. As a result my jframe gets cut up into 4 differnet bits and each comes out on a seperate page. I cannot specify number of copies or size of paper either. Also once the ok button is pressed on the print dialogue, then the print dialogue comes back again and i have to press Ok, or Cancel to get rid of it. My code is below, please can someone suggest anything:
]public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
if (pi >= 1)
return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) g;
g2.translate(pf.getImageableX(), pf.getImageableY());
g2.setColor(Color.black);
paint(g2);
return Printable.PAGE_EXISTS;
PrinterJob pjob = PrinterJob.getPrinterJob();
PageFormat pf = pjob.defaultPage();
pjob.setPrintable(TransponderGraph.this, pf);
try
pjob.print();
catch (PrinterException e) { }

Ok, try this.
Change this:
<link href="
http://www.jonbarron.org/css/style.css"
rel="stylesheet" type="text/css" />
to this:
<link href="
http://www.jonbarron.org/css/style.css"
rel="stylesheet" type="text/css" media="screen" />
Somewhere in that stylesheet lies your problem.

Similar Messages

  • Any known issues with Essbase 64 bit and other components as 32 bit

    Hi Everyone,
    Are there any known issues with 64 bit Essbase and other components (Planning, EAS, Provider services, EAS, Workspace and Reporting) in 32 bit?
    Version is EPM 11.1.1.3
    The reason for choosing ESSBASE 64 bit is of course performance. We decided to stick to 32 bit for the web applications due to some known issues and bitter experiences in past in this version with 64 bit web deployments.
    OS is Windows 2003 Server (64 bit for the ESSBASE server and 32/64 bit for the application server)
    Thanks,
    Sayantan

    Hyperion 32-bit Web Apps are fully compatible with Essbase 64-bit. Same with 32-bit Essbase client.

  • Resolution problem when printing JPanel with picture on bg

    Hellow!
    I have some problems with printing JPanel component. I have a picture drawn on the background of the JPanel and several buttons on it. The whole JPanel is about 1600x800px. When i print whole the component with the help of PDF virtual printer, component is printed larger than A4 list. It is strange for me because print resolution is 600 dpi, so whole component must be a rectangle with the size about 2.5x1.5 inches. When I scale the graphics before painting component to fit image to page (i mean ... {color:#ff0000}g2d.scale(sc,sc); panel.paintAll(g2d);{color} ...), the picture's quality becomes very bad.
    I understod it so: I draw the component on the paper in screen resolution, then I decrease image size, so quality also decreases.
    My question is: how to draw on the graphics of printing paper the component in printers resolution (600dpi), but not in screen resolution.

    Hi there,
    Could you provide the community with a little more information to help narrow troubleshooting? What operating system?
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Problems to print contacts with specific fields under Maverick.

    I am unable to print contacts with specific, selected fields like `firm´ or `position´under Mavericks. The selected fields will not show up in the printing preview and not be printed at all. Any ideas?

    Thanks, John! It seems you guessed correct, partly at least. I turned some of the problamatic fields off and on again an these are showing up now and I can print them. Great!
    However, I can see the field "firma" (German = company in English) in the previewed sample card but not in the pull down menu "Add Field". That means, I am unable to turn it off/on. The intersting thing: The field is visible and selectable even in the printer dialog were you can select the fields you would like to print but it remains unprintable.
    Again, many thanks, John! 

  • Unable to communicate with printer error with HP Envy 4500

    Hi I am having trouble printing with my Envy 4500 printer. My computer system is Windows 8.1. I installed the driver per instruction from the website and use the usb cable to connect the printer. However when I tried to print a pdf document it says "Unable to communicate with printer" and I can't get the test page to print either. Please help! Thanks in advance! 

    Hi @Casey_Z , and welcome to the HP Forums!
    I see you're having issues printing.  I would like to help!
    I'd recommend removing the ink cartridges, and performing a power reset.  Disconnect the power cord from the printer and the power outlet, then wait 60 seconds. After 60 seconds, plug the printer back in. Ensure you plug the printer directly to a wall outlet. Make sure to bypass any sort of surge protector or power bar.
    I'd then suggest downloading and running the HP Print and Scan Doctor.
    Good luck and please let me know the results of your troubleshooting steps. Thank you for posting on the HP Forums!
    Please click “Accept as Solution " if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the right to say “Thanks" for helping!
    Jamieson
    I work on behalf of HP
    "Remember, I'm pulling for you, we're all in this together!" - Red Green.

  • Problem with Checkbox that disables/enables other components.

    Hi
    As I show in the title, I have problems with a checkbox that enables/disables another components (three exactly).
    I have done the follow:
    1.- Set property "AutoSubmit" true in the SelectOneChoice
    2.- Set "Disabled" property true or false depending if the SelectOneChoice is selected or not
    (#...selectBooleanCheckbox.value?false:true})
    3.- Set the Partial triggers to the SelectOneChoice in the three components.
    CASE 1: The SelectOneChoice is unmarked. The three components appears disabled and when I mark the SelectOneChoice, this components appears enabled. The thing works ;)
    CASE 2: The SelectOneChoice is marked. The three components appears enabled and when I unmark the SelectOneChoice, the components continue enabled. They don't disable until I press the submit button.
    how can i make that the components appears disabled when i unmark the checkbox?
    i try with de ChangeValueListener, but it only works where the SelectOneChoice changes from unmarked to marked.
    thanks!

    I think the problem is, when the value is null the checkbox return with the selected state, b'coz u r
    returning the checkbox (as it is). so pl'z try with below code (ADDED).
    public Component getTableCellRendererComponent(JTable table, Object value,
    boolean isSelected, boolean hasFocus,
    int row, int column){
    if(value != null){
    Boolean booleanValue = (Boolean)value;
    setSelected(booleanValue.booleanValue());
    else /// ADDED
    setSelected(false);/// ADDED
    return this;
    Nediaph.

  • My music won't sync with my iPhone (and several other problems)

    My music has all disappeared from my iphone - the playlist names are still there, but the playlists are empty. and all my songs are in the library, but they all have the dowload from cloud button by them, but they arent on my actual phone. I'm not sure what the cause is because it could be a few different things... I got a new mac for christmas, so today was the first time I was using my new computer, and I also downloaded the new update on my phone today. After the update, my old apple id showed up, when I changed the email address on that id months ago. I deleted that account after reading some forums on here, and signed in with the current email and password for my apple ID. After that, the music wouldnt go on my phone. Also, it says I dont have room on the cloud, even though I do, and wont back up to icloud. I restored my phone and used my last updated back up (again, using advice from a different forum) to see if that would help, and it did not. Very frustrating because I have spent a LOT of money on music. Help?! Im trying to avoid an hour and 45 min drive to my nearest apple genius bar.

    If you  have iTunes 11 turn on the Sidebar. Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar.
    To sync to your iPod go to iTunes>Help>iTunes Help>Sync your iPod....>Sync You Device and follow the instructions. Are yu following those instructions?
    Does the iTunes see the iPod? If not:
    iOS: Device not recognized in iTunes for Windows

  • Current update has intermittent problem of printing gibberish with HP Officejet Pro 8500. No problems before most recent update.

    Even in Print Preview will show as gibberish--and print as gibberish. If repeatedly open document to print, suddenly it Previews & Prints correctly.

    Have you moved the paper guides to properly align the envelopes?  I do not see how envelopes can be loaded in any position but the center with the paper guides set snugly.  See page 42 (46) of the manual here.  Also, if you have the optional second paper tray note that envelopes are not supported in it, you need to use the top tray.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • Problem with printing emails with IOS 7.

    I installed IOS 7 on my iPad 2 and now have problems printing emails. They come out in a very large print, even if I have disabled 'Larger Print' in Accessibility and have chosen a small print size.  There was no such problem with IOS 6.  What shall I do to get back a normal print size?  Can Apple help please?

    Check Settings>Messages>Send & Receive>Start New Conversations From to be sure your phone number is listed and selected.

  • Problem in print out with English characters (THANGSAN font)

    Save Our Environment. Save Yourself.
    Hi Experts!!
    I have created a smartform and print program which should actually print some Thai characters and English characters too. I created a smartstyle and have some 10 paragraph formats and are all have THANGSAN font. So, I am printing all the thai and english characters in THANGSAN font only.
    When print preview is seen, the output is very fine, but when being printed, the thai characters are appearing fine but the english characters' font is being changed to somehting else (courier or arial). Why is this happening so? Because of this, all the output is being merged and looking very weird.
    The smartform is created in EN and is translated to all languages. All user has logged on to SAP in EN language.
    Can somebody please help me out with whether the problem is with THANGSAN or the printer?
    P.S. The smartform is actually similar to the standard script Z_RVINVOICE01 in which only THANGSAN is used.
    - I'm not an environmentalist.  I'm an Earth warrior.

    Save Our Environment. Save Yourself.
    Can anybody please help me out?
    Thanks a lot.
    - I'm not an environmentalist. I'm an Earth warrior.

  • Problem to print report with graph

    Hello,
    I make a vi to print or save in html file my front panel results. In the results, I have a graph and to save it in my report I use the "Append Control Image to Report.vi".
    The problem is when I print the report the Image is in the top of page and it's size is limited by the size of the left header text. And the top text (not header but just the Title text) is placed after the image.
    Now when I save it in the HTML file, I have any problems in the structure of my report.
    If you have suggestions, I listen to.
    I have an idea to divert the problem is to make a vi to print the HTML file but I don't know to make it.
    Thanks for help.
    I have attach the file. A man please print the report and say me if the struct
    ure is good. Like this, I know that the problem is a problem to my computer config or print config.(Use Labview 6.1)
    Thanks for help.
    SAM
    Attachments:
    Report_generation.zip ‏34 KB

    Hi midtisam,
    I've run your VI to test it for you. I believe I am seeing the same bahavior that you are. The graph always shows up at the top of the page even though it is added after the header. Also, I tried creating an HTML file and it worked correctly. I would suggest doing this since it seems to work better.
    Now, you can not use the Print Report VI with HTML reports. If you are able, I would suggest just creating the HTML report and either printing it from your computer through Internet Explorer or sending the file to whoever needs it. Best of luck.
    J.R. Allen

  • Need help with printing edocs with a laserjet1320. Wont print large jobs. installed 10.7 update.Help

    i am trying to print 50 page(5mb) document package on legal paper and the printer is printing one page at a time. I am using a macbook pro  10.7 and I have installed the update. however, it seems as though the computer is not correctly communicating with the printer. A four page job was no problem. I believe these printers are capable of high volume printing. Can I reinstall the firmware? Adobe acrobat will not even communicate with the printer. It just says "waiting for printer to become available." Using "preview", it sends the job to the printer, however, it is printing about 5pages per minute. It is connected through a usb cable. thanks for your help.
    Randy

    Randys714 welcome to the forum
    Your laserjet1320 is a commercial product. I will suggest posting in the forum for HP Business Support as well for yet a better chance at finding a prompt solution.
    You may find the commercial Laserjet board here.
    http://h30499.www3.hp.com/t5/Printers-LaserJet/bd-p/bsc-413
    Thanks;
    RobertoR
    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • Problem visualizing a JFrame while doing other things

    I'm triing to visualize a "Waiting" Window with static labels on it saying "Wait please, this process can take some time..." while doing something like 20000 insert in a database, but the window shows only at the end of the process (when i have to open another window, so it displays for only a millisecond). How can i solve the problem? Code is like this:
    public class myclass extends JFrame {
    // some dichiaration
    public myclass() {
    try{
    jbinit()
    } catch ...
    // do alot of calculation
    private void jbinit() {
    // all the stuff like setsize and labels definition
    }

    You're probably doing the entire work in the Swing thread and block it from doing anything else.
    http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

  • No luck with printer recognition with airpot express, please read and help

    I have 3 macs and 1 pc running vista, my 3 macs print perfectly through airpot express. I installed the airport cd on my pc, but i cant print, Im no good with windows, i was wondering if you could walk me through the process.
    I already clicked on add a printer but it wont find my printer, and my printer is connected to my airport express and its on, so, i dont get why it wont recognize it or why doesnt it work
    please help

    altairmactavish wrote:
    I have 3 macs and 1 pc running vista, my 3 macs print perfectly through airpot express. I installed the airport cd on my pc, but i cant print, Im no good with windows, i was wondering if you could walk me through the process.
    I already clicked on add a printer but it wont find my printer, and my printer is connected to my airport express and its on, so, i dont get why it wont recognize it or why doesnt it work
    After you click on "Add a Printer", do you select "Add a Network, Wireless, or Bluetooth Printer"?
    If that doesn't work, there should be a way to connect by specifying the IP address of your AirPort Express.

  • Tarantella native client don`t printing with printer usb

    tarantella native client don`t printing with printer usb

    agreed with Wai on upgrading. The first test should be outside of SGD . . . does UNIX print to that USB printer? If not then chances are Tarantella 3.30 will not. If you upgrade to 4.31 you will need to first upgrade to 3.42 then to 4.20 before upgrading to 4.31. Under 4.31 we support PDF printing from UNIX servers. With PDF printing you should have no problem printing to a USB printer.

Maybe you are looking for

  • Training and event management - Internal Activity Allocation for Attendees(PV18)

    Dear all, I run the PV18 transaction (Internal Activity Allocation for Attendees). Lets imagine that I successfully allocated 1000 EUR in the CO module. Then I realize that it was a mistake, and I want  to correct this by sending -1000 EUR to CO. My

  • Error in Update of atributte ORDSYS.ORDDOC

    Dear Friends, Somebody can help me, I have the following problem, when my program tries To make the Update of an Attribute "ESCRITO" of type ordsys.orddoc in table "LYT"."movimiento" (to see down) of a data base Oracle 9,0,1,0,0, using the method: vo

  • Fire wire gone

    I upgraded to itunes 7.02 Im still using osx 10.3.9 all of a sudden my color ipod wont update through a fire wire port. It lights up and charges and the fan speed on the computer changes but itunes wont find it. It still works fine on my laptop and w

  • CS3 VB how to get reference to a text frame?

    Hi there, I got a text frame in a document with a table inside. In first cell of the table there is another text frame with table. How to get a reference to the first text frame from the frame inside of the cell? text frame in a cell has a character

  • Computex girls? Which year of pictures do you have?

    Computex is coming, which years of Computex girls's photo do u keep? I find pictures of Y2010, you can see MSI Notebook promoting it's Gaming series