Help!How can i draw an image that do not need to be displayed?

I want to draw an image and save it as an jpeg file.
first I have to draw all the elements in an image object.I write a class inherit from Class Component,I want to use the method CreateImage,but I get null everytime.And i cannot use the method getGraphics of this object.Thus i can not draw the image.
when i use an applet,it runs ok.I use panel and frame,and it fails.
How can i draw an image without using applet,because my programme will be used on the server.
Thank you.

you could try this to create the hidden image
try
          GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
          GraphicsDevice gs = ge.getDefaultScreenDevice();
          GraphicsConfiguration gc = gs.getDefaultConfiguration();
          offImage = gc.createCompatibleImage(100, 100);
          offG = offImage.getGraphics();
      catch(Exception e)
          System.out.println(e.getMessage());
      }

Similar Messages

  • I am using an Macbook pro in conjunction with a Time Capsule. I back up all my aperture librarys on it, but how can i view these images that are stored on the capsule please ??

    I am using an Macbook pro in conjunction with a Time Capsule. I back up all my aperture librarys on it, but how can i view these images that are stored on the capsule please ??

    If you want to see what is in a file that is backed up by time machine then you have to restore the entire file. Having said that I have had good experience with Time Machine and individual files... if the file is there then all of it's components are almost for sure there. A way to get around this in Aperture would be to use referenced images. The images then still exist as individual files and can be backed up and restored individually. You would have to do so on a file by file basis though and your album information would still only be saved within the Aperture library.

  • On CS5, how can I recover jpeg images that were Batch Renamed prior to removal from my flashcard?

    On CS5, how can you recover JPEG images that were accidentally Batch Renamed prior to removal from a flash card? Is it a total lose or can they be saved somehow?

    If they were renamed on the flash card that is a poor practice.  If renamed in Bridge the old names can be recovered it you have checked "preserve original name in XMP".  If not you are out of luck.  But you still have the images correct?

  • HT1727 How can i retrieve purchased audiobooks that were not synced (problem encountered during sync process).  My account shows the purchase history, but the apps are no longer displayed in itunes or on my ipad or iphone

    How can i retrieve purchased audiobooks that were not synced (problem encountered during sync process)?  My account shows the purchase history, but the apps are no longer displayed in itunes or on my ipad or iphone.  I'm not very savvy with using iTunes - I don't think is very intuitive (unlike me:)).  Any help would be appreciated.
    Thanks

    Hello mcegirl4,
    Thanks for using Apple Support Communities.
    Please refer to the instructions in the following article to assist in downloading those previous purchases from iTunes and the App Store:
    Download past purchases
    http://support.apple.com/kb/HT2519
    Take care,
    Alex H.

  • How can I draw an image when the mouse is clicked

    I am trying to draw X's and O's for a tic-tac-toe board and I cannot conceptualize how to get the X or O to appear if the mouse is pressed on an individual [row][col].
    Im using the MouseListener with a mouseAdapter as an inner class of paintComponent. Using the mousePressed method I want to draw the X or O when one square detects a mousepress
    How can I get the image on the partiuclar square. Im stumped presently. Any help is appreciated
    Thanks.

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TicTacToe extends JPanel
        Rectangle[] cells;
        int[] hits;
        final int
            GRID =  3,
            PAD  = 25;
        public TicTacToe()
            // jvm initializes all elements to zero by default
            hits = new int[GRID * GRID];
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int w = getWidth();
            int h = getHeight();
            int xInc = (w - 2*PAD)/GRID;
            int yInc = (h - 2*PAD)/GRID;
            if(cells == null)
                initCells(xInc, yInc);
            // vertical lines
            int x1 = PAD + xInc, y1 = PAD, x2 = w-PAD, y2 = h-PAD;
            for(int j = 0; j < GRID-1; j++)
                g2.drawLine(x1, y1, x1, y2);
                x1 += xInc;
            // horizontal lines
            x1 = PAD; y1 = PAD + yInc;
            for(int j = 0; j < GRID-1; j++)
                g2.drawLine(x1, y1, x2, y1);
                y1 += yInc;
            // draw hits
            g2.setPaint(Color.red);
            for(int j = 0, side = 30; j < hits.length; j++)
                if(hits[j] == 1)
                    int row = j / GRID;
                    int col = j % GRID;
                    int x = PAD + xInc/2 + col * xInc - side/2;
                    int y = PAD + yInc/2 + row * yInc - side/2;
                    g2.fillRect(x, y, side, side);
            //g2.setPaint(Color.blue);
            //for(int j = 0; j < cells.length; j++)
            //    g2.draw(cells[j]);
        public void addHit(int cellIndex)
            hits[cellIndex] = 1;
            repaint();
        private void initCells(int width, int height)
            cells = new Rectangle[GRID * GRID];
            for(int row = 0; row < GRID; row++)
                for(int col = 0; col < GRID; col++)
                    int index = col + row * GRID;
                    int x = PAD + col * width;
                    int y = PAD + row * height;
                    cells[index] = new Rectangle(x, y, width, height);
        public static void main(String[] args)
            TicTacToe ticTacToe = new TicTacToe();
            Selector selector = new Selector(ticTacToe);
            ticTacToe.addMouseListener(selector);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(ticTacToe);
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class Selector extends MouseAdapter
        TicTacToe ticTacToe;
        public Selector(TicTacToe ttt)
            ticTacToe = ttt;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            Rectangle[] r = ticTacToe.cells;
            for(int j = 0; j < r.length; j++)
                if(r[j].contains(p))
                    ticTacToe.addHit(j);
                    break;
    }

  • How can I cancel the item that did not ship on my pre-order.

    Hello,
    I ordered two devices on my pre-order, one item shipped and the other didn't.
    How do I cancel the item that did not ship on my pre-order?

        sirguynate805 We're glad that you received your iPhone 6 Plus! Check out this link for cool iPhone info http://vz.to/1e948q1 . Enjoy your new phone and let us know how we can help.
    SheritaH_VZW
    Follow us on Twitter
    @VZWSupport

  • How to create an OAF page that does not need login to access

    We have a lot of Oracle users, and everyday there are some users forget there username or password and need reset. I really want to use a web page to let them reset their passwords automatically. The web page will call the API to reset password if it found the user request is legible.
    So based on the situation, the users should not need a login to get to this page, can I do this using OAF?
    And idea is welcome, thank you for your help!
    -Bill
    Edited by: billzheng2004 on Jun 18, 2009 12:12 PM

    Srini,
    Thank you for your response, I think we need to go back to my original question, is it possible to create an OAF page that does not need login, how can I do that.
    I think I said too much and led us to go to a different direction I did't want to. But I am still glad to texplain why I need a custom password reset process, that is all about business requirement, here it is:
    ----I am not sure that "company issues" (such as what you described) can be solved by software -
    I already have a solution for that. Create a custom OAF page, ask user to input his SSN / Date of Birth.... then I can figure out what his real username easily. And I can reset his password as his SSN or something which only this particular user knows. Then he can login.
    ----you may have to impart training to end users.
    As I mentioned, most of our users use only Benefit self service. They only login several times a year, even they are trained this year, most of them will forget next year, this is just human nature. And because the nature of our business, thousands of employees may change at the end of a year. It does not make any business sense for company to prepare trainers every year.
    ----In any case, the functionality you require is already built into the product.
    I guess the reason most companies hire Oracle Developers is that some functionality Oracle Applications provide is not exactly the companies needed. When there is Oracle Apps product, there is alway customization.

  • Mail, how can you remove an image that shows up in the header?

    I have no idea how this image got where it is, but I would like to remove it. When I open Mail, I see in the address area of the email as it displays in the message viewer, to the very right of that area, there is an image, that I have no idea how it got there or how to remove. The following is a link (I think) Mail/Users/alaska_juliens/Desktop/Picture 7.png ...... that shows what I am talking about. I have gone through my signatures and made sure that image isn't in there and it isn't. Please help, it is driving my husband nuts, we would love to change the image to his company logo if possible, but we don't know if that image even shows up when others receive email from us or not (we email ourselves and it is right there in the address header of the email). Thank you for your time and help.
    Mail/Users/alaska_juliens/Desktop/Picture 7.png

    Typically what shows up there is the address book picture for that contact. If they attach an image it will be added to the address book.
    So go to the contact in address book and change or delete the image.

  • How can I draw an image in the browser using mouse

    I have to draw an image in the browser and have to store a file in the server and I don't know how can I do it. Is there anybody who konw it.

    Components other than applets cannot be downloaded into client machines
    unleess There is a Java Web Start kind of Mechanism present on client and the server also supports
    this .Hence your application is between Applet ---Xdownloadable ApplicationXX ---- traditinal Application

  • How can i see the images that i've already sent in bbm with the description that i did??

    Hello!, i can't see the description of the images that i've already sent by bbm. Is any way to see that???. Any app for that??. Please i need help!

    If you mean your iCloud backup, you can't see the individual files contained in the backup.  You can only access the data in the backup by restoring it to your device.
    You can see categories of data stored in your iCloud account by going to Settings>iCloud>Storage & Backup>Manage Storage.  You can see the actual data by looking in the apps on your device that are syncing data with iCloud (contacts, calendars, notes, etc.).  You can also see some of this data by going to icloud.com from your comptuer.

  • How can I create a template that does not have automatic formatting but my own?

    I have just switch to a Mac from a PC and am having a terrible time with pages.  All I want to do is create my own template that has NO AUTOMATIC FORMATTING so I can do my own.
    There is nothing in the HELP sections on how to delete the automatic formatting.  I do not want to use any of their Outline Templates just make up my own.
    I would be so so grateful if someone could help me with this.  I took a one-on-one and his idea of how to get rid of formatting in my own template DID NOT WORK!
    Thanks, Deborah

    Deborah
    Hard to see your problem, and if there is something THAT DOES NOT WORK! it would obviously be useful to know WHAT that is and WHY you believe it does not work, so we can ACTUALLY RECOMMEND A SOLUTION.
    Just select any text and change it to whatever you want using the toolbar and/or the Text inspector.
    The Outlines are just a view of your text, in a form that lets you easily organise and move it around.
    Menu > View > Show Styles Drawer
    Reveals whatever style has been applied to a heading or text and you can update or create new styles by clicking on the small triangle next to it > Redefine style from selection
    When you are finished just save it as a Template.
    Peter

  • How can I see any files that did not originally come on the mac

    I downloaded and erase a few things here and there and ever since I did that I feel a slight differnce in the power of my book.. and I am completely new to mac so I am not sure how to navigate through everything completely just yet. I know how to use finder etc. but like is there a way to just look at recent files that are not natural to a mac so i can delete them
    I have the brand new Macpro btw i dont think that should make a differnce with any of the answers but just incase.....
    I thank you guys in advance for any help I can get I love making sure I have no trash or malware on my computer that i just paid 3k for

    I'm afraid that my way and Tom's way of perceiving your question are quite different. It would be confusing to have two people dragging you into different realms of troubleshooting, so I will leave this question for you and Tom to work out. To many cooks spoil the broth.
    Below is my treatise on trying to fix slow computers:
    Things You Can Do To Resolve Slow Downs
    If your computer seems to be running slower here are some things you can do:
    Start with visits to:     OS X Maintenance - MacAttorney;
                                      The X Lab: The X-FAQs;
                                      The Safe Mac » Mac Performance Guide;
                                      The Safe Mac » The myth of the dirty Mac;
                                      Mac maintenance Quick Assist.
    Boot into Safe Mode then repair your hard drive and permissions:
    Repair the Hard Drive and Permissions Pre-Lion
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Utilities menu. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer.
    Repair the Hard Drive - Lion/Mountain Lion/Mavericks
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the Utilites Menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD disk icon and click on the arrow button below.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    Restart your computer normally and see if this has helped any. Next do some maintenance:
    For situations Disk Utility cannot handle the best third-party utility is Disk Warrior;  DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption; Disk Warrior 4.x is now Intel Mac compatible.
    Note: Alsoft ships DW on a bootable DVD that will startup Macs running Snow Leopard or earlier. It cannot start Macs that came with Lion or later pre-installed, however, DW will work on those models.
    Suggestions for OS X Maintenance
    OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility such as Macaroni, JAW PseudoAnacron, or Anacron that will automate the maintenance activity regardless of whether the computer is turned off or asleep.  Dependence upon third-party utilities to run the periodic maintenance scripts was significantly reduced since Tiger.  These utilities have limited or no functionality with Snow Leopard or later and should not be installed.
    OS X automatically defragments files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive.
    Helpful Links Regarding Malware Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    Also, visit The XLab FAQs and read Detecting and avoiding malware and spyware.
    See these Apple articles:
              Mac OS X Snow Leopard and malware detection
              OS X Lion- Protect your Mac from malware
              OS X Mountain Lion- Protect your Mac from malware
              About file quarantine in OS X
    If you require anti-virus protection I recommend using VirusBarrier Express 1.1.6 or Dr.Web Light both from the App Store. They're both free, and since they're from the App Store, they won't destabilize the system. (Thank you to Thomas Reed for these recommendations.)
    Troubleshooting Applications
    I recommend downloading a utility such as TinkerTool System, OnyX, Mavericks Cache Cleaner, or Cocktail that you can use for removing old log files and archives, clearing caches, etc. Corrupted cache, log, or temporary files can cause application or OS X crashes as well as kernel panics.
    If you have Snow Leopard or Leopard, then for similar repairs install the freeware utility Applejack.  If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the command line.  Note that AppleJack 1.5 is required for Leopard. AppleJack 1.6 is compatible with Snow Leopard. Applejack does not work with Lion and later.
    Basic Backup
    For some people Time Machine will be more than adequate. Time Machine is part of OS X. There are two components:
    1. A Time Machine preferences panel as part of System Preferences;
    2. A Time Machine application located in the Applications folder. It is
        used to manage backups and to restore backups. Time Machine
        requires a backup drive that is at least twice the capacity of the
        drive being backed up.
    Alternatively, get an external drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is not significant):
      1. Carbon Copy Cloner
      2. Get Backup
      3. Deja Vu
      4. SuperDuper!
      5. Synk Pro
      6. Tri-Backup
    Visit The XLab FAQs and read the FAQ on backup and restore.  Also read How to Back Up and Restore Your Files. For help with using Time Machine visit Pondini's Time Machine FAQ for help with all things Time Machine.
    Referenced software can be found at MacUpdate.
    Additional Hints
    Be sure you have an adequate amount of RAM installed for the number of applications you run concurrently. Be sure you leave a minimum of 10% of the hard drive's capacity as free space.
    Add more RAM. If your computer has less than 2 GBs of RAM and you are using OS X Leopard or later, then you can do with more RAM. Snow Leopard and Lion work much better with 4 GBs of RAM than their system minimums. The more concurrent applications you tend to use the more RAM you should have.
    Always maintain at least 15 GBs or 10% of your hard drive's capacity as free space, whichever is greater. OS X is frequently accessing your hard drive, so providing adequate free space will keep things from slowing down.
    Check for applications that may be hogging the CPU:
    Pre-Mavericks
    Open Activity Monitor in the Utilities folder.  Select All Processes from the Processes dropdown menu.  Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time (>=70,) then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Mavericks and later
    Open Activity Monitor in the Utilities folder.  Select All Processes from the View menu.  Click on the CPU tab in the toolbar. Click twice on the CPU% column header to display in descending order.  If you find a process using a large amount of CPU time (>=70,) then select the process and click on the Quit icon in the toolbar.  Click on the Force Quit button to kill the process.  See if that helps.  Be sure to note the name of the runaway process so you can track down the cause of the problem.
    Often this problem occurs because of a corrupted cache or preferences file or an attempt to write to a corrupted log file.

  • How can i delete a file that is not working?

    Hi there. I have the following problem. Under the all files folder there are a couple of .avi files that do not appear anywhere else on my system, they are not working and they cannot be deleted or opened! When I click on them, I get a message that says delete, repair alias or ok. Click delete or ok and nothing happens, click repair and it says locate the original file. When I do so, again nothing happens!!
    Can anyone please help? I want to get rid of them as they are taking over a precious 10GB on my macbook air
    Thank you

    OK, this officially crosses over to the bizarre.
    I believe booting from the Lion recovery partition and selecting Disk Utility is next. Run "repair disk". I believe that it will find some directory corruption and should fix it.
    Here are a couple of places to go for more help, courtesy of Pondini.
    Verify your internal HD, per #6 in Using Disk Utility.
    If that doesn't help, see Where did my Disk Space go?

  • How can I copy a webpage that will not let me highlight it, i.e. use the control c key strokes?

    How can I take a picture of a webpage that will not let me use the control C copy command? In other words, on this particular website, I try to highlight a passage that I want to save and put in a document, but the highlighting will not work. I asked them about that, and they simply said they did not have that facility, but I think the issue is protecting their copyrighted material. I know there is some way to take a picture of the page, and then I can use my picture editing software to crop it and enlarge it.

    Are you trying to take a "snapshot" in a PDF?
    If the part of the page or PDF you want to capture is fully visible, you can use the Windows print screen function to capture it. Either use the Print Screen key to capture the entire monitor display, or Alt+Print Screen to capture the active window.
    If you need to do this often, or if you want to save the snapshot straight to disk, or if you need more than fits in a single Windows screen shot, an add-on such as [https://addons.mozilla.org/en-us/firefox/addon/fireshot/ Fireshot] can be handy.

  • How can I eject a dvd that will not play and says "supported dish not available,  also DVD player encountered a system error  -69902

    I am unable to eject a DVD.  When I try the screen says "Supported dish not available."  Before that a DVD stopped playing and the screen said 'DVD player encountere a system error  -69902.  How can I get the DVD out?

    restart your mac while holding down on the mouse.

Maybe you are looking for

  • Bug with BRAND NEW osx 10.8.3 and adobe Reader 11.0.03

    can you help?? i download a .pdf from internet to desktop, flash or harddrive then try to open but then get these error messages -- ON MY BRAND NEW COMPUTER "There was an error opening this document. There was a problem reading this document (14)." "

  • Verizon not honoring their online price quote

    I renewed my FIOS account on 6/9/14 (while processing a move to a new address) and the online quote was for $124.99/month. Now the reps are telling me that the online quote included discounts that expired that day (the day my current agreement ended)

  • Java.crypto.Mac usage related to concurrency

    My first question is: Can I allow multiple threads to use the same instance of java.crypto.Mac concurrently? In other words, for example, is the java.crypto.Mac.doFinal(byte[] input) method thread safe? If the answer is no, then my second question is

  • HOW: Re-order the film clips to be in chronological order

    iMovie '11 When the clips of my cousin's New Year's Eve '10 fireworks party was uploaded to my iMovie '11, they ended up in scrambled order in the Event Library (the big window to the right of the Event Library). I realize that it is not necessary to

  • How do I stop iphone 4s camera from automatically closeing when open?

    How to I stop the camera ap from automatically closing when it is opened?  I click on it and it opens and then closes and goes back to home page.