Save capture screen.

//get the file name and it's path from the user's input.
JFileChooser jFileChooser = new JFileChooser();
jFileChooser.setDialogTitle("Save Screen Dialog Box");
jFileChooser.showSaveDialog(null);
fileNamePath = jFileChooser.getSelectedFile().getCanonicalPath();
String fileName = jFileChooser.getSelectedFile().getName();
BufferedImage rectangle;
Robot robot = new Robot();
rectangle = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
OutputStream os = new FileOutputStream(fileNamePath);
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
encoder.encode(rectangle);
Any one know any function to delay system or somthing that i can fix my bug.
The code above when i save the capture screen then the save dialog is captured too,
but i dont want it capture the dialog , just capture only screen.
i try some function like sleep(2000) before i capture but dont help , any one have any idea please help me out,
thank you very much .
Jenny,.

I think the problem might be that the frame hasn't had time to repaint itself before the Robot starts.
From the Robot API I see the following method:
public void waitForIdle() - Waits until all events currently on the event queue have been processed
There is also a delay() method that might do something.
This is just a guess, I haven't tested it.

Similar Messages

  • Capture Screen by Applet

    Hi friends
    I wanna take "print screen" of client screen when user will click on the button on applet.. and applet is into somewhere in web-page. and save that captured screen as a image.
    i want to do it without using any certificate or digitally sign...
    I have used following code in swing, it is working fine but for applet it throwing error....
    :::CODE:::
    Robot robot = new Robot();
    BufferedImage screencapture = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
    File file = new File("screencapture.jpg");
    ImageIO.write(screencapture, "jpg", file);
    Is there any other way to do the same...

    mackOS wrote:
    Hi friends
    I wanna take "print screen" of client screen when user will click on the button on applet.. and applet is into somewhere in web-page. and save that captured screen as a image.OK. If I was a user of your Applet I would be pissed off it you did this. Even if you asked for permission from me I would not allow it.
    >
    i want to do it without using any certificate or digitally sign...You can't .
    >
    I have used following code in swing, it is working fine but for applet it throwing error....
    :::CODE:::
    Robot robot = new Robot();
    BufferedImage screencapture = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
    File file = new File("screencapture.jpg");
    ImageIO.write(screencapture, "jpg", file);
    Is there any other way to do the same...No - thank goodness.
    Do you really think it makes security sense for an Applet to be able to do this?

  • How To Capture Screen Snapshots of the iPhone 3G?

    Is there a way to capture the iPhone screen snapshots, which will allow me to
    capture the mail setting for my Exchange and allow me to quickly create
    a tutorial for all the users planning to get the iPhone 3G to
    check corporate email?
    -Glenn

    You can capture a screen shot by pressing the home button and then the power button and you will see the screen flash white and it will save the screen shot in the photo app.

  • Unable to capture screen fields in eCATT

    Problem description 1 : Unable to capture screen fields in eCATT
    Recording using SAP GUI Method.
    Problem description 2 :Unable to capture Tab controls while recording
    in eCATT using SAP GUI Method.
    Thaks for any suggestion you could provide me and once again for your courtesy attention.
    Regards,
    Eric Monteiro

    Hi Phani,
    Please try below code:
    *data declaration for reading values given by user in the selection screen field.
      DATA: BEGIN OF i_tab OCCURS 0.
              INCLUDE STRUCTURE rsselread.
      DATA: END OF i_tab.
      MOVE: 'LOGSYS' TO i_tab-name,
            'P' TO i_tab-kind. u201CP For parameter
      APPEND i_tab.
      MOVE: 'GP_SIMVE' TO i_tab-name,
            'P' TO i_tab-kind. u201CCheck if field is Parameter
      APPEND i_tab.
    *move program name and screen number into local variable.
      l_prog = sy-repid. u201C(Try by directly passing program name also)
      l_dynnr = sy-dynnr. u201C(Try by directly passing Screen number also)
    *calling function module to get the value given by user.
      CALL FUNCTION 'RS_SELECTIONSCREEN_READ'
        EXPORTING
          program     = l_prog
          dynnr       = l_dynnr
        TABLES
          fieldvalues = i_tab.
    Hope this should slove your issue.
    Thanks & Regards,
    Gaurav.

  • When I have finished working on an image in Photoshop and I hit the save button it goes instead to the "save as" screen. This never happened in previous Photoshop versions. When I get to Lightroom, I have a grey screen the says "File could not be found."

    When I have finished working on an image in Photoshop and I hit the "save" button, it goes instead to the "save as" screen. This never happened in previous Photoshop versions. When I get to Lightroom, I have a grey screen the says "File could not be found." I then have to go to "locate" to get the image. When I select the correct image, I get a message that it is not the same file name but I am eventually able to access the image. Needless to say this is having a negative impact on workflow!

    The problem with write permissions for the OneDrive folder only shows up in Lightroom 6's export dialogue, that's why it's to irritating. Lightroom 5.7.1 is not having that problem nor does the file explorer. The problem also exists on both of my machines. I will try to check for other problems with the OneDrive troubleshooter though: Running the OneDrive troubleshooter - Windows Help   

  • Appleworks6.2.9 "Save As" screen is too large for my iBook 14" screen

    What can I do to make the Appleworks6 Save As screen fit my iBook 14" screen?
    When I click the AppleWorks6 Save As, the screen is larger than my iBook screen. I can barely see the upper 1/8th of the Hide Extention, New Folder, Cancel and Save buttons. The resize button on the lower right edge of normal page is not visible. I can move the screen down and to the right and left but I cannot make the screen smaller because that button is beneath the bottom edge of my screen.
    I also tried clicking the Green button at upper left corner of the page. Nothing happens. It just fills the whole screen and doen not get smaller.
    I do not have this problem on my iMac 15" screen.
    Numero

    I hope you deleted more than just the com.apple.appleworks.plist. There are also 3 preference files in the AppleWorks folder that is in the same location as that .plist that need to be deleted all at the same time. All of this is detailed in my user tip, AppleWorks has stopped working correctly. Since I or someone else refer to this time a couple of times a day, it shouldn't have taken to page 8 to find it unless you were searching just for ".plist" & not preferences.

  • How to capture screen in iOS 7?

    Hi!
    I can't make any screen capture on mi iPhone 5 with iOS7 running. When I try to press HOME and ON/OFF button, the iPhone go to lock mode and nothing else happends.
    How can i capture screens?
    Thank you so much.

    Your best move would have been not to have updated to beta software that's not on public release yet......

  • Re: capturing screen resolution in JSP or servlet

    "Mike Tickle" <[email protected]> wrote ...
              > Is it possible to capture screen resolution in JSP or a Servlet? I can
              > currently do it in JavaScript and write the result in to a cookie that a
              > servlet can read, but is there a better solution.
              > Is it possible to get the time zone of a visitor using JSP or servlets?
              > Can JSP or servlets determine if a visitor has scrolled the page to view
              all
              > of it?
              You seem to be very confused about what servlets and JSPs are. These are
              things that run on the server and generate HTML. They can't possibly know
              if a user has scrolled the page, because the user hasn't seen the page yet
              when they are run. If they tried to read screen resolution, they'd get the
              screen resultion for the graphics subsystem on the server, or an exception
              if one isn't available (eg, there is no X display set).
              For these kinds of client interaction tasks, JavaScript is probably still
              your best option.
              Chris Smith
              

    Hey all you non-ASP programmers, here's the deal. Microsoft has a Browser
              Capabilities component and they have defined a special way for you to
              populate a specially named cookie on the client side that will then allow
              the component to pick up what you sent it. In the ASP script, you then use
              the component. Behind the scenes, it works exactly like what you guys
              imagine, but Microsoft provides the format for sending the information and
              the parsing.
              The client side script does need to be written to include the information
              you want, but it would typically be written once and hidden by the lead
              programmer in a common include file where most programmers never had to
              think about it and thus might think it happened automatically.
              If you're really curious, here's an MSDN link to the details:
              http://msdn.microsoft.com/library/psdk/iisref/comp1vol.htm.
              Rick Joi, former ASP developer
              [email protected]
              www.rickanddonna.com/ips
              "Chris Smith" <[email protected]> wrote in message
              news:[email protected]...
              > "Mike Tickle" <[email protected]> wrote ...
              > > > You seem to be very confused about what servlets and JSPs are.
              > >
              > > I am quite familiar with servlets as I have been using them for 6 months
              > as
              > > part of a uni project. I had the presentation yesterday and the
              moderator
              > > asked why I used JavaScript to determine time zone and screen res. I
              said
              > > JSP/Servlets can not do it as they are server side and he seemed
              confused.
              >
              > Okay. Apologies if I was condescending. Such things happen in newsgroups
              > where I have no idea what your background is.
              >
              > > Apparently ASP can do it. So against my better judgement I thought I
              > would
              > > ask in case I was wrong.
              >
              > I'm surprised if ASP can do it... I can't imagine how that occurs. I
              agree
              > with Jeff, especially after reading the URL he provided; it appears the
              > moderator was just plain wrong, or that there are only very non-portable
              > solutions for IE only.
              >
              > > I currently write the time zone and screen resolution in to a session
              > cookie
              > > so that it can be read every time the servlet is run. Is there a better
              > way
              > > than this?
              >
              > Seems to me like the best way to me.
              >
              > Chris Smith
              >
              >
              >
              

  • Capturing screen resolution in JSP or servlet

    Is it possible to capture screen resolution in JSP or a Servlet? I can
              currently do it in JavaScript and write the result in to a cookie that a
              servlet can read, but is there a better solution.
              Is it possible to get the time zone of a visitor using JSP or servlets?
              Can JSP or servlets determine if a visitor has scrolled the page to view all
              of it?
              Thanks for any help
              Mike
              

    You have to remember JSPs/Servlets run on the server. They can only
              manipulate information that you explicitely pass to them or information
              passed by HTTP. You could pass this information, gathered by JavaScript,
              through a POST or GET method.
              Jim
              "Mike Tickle" <[email protected]> wrote in message
              news:9d8rut$fr4$[email protected]..
              > Is it possible to capture screen resolution in JSP or a Servlet? I can
              > currently do it in JavaScript and write the result in to a cookie that a
              > servlet can read, but is there a better solution.
              > Is it possible to get the time zone of a visitor using JSP or servlets?
              > Can JSP or servlets determine if a visitor has scrolled the page to view
              all
              > of it?
              > Thanks for any help
              >
              >
              >
              >
              > Mike
              >
              >
              

  • Can I automate 'Capture screen' on a remote Mac in Apple Remote Desktop?

    Subject says it all really, I need to find a way to automate screen capture on an an ARD managed Mac.
    Is it possible to automate 'Capture screen' on a remote Mac in ARD 3.3.2?
    Cheers
    Phil

    You can cron or otherwise automate the following command:
    screencapture -x silentscreenshot.jpg
    The x switch means the machine will not play the shutter sound.
    HTH!
    Ryan

  • Capture Screen in SAP

    Hi,
    can you ppl help in this thing.How to capture screen from SAP and store it in the presentation server(any given path).Is it possible to do that.
    Kind Regards.

    Hi,
    I think there is no any such FM or functionality you can done with ABAP, but i hope you can try using some external screen capture application and call that from ABAP to capture screen.
    See EXECUTE Method of  class CL_GUI_FRONTEND_SERVICES which may help you.
    Regards
    Karthik D

  • I have been using GRAB to capture screen displays.  It has just stopped working since the last OSX Upgrade.  Can anyone, please help restore functionality?

    I have been using GRAB to capture screen displays.  It has just stopped working since the last OSX Upgrade.  Can anyone, please help restore functionality?

    Thanks for that.  I did as suggested but when I tried again, it still did not work.  Another  com.apple.Grab.plist appeared in the Library.
    I now have the following files in Library
    file://localhost/Users/peterpatel/Library/Preferences/com.apple.Grab.LSSharedFil eList.plist
    file://localhost/Users/peterpatel/Library/Preferences/com.apple.Grab.LSSharedFil eList.plist.lockfile
    file://localhost/Users/peterpatel/Library/Preferences/
    file://localhost/Users/peterpatel/Library/Preferences/com.apple.Grab.plist.lockf ile
    What do you suggest I do now?

  • Capturing screen shots in iMovie

    Hi,
    I want to capture screen shots of my movie in iMovie to have still images from different scenes to then edit in photoshop. Is this possible, or do I need to get specific software for that? Does anybody know how to capture screen shots from an iMovie?
    Thanks,
    quadruple

    Position your cursor where you want the still.
    Right-click and select ADD STILL TO PROJECT
    You will see the still added to the en of your project.
    Now right-click on the still and select SHOW IN FINDER
    In the finder, right click on the still JPEG file and select COPY.
    Now you can paste the still onto your desktop or a folder of your choice and import into iPhoto or Photoshop.
    If you don't want to clutter your video project with stills at the end, you can start a new project for just the stills. Then you place the cursor within your EVENT at the point you want a still. Then Right-click and select ADD Still TO PROJECT. This keeps things tidy.

  • Premiere CS4 capture screen won't open

    I was capturing video from mini DV tapes. after 7 tapes of capture, Premiere CS4 capture screen wouldn't open. I had the thing working fine and for some unknown reason the capture screen quit opening. .I've tried restarting the program restarting the computer, I've clicked on the file drop down menu and clicked capture, I've pressed f5.... NOTHING IS WORKING! ARRRRH!!!! Any hep will be appreiciated,?
    Thank you in advance,
    Mel, aka magicmel

    Hi Mel,
    I also have this problem, I got around it by using video DVD maker (http://www.protectedsoft.com/) (chose the 'capture' option) and then editing the avi in premier (cs4). This works fine.
    A little additional info on my problem:
    I am also using mini DV tapes and capturing through a USB, using windows vista 32bit. I do this every day and it has been fine for a year, but suddenly one day it didn’t want to. At first the capture window would open but 'capture device offline' would show, even with the mini dv plugged in and switched on, tape running/paused/stopped. After clicking on the window, it would then turn black, then white and then freeze. Trying to close the capture window by clicking the red 'x' would crash premier, prompting window's 'this programme is not responding' window that meant that a crash report would not be generated.
    As I have said before the usb cable and mini dv are fine as I have successfully managed to capture through another programme. I have also since run the adobe updater which has updated all my adobe software. I have restarted the programme, computer, opened old projects, started new ones and all have not been successful in making any change in the capture crash.
    I remember this happening on my old laptop, and it was solved by just waiting for the programme to respond after 5-7mins. I guess this was to do with the computer being low spec. However This same waiting game does not have any effect on my current laptop, I have waited for 30mins and thought that was enough, the current computer I am using has been absolutely fine for about a year, so why the problems suddenly?
    Only things I can think of that have been changed recently on my laptop are: re-install of windows service pack 2, firewall modifications.
    However the rest of the premier programme works fine, rendering, effects, exporting etc.
    Hope this helps someone!

  • Can I use a submit button that will automatically flatten and open up the save as screen?

    Hello,
    I'm working with forms in Adobe Acrobat Pro 9 and I want the submit button to flatten the document then open the save as screen.  I know I can print to pdf and this automatically will open that screen, but these forms are going to be used with tablets that may or may not have the "print to adobe" as an option.  Is there another way to flatten?  I know the PDF Optimizer will do that too, but it isn't an executable option in the button properties.  Magic anyone?  Thanks.

    It depends very much on the platform and the applications used by the users of this form. If they are using non-Adobe software, all bets are off.
    Also, some tablets (iPad) don't support JS, so even if they do use Adobe's Reader for the iOS, there's not much that can be done in the way of scripting.
    Generally speaking: In Acrobat you can flatten the form, but in Reader that's not possible. What you can do, though, is create a function that makes the form fields read-only, thus preventing the user from editing them after having submitted the file.

Maybe you are looking for