Printing by white color

hi
it's my second post about printing jpanel
following code is work, it's print multipages, printing all components
but all text - jlabels,table headers and table contents printing by WHITE COLOR. At display it's showed black, and at print method i set color to black too. So WHY text still WHITE ???
thanks
my code is
import java.awt.*;
import javax.swing.*;
import java.awt.print.*;
import javax.swing.table.JTableHeader;
import javax.swing.table.*;
class JPanelMy extends JPanel implements Printable
          static JLabel title1=new JLabel("test");
          static JLabel prelast=new JLabel("testl1");
          static JLabel last=new JLabel("testl2");
          JLabel titlename,daydate;
          JTableHeader th;
          TableElements table_elements[];
          MainWindow src;
          JLabel l1[],l2[];
          JPanelMy(MainWindow src)
                    super();
                    this.src=src;
                    DateWork dw=new DateWork();
                    daydate=new JLabel(dw.getDayDate());
                    titlename=new JLabel();
                    setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
                    setBackground(Color.white);
                    setForeground(Color.black);
          public void setTitleDoc(String s)
                    titlename.setText(s);
          public void printData()
                    PrinterJob pj=PrinterJob.getPrinterJob();
                    pj.setPrintable(this);
                    pj.printDialog();
                    try
                              pj.print();
                    catch (PrinterException pe)
                              System.out.println("Printer Exception");
          public void showTables(int doc,TableElements table_elements[])
               // showing jpanel structures
          public int print(Graphics g,PageFormat pageFormat,int pageIndex) throws PrinterException
                    Graphics2D g2=(Graphics2D)g;
                    g2.setColor(Color.black);
                    int fontHeight=g2.getFontMetrics().getHeight();
                    pageFormat.setOrientation(PageFormat.LANDSCAPE);
                    double pageHeight=pageFormat.getImageableHeight()-fontHeight;
                    double pageWidth=pageFormat.getImageableWidth();
                    Dimension d0;
                    d0=getSize();
                    double panelWidth=(double)d0.width;
                    double panelHeight=(double)d0.height;
                    double scale=1;
                    if (panelWidth>=pageWidth)
                              scale=pageWidth/panelWidth;
                              System.out.println("scale="+scale);
                    double panelWidthOnPage=panelWidth*scale;
                    double oneRowHeight=fontHeight;
                    int numRowsOnAPage=(int)(pageHeight/oneRowHeight);
                    double pageHeightForPanel=oneRowHeight*numRowsOnAPage;
                    int totalNumPages=(int)Math.ceil((double)panelHeight/pageHeight);
                    if (pageIndex>=totalNumPages)
                              return (NO_SUCH_PAGE);                         
                    g2.translate(pageFormat.getImageableX(),pageFormat.getImageableY());
                    g2.translate(0f,-pageIndex*pageHeightForPanel);
                    g2.setClip(0,(int)pageHeightForPanel*pageIndex,(int)Math.ceil(panelWidthOnPage),(int)Math.ceil(pageHeightForPanel));
                    g2.scale(scale,scale);
                    paint(g2);
                    g2.scale(1/scale,1/scale);
                    g2.translate(0f,pageIndex*pageHeightForPanel);
                    return (PAGE_EXISTS);
          public void setPCardLabels(JLabel l1[],JLabel l2[])
                    this.l1=l1;
                    this.l2=l2;

