How do I get a white background with black lines

How do I get a white background with black lines and characters on my screen. To run the program, copy it out and delete the ` and it should go. If it does not compile on your machine, I would like to know. There is a test on about line 34 for changing the colors.
`//Simple program to test Graphics2D.setBackground(white) obtained from BufferedImage.getGraphics()
`import java.awt.Frame; //Object>awt.Component>Container>Window>Frame
`import java.awt.Insets; //Object>awt.Insets
`import java.awt.image.BufferedImage; //Object>awt.Image>awt.image.BufferedImage
`import java.awt.Graphics; //Object>awt.Graphics
`import java.awt.Graphics2D; //Object>awt.Graphics>Graphics2D
`import java.awt.Color;
`import java.awt.BasicStroke;
`public class TstBgCol { //frame & BufferedImage in pixels & BasicStroke in points ????????????
` TstBgCol tstBgCol;
` public static void main(String[] args) {
` TstBgCol tstBgCol=new TstBgCol(); tstBgCol.tstBgCol=tstBgCol;
` tstBgCol.main2(); tstBgCol.byteBinary();
` }
` Graphics fgcontext;
` Frame fram; Insets insets; //borders of the Frame, Container.getInsets
` int bIWid=1272,bIHgt=876; //set for 1280x1024 screen on windows XP & matches paper ratio 10.6x7.3
` int unusedPixHgt=84;
` void main2() {
` fram=new Frame();
` fram.addWindowListener(new java.awt.event.WindowAdapter() { //anonymous inner class
` public void windowClosing(java.awt.event.WindowEvent e) { System.exit(0); }
` });
` fram.setVisible(true);
` insets=fram.getInsets(); //(Container)getInsets() works after displayable
` System.out.println("Insets l,t,r,b:"+insets.left+","+insets.top+","+insets.right+","+insets.bottom);
` fram.setSize(insets.left+bIWid+insets.right,insets.top+bIHgt+unusedPixHgt+insets.bottom);
` fgcontext=fram.getGraphics(); //creates Graphics context for this component
` }
` void byteBinary() {
` BufferedImage buIm=new BufferedImage(bIWid,bIHgt,BufferedImage.TYPE_BYTE_BINARY); //can be resized
` Graphics2D bIG2=buIm.createGraphics(); //returns Graphics2D context
` //change to if(true) to use either of the following two lines
` if(false) bIG2.setBackground(Color.white); //does not change the background color to white
` if(false) bIG2.setColor(Color.black); //does change the foreground color to black
` edgeLinesAndX(buIm,bIG2);
` fgcontext.drawImage(buIm,insets.left,insets.top,fram);
` }
` private void edgeLinesAndX(BufferedImage bI,Graphics2D bIG2) { //really on the edge
`      BasicStroke strk=new BasicStroke(10f); bIG2.setStroke(strk);
` int x0,y0,xmx,ymx;
` x0=bI.getMinX(); y0=bI.getMinY(); xmx=bI.getWidth()-1; ymx=bI.getHeight()-1;
` bIG2.drawLine(x0+xmx,y0,x0,y0+ymx); //lo-left to up-right
` bIG2.drawLine(x0,y0,x0+xmx,y0+ymx); //up-left to lo-right
` bIG2.drawLine(x0,y0,x0+xmx,y0); //up-left to up-right
` bIG2.drawLine(x0,y0,x0,y0+ymx); //up-left to lo-left
` bIG2.drawLine(x0,y0+ymx,x0+xmx,y0+ymx); //lo-left to lo-right
` bIG2.drawLine(x0+xmx,y0,x0+xmx,y0+ymx); //up-right to lo-right
` bIG2.drawString("("+x0+","+y0+") wid="+(xmx+1)+" hgt="+(ymx+1),(xmx+1)/5,(ymx+1)/5);
` }
`} //the result on my screen is a black background, why?????

How do I get a white background with black lines and characters on
my screen.Contrary to what you might think, the linebIG2.setBackground(Color.white);does not give the buffered image a white background. The API docs
http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Graphics2D.html#setBackground(java.awt.Color)
say: "Setting the background color in the Graphics2D context only
affects the subsequent clearRect calls... " So adding a line to your
if blocks we getif (false) {
    bIG2.setBackground(Color.white);
    bIG2.clearRect(0, 0, buIm.getWidth(), buIm.getHeight());
if (false) {
    bIG2.setColor(Color.black);                    
}Changing the false to true results in a white background (and black
X and text).

Similar Messages

  • HT201412 My I phone five isn't responding and when I turn it on, I get a white screen with black lines and I can't get into my phone. What is happening?

    My iPhone five decided to go crazy and give me a white screen with black stripes and I can't get into my phone. I can only use Siri! What's happening?

    You posted in the iPad forum instead of the iPhone forum. To get answers to your question, next time post in the proper forum. See https://discussions.apple.com/index.jspa  I'll request that Apple relocate your post.
     Cheers, Tom

  • My 1st generation Ipod touch won't turn on at all and whenever I press the buttons to reset it all I get is a white screen, or a white screen with black lines across.

    My 1st generation Ipod touch won't turn on at all and whenever I press the buttons to reset it all I get is a white screen, or a white screen with black lines across.Help pleaseeeeee!

    You can work through the five 5 R's of troubleshooting to rule out the possibility of corrupted software.
    http://www.apple.com/support/ipod/five_rs/
    It might also be a good idea to let the iPod's battery fully drain. Then charge it back up and restore it once more in iTunes.
    Otherwise, it's likely a hardware issue with the iPod's LCD display, meaning you'll need to take or send your iPod in for service either via Apple or a third party repair service. Here is Apple's repair pricing.
    http://www.apple.com/support/ipod/service/prices/
    Note that they don't actually repair the device, but exchange it for one of the same generation, model, and capacity.  A third party service will actually replace the damaged part for a little less.  Google "iPod screen repair" and you should get a number of results to work with.
    B-rock

  • White screem with black lines

    Hi
    We have a 3g iphone and my husband dropped it today.  It now is just showing a white screen with black lines to the right hand side.  Have tried to reboot with home and off button but nothing seems to work. 
    Any ideas?

    Possibly the LCD Display Connector #1 is loose and needs to carefully be pushed back firmly to the Logic Board. Possibly the LCD Display is damaged and needs to be replaced. Possibly the Logic Board LCD circuitry is damaged, and you basically need a new iPhone.

  • HT5654 my iphone 5 fell did not break but went completely black and non responsive. When I plug it to the computer I get a white screen with black apple. When I push both the Top and Homne buttons simultaneously I get the charger picture plug end plus arr

    my i phone 5 was dropped, didn't break but went completerly black screen and nonresponsive. I pushed both the home button and top button no response. I plugged it to the computer it gave me white screen with black apple. I pushed the home and the top went black then gave the itune and the charging plug picture. I tried to download and update, the message came as couldn't restore due to unknow error. Any help??

    Try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar       

  • I have a iPod touch 5th generation and when i turn on the device, its white screen with black lines and different colors

    I can turn off the device naturally. But when i turn it on it shows all white with black lines and different colors. Is my LCD screen broken? If it is, can apple fix it?

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
      Apple Retail Store - Genius Bar                              
    If not covered by warranty
    Apple will exchange your iPod for a refurbished one for $99 for 16 GB 5G and $149 for the other 5Gs. They do not fix yours.
      Apple - iPod Repair price                             

  • My graphics are not showing properly when online, does anyone know how to rectify this? everything was ok when i was on google chrome now all i get is a white background with black and blue colours grrr

    i just got a basic screen with white background, black and script

    See:
    * http://kb.mozillazine.org/Website_colors_are_wrong
    * http://kb.mozillazine.org/Websites_look_wrong

  • How do i change the white background with the new ios7?

    I just upgraded my iPad mini to iOS7 and now my videos are not titled, or the letters are white and are invisible against the new white background. How can I change this??

    It is rediculous,
    up to IOS6 the iPhone was a perfect device for someone with low vision, well structured, good contrast and readable fonts.
    But things got "improved". What a pitty that Apple has given away that benefit for a lightweight design which reduces ergonomics drastically. Now IOS is SW where design dominates usability.
    Yes, you can use larger fonts, yes, you can use fat fonts but that does not change the keyboard layout.
    It startet in IOS6 with the update of the keypad for the phone application (thin black keys on a flashing white background) and is continued with the vision unfriendly design from IOS7.
    Please, have the flashing white background configurable so a structuring reappears or have the background configurable to white or black.

  • Hi! My macbook pro wont switch on at all, pressing the power doesnt do anything, when plugged it switch on to get the white background with the apple sign and a loading button that kept on forever. anyone has a clue?

    Hello as mentionned before I cannot get my macbook pro to switch on.
    when it is not plugged as I press the power button nothing happens, when the computer is power plugged, it gives me the white blackground with the apple centered and the loading button below but it keeps loading forever left it as for 4 hours and still nothing.
    I have try to reset the SMC but didn't change much, now instead of the apple logo I get a circle crossed
    My macbook is 1 year and 4months

    See Gray Screen, try holding the Shift key upon boot
     Cheat sheet to help diagnose and fix your Mac
    Drive may not boot, but if it's still working then data can be recovered
     Data recovery efforts explained
     Most commonly used backup methods explained

  • How can I get a white background?

    Dowloaded trial version of 5 for Windows at work.....found Control L takes you to eyedropper that is white.
    Cool...
    NOW: Have a MAC at home. Bought 4 today and I cannot find the above feature.
    How can I (easily) get the eye dropper to be white not gray. or...does the Windows function Control L also exist in MAC but is a different shortcut?
    Thanks......loosing my mind

    Barbara ~ Its sort of what I am trying to do. I make fused glass jewelry and am working in getting some clear shots for my website. Currently using an EZ photo cube which helps reduce shadows and better light for the novice. Having a white, or close as possible background helps the pieces pop a bit more and shows their true colors.
    Due to the color shifts in dicroic glass, it can be really hard to get a good picture of what it really looks like.

  • TS1424 how do i get a white background on itunes store instead of the **** black background that you can see anything on?

    whaT IS WITH THE BLACK BACKGROUND AND GREY LETTERS THAT YOU HAVE TO READ ON THE ITUNES STORE?!! WHO IS THE GENIUS THAT THOUGHT THAT WAS A GOOD IDEA?!!! HOW CAN I CHANGE IT TO WHITE??

    Hi there SteveJobsfan, Could you please help me?
    I have attempted to use Drgoo's fix for my black iTunes background but no luck
    I have gone into Control Panel>Hardware&Sound>Colour Mgt>All Profiles>Add>File
    Once I arrive at 'File', this box is blank and does not contain the file Drgoo mentions
    Can you possibily direct me from here please?
    Thanks

  • If firefox starts, the startingpage (whitch is google) shows up for a few seconds, and then go away, and i get a white background with nothing on

    Firefox is gisteren beginnen raar doen, je opent de browser, de startpagina komt er 2 seconden op, en dan verdwijnt die, ik krijg dan een wit scherm, en het is zo bij elke pagina die ik open, (facebook, youtube....) Wat kan dit probleem zijn?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. Safe Mode is a troubleshooting mode, which disables most add-ons.
    ''(If you're not using it, switch to the Default theme.)''
    * On Windows you can open Firefox 4.0+ in Safe Mode by holding the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac you can open Firefox 4.0+ in Safe Mode by holding the '''option''' key while starting Firefox.
    * On Linux you can open Firefox 4.0+ in Safe Mode by quitting Firefox and then going to your Terminal and running: firefox -safe-mode (you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    * Or open the Help menu and click on the '''Restart with Add-ons Disabled...''' menu item while Firefox is running.
    [[Image:FirefoxSafeMode|width=520]]
    ''Once you get the pop-up, just select "'Start in Safe Mode"''
    [[Image:Safe Mode Fx 15 - Win]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, and you need to figure out which one. Please follow the [[Troubleshooting extensions and themes]] article for that.
    ''To exit the Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    ''When you figure out what's causing your issues, please let us know. It might help other users who have the same problem.''
    Thank you.

  • Can't load the new firefox, get a white circle with a line through it on top of the globe/fox icon

    Don't know how more detailed I can put this...can someone help?

    Firefox 4 requires at least OS X 10.5 and an Intel Mac. There is a third party version of Firefox 4 that runs on OS X 10.4/10.5 and PPC Macs, for details see http://www.floodgap.com/software/tenfourfox
    If you prefer, you can get the latest version of Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html
    Mozilla are working to prevent Mac users with non-compatible systems from getting the notification about Firefox 4, and also not displaying the "Download Firefox 4" button on http://www.mozilla.com

  • Is there a way for mac os 10.8 to become a white background with black text in dockmenu like it was in os x 10.5?

    the black dockmenu which was introduced with os x 10.6 is difficult to read for me, i would back the white version which was used in os x 10.5.
    is this possible or would it eventually possible under os 10.8.2 or a newer version?
    thanks

    You can't change it within the OS. There may be some apps which will do it. Search Dock on MacUpdate.
    But all these types of haxies come with possible risk.
    You can file feedback here.

  • How to change white background with text to transparent background

    Good afternoon,
    I have a jpg file (part of our logo) white background with black text and I would like to change it to transparent background and keep the black text (to be able to insert it on a cup image).
    I tried to change it in photoshop, however, when I slide the "opacity" and "fill", the text got ligther as well.
    Do I need to have the original psd.file to be able to do that, or can you please lead me through with jpg file? (I tried to save the jpg to psd and png, but it did not help.)
    I looked on one of your videos, but I could not find one of the features under "Select" tab.
    My plan is to recreate the text to have the transparent background if necessary (It would be great if I can avoid that). However, how do I find out which font was originaly used? Does photoshop has this feature, or do I need to go trough each of the font one-by-one?
    My last question is, how do I change space between letters (to have them more tight. I am not able to find it.
    Thank you for your help,
    Klara

    If you can get teh original PSD file get it, your task will be a lot easier.
    I suspect that won't be an option to you.
    If you know what fonts are being used, that also would be of benefit to you. In other word remake it using your image as a template.
    If it going over an image, then a multiply blend might work for you.
    All that fails then you are down to removing the white background. The problem this option is it will not look as good due to the thin lines on the fonts. But essentially, Load the image into photoshop, make sure the layer isnt locked, then try the magic eraser tool on the white background, bam it'll disappear, but leave the white inside the O white you will have to do seperately.
    Messing with levels will help you with more of the white. Myself i'd rebuild it using the fonts.

Maybe you are looking for