Taking screenshot with java applet using java robot class not working

Hi Everyone,
I am using the java applet to take screenshot of the web browser using the java's robot class.
Robot objRobot = new Robot ();
BufferedImage objBufferedImage = objRobot.createScreenCapture(objRectArea);
The thing work good in windows system taking screenshot but in case of mac osx i get the blank image.When i check the event viewer in mac osx i get the following error.
invalid context
invalid pixel format
CoreAnimation: rendering error 506
The problem is coming for all the browser safari,firefox and chrome.My applet is signed applet.
What might be the reason.An early reply is very valuable.
My machine configuration is as follows.
OS : MAC OSX
Version : 10.6.4
Is that a system level issue , java plugin issue?I'am confused with this error.
Thanks sagar.

870613 wrote:
invalid context
invalid pixel formatHm, seems like the Mac implementation of the Robot class is doing some bad initializations there. I can't be a 100% sure of course, but this smells like a bug to me. Are you sure you have the latest version of Java installed?

Similar Messages

  • Safari for Mac, webpage with Java applet, drag and drop area not working.

    At my company, we have a web page that our users access to submit media files, (QuickTime, Audio, images...), for transcoding for delivery.  The web page consists of a java applet, with an area that our users drag and drop media file into.
    After updating to Safari 5.1.2, the applet will not work anymore. Instead, the browser will "open" the quicktime and play it, instead of allowing the Java Applet to do it's job.
    CAN I TURN THIS FUNCTIONALITY OFF??
    I read that Safari 5.1.2, (when it was initially released), broke something with the THEN current version of Java, and everyone was awaiting the latest update (build 1.6.0_29) to fix it. Unfortunately, this update did not fix my issue with the functionality of dragging and dropping media files into the web page.
    It seems to me, as if, there is an over-arching functionality setting (or something) that needs to be either turned off, or in some other way DE-prioritized.
    Anyone have any ideas?
    Safari 5.1.2
    MacOS 10.6.8
    MacBook Pro

    Thanks for quick reply and help. I am able to drag multiple files but this is giving problem in case of filename with spaces like "abc def.png". Can you please put some thoughts on this.
    DataFlavor uriListFlavor = new DataFlavor("text/uri-list;class=java.lang.String");
                   Reader in = (Reader)t.getTransferData(DataFlavor.plainTextFlavor);
                   BufferedReader br = new BufferedReader(in);
                   String uriStr;
                   while ((uriStr = br.readLine()) != null)
                       URL url = new URL(uriStr);
                       String category = GalleryUtils.contentsPanel.getCurrentCategoryPath();
                       GalleryUtils.generateILPFromFile(new File(url.getFile()), category);
                   }Thanks
    Kanni

  • Robot class not working

    I need to make a macro with the robot class that draws a picture in a paint program. For each color in the image (256 colors total) it should change the paint color and drawing each 2x2 pixel that's that color. I made the program and it works correctly for about an hour, but then it starts slowing down a LOT, entering the wrong color codes, and drawing single pixels instead of 2x2.
    Here is the code for changing the color:
    robot.mouseMove (535, 504);
    robot.mousePress (InputEvent.BUTTON1_MASK);
    robot.mouseRelease (InputEvent.BUTTON1_MASK);
    robot.mouseMove (568, 410);
    robot.mousePress (InputEvent.BUTTON1_MASK);
    robot.mouseRelease (InputEvent.BUTTON1_MASK);
    robot.mousePress (InputEvent.BUTTON1_MASK);
    robot.mouseRelease (InputEvent.BUTTON1_MASK);
    for (i = 0; i < 6; i++)
        robot.keyPress (color.toUpperCase ().charAt (i));
    robot.keyPress (KeyEvent.VK_ENTER);
    robot.keyRelease (KeyEvent.VK_ENTER);Here is the code for drawing each pixel:
    robot.mouseMove (415 + (w * 2), 185 + (h * 2) - 1);
    robot.mousePress (InputEvent.BUTTON1_MASK);
    robot.mouseMove (415 + (w * 2), 185 + (h * 2) + 1);
    robot.delay (100);
    robot.mouseRelease (InputEvent.BUTTON1_MASK);Does anyone know why the robot stops working after about an hour?

    I'll guess that this might have something to do with it:
    for (i = 0; i < 6; i++)
        robot.keyPress (color.toUpperCase ().charAt (i));
        //need to release the key!
        robot.keyRelease (color.toUpperCase ().charAt (i));
    }Also, about your code to draw one pixel: it draws three pixels in a vertical line, at least in my paint program.

  • Java applet using the Swing API

    write a Java applet using the Swing API to manage a PC repair shop. When a PC is brought in for repair, a member of staff will use this applet to log it into the system as a repair job. They will also be able to use the applet to manage the job e.g. allocate a person to carry out the repair and enter costs.
    You must not use a tool such as JBuilder to generate Java code. If you use code from elsewhere e.g. a text book, you must highlight the code and state the reference clearly and include a photocopy of the relevant pages from the text book or other source.
    You should hard-code some initial data into your applet. You should not store any data in a file or database.
    Level of functionality you should attempt to implement:
    Level 1 � Your applet should:
    a.     As a minimum, your program should store (in memory) at least 10 repair jobs. For each repair job, you need to store:
    �     The name and phone number of the customer bringing the PC in for repair;
    �     A brief textual description of the problem;
    �     Whether the PC is under warranty or not.
    b.     Your program must allocate and display a unique number for the job once it is accepted.
    c.     The user must be able to view the details of jobs. They should be able to select either:
    �     All the jobs in the system; or
    �     Jobs being carried out under warranty.
    Level 2 � Your applet must meet the requirements for level 1. In addition it should:
    a.     You should carry out appropriate validation checks on input data e.g. the phone number contains all digits.
    b.     System should cope with an unlimited number of jobs.
    c.     The user should be able to select a job and then allocate a repairer to that job.
    d.     The user should be able to display a list of jobs for each repairer.
    Level 3 - Your applet must meet the requirements for level 1 and 2. In addition it should allow the user to:
    a.     Select a job and input the cost of repair for:
    �     the number of hours labour;
    �     parts.
    b.     Select a job and present the user with a cost for the labour (hard code an hourly labour cost) and parts, plus a total for that job. For jobs under warranty the total will be zero, however the cost of labour and parts will be shown.
    c.     Be able to inform the business of the total expected income from the all the jobs in the system that are not under warranty.
    Level 4 � Your applet must meet the requirements for level 1 to 3. In addition:
    a.     The user should be able to enter a job priority which can be identified as high, medium or low.
    b.     Each repairer should be able to view a list of their jobs in order of priority.

    Done, what next ?
    Noah

  • Displaying java applet using webseal authentication

    Hi all,
    i'm facing a problem about displaying Java applet using Webseal junction for accessing  an application Server based on Websphere.
    I've defined a webseal ACL on accessing a http url that contains link to Java applet: after webseal authentication, the homepage is loaded; in the home page are presented links to java applet, but when I try to load these applets, it seems not working.
    If I load the same applets without Webseal authentication, it seems working.
    Is there any sort of configuration to make for applet regarding Webseal?
    Thanks in advance
    Danilo

    Hi all,
    i'm facing a problem about displaying Java applet using Webseal junction for accessing  an application Server based on Websphere.
    I've defined a webseal ACL on accessing a http url that contains link to Java applet: after webseal authentication, the homepage is loaded; in the home page are presented links to java applet, but when I try to load these applets, it seems not working.
    If I load the same applets without Webseal authentication, it seems working.
    Is there any sort of configuration to make for applet regarding Webseal?
    Thanks in advance
    Danilo

  • Java Applets and .java.policy

    Hi.
    We are developing an applet that need to access to the file systems and anothers properties, like user.home. To do this and don't modify the java.policy of the jre, we create a .java.policy file into user home. The content is:
    grant {
    permission java.util.PropertyPermission "user.name", "read";
    permission java.util.PropertyPermission "user.home", "read, write";
    permission java.util.PropertyPermission "java.library.path", "read, write";
    permission java.lang.RuntimePermission "accessClassInPackage.org.mozilla.jss.*";
    permission java.io.FilePermission "${user.home}/", "read";
    permission java.io.FilePermission "${user.home}/-", "read, write";
    With this configuration it works fine in Linux with Iceweasel, but in windows it's not work (firefox nor internet explorer)!.
    The error is:
    [SignApplet]: M�dulo iniciado.
    [SignApplet]: Cliente de firma iniciado.
    [ESignatureFormatFactory]: Buscando formato 'CMS'... encontrado!
    [SignManager]: Firmando digitalmente...
    java.lang.NullPointerException
         at java.util.Properties$LineReader.readLine(Unknown Source)
         at java.util.Properties.load(Unknown Source)
         at com.telventi.afirma.cliente.utilidades.MimeTypeHelper.<init>(MimeTypeHelper.java:23)
         at com.telventi.afirma.cliente.utilidades.MimeTypeHelper.getInstance(MimeTypeHelper.java:32)
         at com.telventi.afirma.cliente.actions.ACommonAction.<clinit>(ACommonAction.java:59)
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.ASignManager.warn(ASignManager.java:405)
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.SignManagerMSIEWin32.signDigitally(SignManagerMSIEWin32.java:63)
         at com.telventi.afirma.cliente.signatureformat.CMSSignatureFormat.createSignedInfo(CMSSignatureFormat.java:1562)
         at com.telventi.afirma.cliente.signatureformat.CMSSignatureFormat.signExplicitHash(CMSSignatureFormat.java:265)
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.ASignManager.signHashElectronically(ASignManager.java:139)
         at com.tsol.afirma5.util.impl.AppletServiceImpl.generarFirma(AppletServiceImpl.java:60)
         at com.tsol.validacionCertificado.applet.TSolApplet.obtenerFirmaGenerada(TSolApplet.java:105)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    java.lang.ExceptionInInitializerError
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.ASignManager.warn(ASignManager.java:405)
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.SignManagerMSIEWin32.signDigitally(SignManagerMSIEWin32.java:63)
         at com.telventi.afirma.cliente.signatureformat.CMSSignatureFormat.createSignedInfo(CMSSignatureFormat.java:1562)
         at com.telventi.afirma.cliente.signatureformat.CMSSignatureFormat.signExplicitHash(CMSSignatureFormat.java:265)
         at com.telventi.afirma.cliente.signatureformat.signaturemanager.ASignManager.signHashElectronically(ASignManager.java:139)
         at com.tsol.afirma5.util.impl.AppletServiceImpl.generarFirma(AppletServiceImpl.java:60)
         at com.tsol.validacionCertificado.applet.TSolApplet.obtenerFirmaGenerada(TSolApplet.java:105)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.invoke.JSInvoke.invoke(Unknown Source)
         at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
         at sun.plugin.com.MethodDispatcher.invoke(Unknown Source)
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    Caused by: com.telventi.afirma.cliente.exceptions.ClienteFirmaRuntimeException: Error al mapear el archivo de tipos.
         at com.telventi.afirma.cliente.utilidades.MimeTypeHelper.<init>(MimeTypeHelper.java:26)
         at com.telventi.afirma.cliente.utilidades.MimeTypeHelper.getInstance(MimeTypeHelper.java:32)
         at com.telventi.afirma.cliente.actions.ACommonAction.<clinit>(ACommonAction.java:59)
         ... 21 more
    Caused by: java.lang.NullPointerException
         at java.util.Properties$LineReader.readLine(Unknown Source)
         at java.util.Properties.load(Unknown Source)
         at com.telventi.afirma.cliente.utilidades.MimeTypeHelper.<init>(MimeTypeHelper.java:23)
         ... 23 more
    java.lang.Exception: java.lang.ExceptionInInitializerError
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)
    [SignApplet]: Invocando isInitialized.
    Code where it fail is:
    TYPES.load((com.telventi.afirma.cliente.utilidades.MimeTypeHelper.class).getResourceAsStream("mimetypes.properties"));
    TYPES is Properties object.
    When we modify the .java.policy file with permission java.security.AllPermission it work fine too, and this make to us think that this is a permission problem!.
    Somebody has an idea???
    Sorry for my english!

    Having to modify the policy file defeats the whole point of using applets in the first place. If you have to install anything (such as a new policy file) on the client machine, you may as well install a GUI program.
    Either get yourself a digital certificate and sign the applet, or use an independent program instead.

  • Error:This page contains content of "application/x-java-applet" type. You do not have the plug-in required to view this content.

    Hi....i m using Mac OS x 10.5.8 with safari Version 5.0.2 (5533.18.5). I just updated the Java version to Java 6 and now m getting below error:
    This page contains content of “application/x-java-applet” type. You do not have the plug-in required to view this content.
    Please help me out on this....

    I am also having a problem with this. My website is hosted through "www.onlinepictureproof.com" and now that my laptop is back from repair with OS X 10.6.8 I am unable to upload my photos to my work website. It says "a plug-in is needed to display this content. Install plug-in" and then a window pops up that says "no suitable plug-ins were found".  Below that is "unknown plug-in (application/x-java-applet)" with a link to "manual install" which takes me to "http://www.oracle.com/technetwork/java/index-jsp-141438.html#download" which just leaves me lost. I've tried downloading the "JRE" but I have zero idea what that means or if Im downloading the proper thing. Once I click on the "download JRE" it brings me to a download page where there are WAY too many items for me to choose from to download, when I have no idea what I need or why I need it. please help, this is driving me insane. I actually preferred my constantly crashing laptop to the state its in now, "like brand new" back from apple repair...I have already updated everything that is promted through "Software Updates".
    "OnlinePictureProof.com" only directs me to apple support.
    Thank you for any help you can offer!
    Sheila

  • Can not take a screenshot with Maverick and track pad.  can not use apple chat to talk with a tech.  there are other issues also like I used to be able to go back a page with the delete button.  No Maverick PDF to instruct on how to use Maverick

    Can not take a screenshot with Maverick and track pad.  can not use apple chat to talk with a tech.  there are other issues also like I used to be able to go back a page with the delete button.  No Maverick PDF to instruct on how to use Maverick
    THE use of the apple support is a mess also.
    I want to be able to use my MAC fully and easily like I used to with Snow Leopard. 
    What is wrong with this maverick OS?

    The only people who can possibly assist you with this is Apple Customer Relations, call your local Apple contact number and ask for Customer Relations then explain your situation clearly and politely (be firm but don't rant).
    You might want to investiage what the local laws are regarding defective goods and 'fit for use' definitions on warranties etc. Consumer Protection can be a useful tool to use or bargain with if needed ...

  • Deploying no java applications using Java Web Start

    Hi,
    I am new to java web start. Is it possible to distribute non java applications using java web start. I have an APP which can run on a desktop in standalone mode. The app has jusy HTML and Java script files. Is it possible to package this app and deploying using java web start? I am assuming If it is possible, I can make updates to the packaged app in the web servers and the updates will be downloaded next time the app is used provided configurations are correct?
    thx

    The app has jusy HTML and Java script files. Is it possible
    to package this app and deploying using java web start? Not really. Resources for JWS need to be zipped,
    while this HTML/JS app. will (I guess) not work from
    inside the depths of a Jar (or Zip) archive.
    Note that you can organise for those files to be
    downloaded and expanded onto a known place
    on the user's disk, by using an 'installer' element,
    but..
    ...I am assuming If it is possible, I can make updates to the
    packaged app in the web servers and the updates ..installers are only called once, and do not 'update'.

  • Get Native Java Window using Java Access Bridge 2.0.1 & Java 1.6 and above

    I want to get the native java window (Like Java Monkey Application and Java Ferret Application) using java only, for that I tried different ways/options but unable to get the native java window and perform actions on that.
    It would be really great if you could guide me for that. I am still unable to start the Java Access Bridge.
    Please let me know the steps to get native java window using Java Access bridge and JDK 1.6.20.
    Also Note that, As per your previous suggestion, I tried to search and call initializeAccessBridge() and shutdownAccessBridge(), But unable to succeed it. I did not find such method in Accessbridge.jar.
    Please help me out.
    Best Regards

    You might want to check out this thread:
    Java Access Bridge and JRE 1.6
    If you have Java 6, you'll need to manually install Java Access Bridge 2.0.1. The JAB 2.0.2 installer for Java 6 is also available as a beta:
    http://jdk6.java.net/6uNea.html

  • How do u get a Java method to call itself? Not working here.

    How do u get a Java method to call itself? Not working here. I am using the "this" keyword. Thanks.
    Below, I would like to call checkIt method in itself.
    Ex.
    public class ABC {
    public String checkIt(String abc){
    if....
    checkIt(abc);
    }

    Assuming you are getting stack overflows (likely if you're unfamiliar with recursive calls), you need to put some sort of check condition inside the method so it doesn't call itself endlessly (AKA "infinite recursion").

  • JAVA ISN'T WORKING. I've tried software update and also reinstalling java. But it's still not working. How can I fix it? OS X 10.5.8

    I've tried software update and also reinstalling java. But it's still not working. How can I fix it? OS X 10.5.8

    Bad juju not having a bootable backup that you can revert back to when you run into these kinds of issues. Get a bootable, external HD, and make a bootable backup/clone before updating/upgrading and ensure that it's bootable and works like the original. See these for details:
    http://docs.info.apple.com/article.html?artnum=106941
    http://www.macmaps.com/upgradefaq.html
    http://www.macmaps.com/backup.html
    http://www.thexlab.com/faqs/installswupdates.html
    http://www.thexlab.com/faqs/backuprecovery.html
    Back to your issue. Boot with the Leopard install disk, select your language, select Disk Utility from the Utilities menu, and repair the disk and permissions. Report back.

  • HT201335 when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?

    when using apple tv with my ipad, the mirroring function does not work, screen goes black, what is the issue?  My son's Ipad(same as kind as mine) works ok with the apple tv but mine does not.  Any suggestions?

    Hello Nina Izurin,
    While written for the iPhone, the troubleshooting below can help resolve issues with your iPad's camera, as well.
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    My issue is still not resolved. What do I do next?
    Contact Apple Support.
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Cheers,
    Allen

  • I bought the external DVD player/burner for my Macbook.  I tried using it with my Dell laptop but it will not work.  Is it not configured to work with anything but apple operating systems?

    I bought the external DVD player/burner for my Macbook.  I tried using it with my Dell laptop but it will not work.  Is it not configured to work with anything but apple operating systems?

    If you purchased the Apple USB SuperDrive, it will only work with select Apple devices. It won't work, for example, on my Late 2011 model that has a SuperDrive built-in, but it will work with an Air, Retina model, new 'drive-less' iMacs, etc.
    As far as I know, though, you can only hack the drive to work with some other Apple devices, but not with Windows PCs. Which is a shame as other, less expensive DVD/CD devices will work with just about any machine.
    Sorry,
    Clinton

  • Problem with new version 4.3.2 apps not working " after update to the new version "

    Problem with new version 4.3.2 apps not working " after update to the new version "
    i was in 4.3.1 then i do the update , but now after update i face this problem , so what i Supposed to do ?!!

    Hi There
    Had the same problem as you. App would terminate when launched.
    Solution to working You Tube app:
    -Go to playstore
    - Uninstall app (it doesn't remove the app, only removes the update)
    - "Et Voila", working again.
    This doesn't correct the problem, it's just a workaround for you to be able to use youtube app again.
    Hope it helped.
    Best Regards

Maybe you are looking for