so no advices ? :(

Similar Messages

  • Print Inverse - White Font on Black Background (Smartform)

    Hello everyone
    I've not found a solution for my problem in SDN and also not in the internet.
    So I open a new thread.
    I would like to print a white color on a black background. I've already created a smartform with a white font and a black box.
    The preview looks good, it shows exactly what I need.
    But when I print it out only the black box appears (white font is not "printed").
    Is this a driver-problem?
    We are using HP-printers with type HPLJ4000 (SPAD).
    Thanks a lot for all answers in advance.
    Regards
    Christian

    Hello
    First, thank you for your help!
    As we had another problems with our printers, I've found the solution for this.
    It depends on the device type, which you can maintain in SPAD.
    We used "HPLJ4000" for a while and this type don't supports all background colors.
    So I changed this to "POST2" and now it runs.
    Regards
    Christian

  • How do I change an hp officejet j6400 printer change from color to black and white?  I have a Mac 10.8 OX system

    How do I change an hp officejet j6400 printer change from color to black and white?
    I have a Mac 10.8 OX system

    Hi JasperNM,
    You may access a card within the cart reader by mapping a network drive to access it, then you may transfer the fies to your Mac.
    First locate the printer IP address as following:
    Follow these steps to print a Wireless Network Test Report, the IP address will be listed within that report:
    On the control panel, press the Setup button ( ).
    Press the Right Arrow button ( ) to scroll to Network Setup , and then press the OK button.
    Press the OK button to select Print Network Settings .
    Press the Right Arrow button ( ) to scroll to Wireless Test Report , and then press the OK button. The Wireless Network Test Report prints.
    Now map a network driver by following the steps below:
    Click the Finder icon on your Mac.
    Click the Go menu.
    Click on Connect to Server.
    In the Server Address field enter “smb://ipaddress of the printer” and click on Connect.
    You will be prompted to enter the password. leave it as is and click on Connect.
    The Memory card will be mounted as a disk in the Finder.
    Shlomi

  • In iTunes, my printing is white and the background is black, How do I change it back to white printing on a black background.

    In my iTunes store, the printing is white and the background is black and I have forgotten how to change it back to black printing on a white background? I know that it is a simple answer, but right now I cannot think of it.
    Also, what is the "other" when you are syncing an ipad in itunes and in my case the other is more than half of my 64Gb. How do I find out what it is and then get rid of it if I want to?
    Thanks

    Hi gramie47,
    Sorry to hear that didn't resolve the issue.
    I checked online for issues printing from the Internet, found a couple of things you can try. Most likely it is a setting that needs to be changed in the browser settings, since the printer prints fine from the computer.
    From Internet Explorer, go to File, Page setup, Remove check from "Printer background color and images" if checked, or vise versa, to see if that helps.
    Here is another document you may take a look at.
    Map Images May Not Print Properly When Using Internet Explorer.
    If you continue to have issues, contact your Internet Provider for further assistance.
    Thank You.
    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!
    Gemini02
    I work on behalf of HP

  • How can I convert RGB Color to Black-White Color?

    Dear everyone!
    I am using Photoshop CS5. I have got a file from my customer which is done as RGB and the resolution is 300dpi. There are black texts and color images in the file. I wish to print Black-White Process Film (1 black color), but I don't know how to solve it. I started converting my file to Grayscale and then the black texts are not black enough because it becomes lighter. When I go to Level and adjust the color, both the image and texts becomes darker. What must I do to make only texts blacker without effecting the image?
    Please find the attached file for the reference.
    For more information, please let me know.
    My Best Regards,
    LUCK

    luck_lesson wrote:
    ...I have got a file from my customer which is done as RGB and the resolution is 300dpi. ..
    What file format was supplied to you? Was it truly RGB @ 300ppi or did you rasterize a PDF?
    300ppi is lousy for text. You might converse with your customer to instruct them on the ideal way to supply a file to you.

  • Type 4 printer driver shows color is available when printer is not a color printer

    I am working on migrating to a new Windows Server 2012 print server.  I am trying to use the new version 4 printer drivers whenever possible.  I have noticed an interesting thing.  Here is an example.  When I added a new printer, an HP
    LaserJet P3005 black and white printer using the HP LaserJet P3004/P3005 PCL6 Class Driver, under "features" it reports Color as "Yes."  Now the printer is not color and I have noticed this on all of the other class 4 drivers for black
    and white printers.  Am I missing something or is this supposed to be this way?  The printers do print fine, I just wanted to know why this is showing up like this.

    Really a question for HP since it is their software.
    BUT:  A class driver can be used for a wide range of devices.  If the core class driver HP added for the P3005 is also used by devices that support color then the driver itself DOES support color even when the device does not.   There
    are a couple ways HP could code around this.  I do see that HP's PS version of the P3005 does not have a color option in Printing Defaults. 
    I have seen this type of issue from other vendors on previous operating systems, it's not just HP nor anything specific to class drivers although a class driver would expose this when the software to constrain the feature has not been added by the vendor.
    Alan Morris Windows Printing Team

  • Can't get white color to stay white between color profiles

    Hello,
    I installed Photoshop CS4 and am using a Samsung flat panel monitor. I do web design and print design. Here is the problem:
    Web design:
    Color profile is set to Monitor Color
    Proof color is set to Monito RGB
    Proof Colors is checked
    When I save image through Save For Web, it looks fine in the preview box but in some browsers it has blue tint (even the white color now looks blue)
    I tried embedding the monitor coor profile into the exported JPEG and tried converting to sRGB and it always is a problem
    Print design:
    When I make a new CMYK document 300dpi the white now has a yellow tint.
    I tried to paint the entire image white (and the foreground color is clearly white) then go with the eyedropper it says its fff6db (yellowish)
    Proof Color: working CMYK
    CMYK Color: US Web Coated (SWOP) v2
    Color Managment Policies are all off
    What I want is an explanation of how I can make sure that the colors are correct on my screen such that what I see on the monitor is exactly what everyone will see on their browsers. And that there are no color shifts. I had version 6 at work and its fine, when I converted from RGB to CMYK the colors just got a little washed out but the whites remained white.
    -Max

    Web design - you're ignoring the display profile, twice.  What you see on your system is exactly what you'll see in the browsers. But nobody else will ever see it exactly the same way because you refer everything to your specific display.
    Print design - you're actually using the display profile, and that profile is wrong.  You're seeing a yellow tint because your monitor profile claims that the white is bluer than it really is, and Photoshop is correcting for that.  To get rid of the tint, you need a display profile that correctly describes your display.

  • How to avoid white color in photo taking in iphone 4s at night with flash?

    how to avoid white color in photo taking in iphone 4s at night with flash?

    HI Lisa91,
    Here is a link to a post about the same problem you are having and the same printer. You may find the posts helpful as some were able to find a solution. Post number 6 and number 12 specifically have found solutions that worked for them. Hope this helps some.
    If I helped you at all it would be great if you clicked the blue kudos star!
    If I solved your post please mark it as solved to help others.
    I'm a printer tech with HP.

  • Printing the white in an image

    Is there a way to change the content of a picture file so that the white in the image prints as white as oppose to being an absence of colour? I have a good photo stylus printer. I would like to be able to print black and white drawings onto manila.

    It would be easier to scan the manila paper to use its color as a swatch and print with black and manila on white paper.
    In order to print with white, you need a printer that can support white as a color. Generally this is an expensive printer, which would probably be better done at a print shop that has a printer that supports white ink. That being said, you may have a hard time finding anyone, since it is a rare request. {My assumption}

  • Printing black & white

    Hi,
    I have only had a mac for a few months now and there is one thing I still can't figure out...
    How can I set my printer to only print black & white, either for the job at hand or as a default.
    I have the 2.16 Core Duo 15" MBP with the Canon PIXMA iP5200.
    I have wasted all my color ink on various items for school which only need to be in black and white.
    Adam

    Hi Adam
    In the Print Dialogue box
    ColorSync
    Quartz Filter, choose black and White.
    If you do this a lot you can set up a Preset, say called B&W, save it to the chosen setting, and then next time just select it.
    regards roam

  • Ability to print in white

    I have an HP Officejet J4540.  Does anyone know if I can print in white by changing the color settings?  I would like to print white letters on dark purple paper.
    thank you, DonnaCD
    This question was solved.
    View Solution.

    The printer uses a subtractive process, it cannot print white on a dark background.  (The lightest color it can print is no ink at all, which would be the color of the background.  You would need a printer with white ink.  I do not know of any currently available printers with this capability, I think there used to be an Alps printer that would print white.  
    Another option would be to print in reverse, printing the purple background on white paper.  This would us a lot of ink and may not give the results you want....
    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

  • Want to print event in color, not the dash of color before it

    Why does ical only print a color bar before an event and doesn't print the event in the color assigned to it?? it does on the screen but prints the event in black in white with the little dash of color before it and isn't as easy to have your eye find what you are looking for without the events being printed in color. help!!

    mdems,
    Would love to see if anyone has an answer - or if anyone is listening at Apple HQ --
    This Forum is unfortunately not Apple Support. According to Apple:
    What is Apple Discussions and how can it help me? 
"Apple Discussions is a user-to-user support forum where experts and other Apple product users get together to discuss Apple products. You'll find a wealth of information about your favorite Apple hardware and software products that will help you get the most out of your purchase. You can participate in discussions about various products and topics, find solutions to help you resolve issues, ask questions, get tips and advice, and more.
    If you have a technical question about an Apple product, be sure to check out Apple's support resources first by consulting the application Help menu on your computer and visiting our Support site to view articles and more on our product support >pages."
    There is no way that I know of to print events in color. That is probably why this question has gone unanswered. One workaround is to use a screen shot to capture and print the calendar with Preview.
    This is a feature we want!!
    I would recommend that you provide iCal Feedback, if you are interested in informing Apple of your desires.
    ;~)

  • OfficeJet 6500 A Plus Won't print on certain color paper

    When I try to print on certain colors of pastel paper I get an error message saying there is a mismatched page size. This is a refurb unit because the original printer wouldn't print all colors of ink consistently and replacing the printhead didn't correct the problem.
    After an hour on the phone with tech support we were able to get it to print on pastel paper if I set it to draft quality but it still won't print in normal quality. Tech support blames it on the brand of paper I have despite the fact that I didn't have this problem with the same paper (even from the same ream) with the original printer. The only solution available to me is to use draft quality or use HP brand paper (and that is simply what I was told, I haven't bought their paper to see if this works - haven't even found their color paper).
    Anyone have a real explanation/solution to this problem since HP clearly isn't standing behind this product? (Yes, they have replaced the printhead, the printer and now are replacing the duplexer, but having to replace all these parts and still telling me I have to use draft quality does not bode well for the quality of this product.)
    Thanks for any help/suggestions.

    I have the same problem. The printer seems to sense the paper before printing and if it's pastel, is feeds that sheet through and every other one until it finds a pure white one, then it prints. I tried different paper type settings under printer properties before printing but no luck.
    I got tired of wasting paper and ink so in the end I took a print out on plain white paper and photocopied it onto the pastel paper. That worked fine.
    This tells me that the printer driver is messed up or I did not manage to hit on the right paper type setting for the paper I was trying to use.
    Photocopying onto your specialty paper is a suitable work around if you are printing just a few pages but not for larger runs.
    Irv

  • Label Printer -  to do color coding

    I am looking for a printer, which could print labels with color coding.
    Let me explain, what I am trying to acheive..
    1.  I should be able to print labels, - labels of size 4  X 6 IN, or 3 X 2 IN or any sizes of label -- >  the label is not colored, just like any normal label, with white background, and data being printed in black color..(this is what all intermec and zebra printers do.. )
    2. Label has barcodes --> linear bar codes as well as 2D Matrix barcodes... : This could be acheived by any of the Intermec printers (PM4i or 3400E ) or Zebra Printers.
    3. The label should contain a colored strip based on the content of the packing box . for eg, if it is rubber part, the label should contain a Red color strip, if plastic then yellow color, if assembly then blue and so on...  A colored bar of  rectangular shape, (1 cm width and 3 cm long ).
    Does anyone know any Printers out in the market, which could do this 3 rd step ?  (obviously along with first step and second step ).
    I called Intermec and Zebra - they both dont have it...
    Also, Please keep in mind that, these printer should be capable of printing these labels from SAP ---> ie, we will be calling a standard text (SO10), using the write_form, and these printer should be able to print it...
    Any input, even a clue, will be of much help for me.
    Thank you
    Sujamol

    From the top of my head, something like this.
    IIF([Priority]="High", "<RED>" + [Description] + "</RED>", IIF([Priority]="Medium", <YELLOW>" + [Description] + "</YELLOW>", <GREEN>" + [Description] + "</GREEN>"))
    But I vaguely remember you could assign colors to fields in the Calendar, so I think I did something else.
    I think I created calculated fields where only one would have text depending on the Priority.
    So let's say I created 3 calculated fields and added them all three to the calendar.
    Only fields that contain text will show up.
    Calculated Field Description Red: IIF([Priority]="High", [Description], "")
    Calculated Field Description Yellow: IIF([Priority]="Medium", [Description], "")
    Calculated Field Description Green: IIF([Priority]="Low", [Description], "")
    But I never worked with On Demand Calendar, so you have to check what works best for you.
    You can also check: How to Configure Standard Applet "Activity HI Calendar Applet" so it Displays Icons or Different Colors to Reflect the Status of the Activities? [ID 1373880.1]
    And it looks like you have more control in Siebel 8 (again, I never worked with On Demand, so you have to check yourself).
    Bookshelf: Siebel Applications Administration Guide -> Calendar -> Configuring the Calendar -> Displaying Fields, Colors, Drilldowns, and ToolTips

  • How to print with NO COLOR MANAGEMENT in Photoshop CS6

    Hi,
    I have been trying to print a target from i1Profiler so I can read it with my i1Pro and create a printer profile, but no matter what I do, there is no way to get photoshop from supplying a profile while printing. I tried to select Printer handles color and then put the printer driver in COLOR MANAGEMENT OFF (seemed to me this would disable both the printer managing color and photosbop managing color). Tried printing this way ( and many other ways) but NO SOLUTION --- the prints are EXTREMELY different from the on-screen view (which is in a properly profiled Apple monitor) and they actually look like the ones with a profile chosen.
    I also tried the utility Adobe Color Printer Utility and same results!!
    I am using an EPSON Stylus Pro 7900 that I just purchased.
    Please help
    Juan Dent

    [email protected] wrote:
    Hi,
    I have been trying to print a target from i1Profiler so I can read it with my i1Pro and create a printer profile...
    The key here is to actually actually go ahead and print the target from i1Profiler to your printer...in the Test Chart panel, create the test chart and click on Print instead of Save As. As long as you have the correct page size set in the Page Setup, you should get an accurate printer target to read. Depending on how many patches you have set, it may take a few pages but they will be properly formated for reading with the i1Pro...

Maybe you are looking for

  • Upgraded to newest version of iTunes and it will not open. Please help!

    I've already tried removing Quicktime from my computer and reinstalling it and that worked once but after I shut down my computer and turned it back on iTunes would not work again and trying to repair the Quicktime program did not work.

  • Stored procedure call throwing SQLException

    Our application recently migrated to WLS8.1 SP3 from 7.0 SP4. While registering the value to OracleTypes.CURSOR, I am getting the following exception. We are using oracle 8.1.7, and thin driver(Solaris 5.9). After installing I noticed that WLS8.1 doe

  • How to remove the scratch from my i phone

    how to remove scratch from my iphone back cover

  • Safari completly dead

    Hi! About 3 days ago the Apple Update manager installed an safari update and restarted my mac. Now every time that I try to launch safari it asks me to send a report. I have already tried to reinstall, delete files, googled bla bla bla but nothing wo

  • Help!! I can't Open my Macbook Air!

    Hi ! Im desperate so please help! The thing is, I cant open my Macbook air. Whenever I open it, theres this colorful circle ( circling around ). I though its just loading but i waited a few hours for it. It turned off because its low battery. And whe