Screenshot of an Applet

Hi ,
Is it possible for us to take a screenshot of a running applet and store it as an image file. I did read through a couple of forums but none of them were clear.
And one more question can Applets be invoked using Web Services??

>
can u give me sample for that screenshot saving...>See Marco Schmidt's excellent [image examples|http://schmidt.devlib.org/java/image-file-code-examples.html]. There is one there that is specifically for saving a screen shot.
If you cannot make that code work for you, I suggest you make an effort and post whatever code you have. These forums are not a code generation service.
>
And regarding the webservice part. This is actually like i invoke a applet to draw a graph ..>Draw the graph to a BufferedImage then display the buffered image instead. That saves having to get a screen shot using Robot.
>
...and the screenshot is to be saved of the graph and the path of the screenshot to be parsed to the client.>What do you mean 'parsed'? The Java compiler needs to 'parse' Java source before it can do its job, but the Java code itself may include codes that 'pass' values to method calls, etc.
The second form (in this context) means 'give' (watch the JLS/OO gurus jump on that one..).
But why is the web service providing a path to the end user? C:\Media might work here, but fail for most other boxes or OS'. Provide the end user with a JFileChooser and they can save it anywhere they like.
(But yes, the web service might control the applet via JS/AJAX, or write the image path as a parameter in the applet element.)
If you want help with that, I suggest you start a new thread specific to it.

Similar Messages

  • 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?

  • Paste clipboard screenshot capture into applet

    hi,
    im trying to find a way to paste a clipboard screenshot into a java applet. these are the steps:
    1. user presses alt+prtscn
    2. user copies screenshot capture into clipboard (control + c)
    3. WHAT I NEED TO DO: take screenshot capture and paste it into the applet by pressing control + v.
    im not sure how i make a placeholder for the image, if someone could explain that. also, after i put the image in the applet i would like to be able to save it in jpg/gif format.
    if anyone can help me out, please do. i can be emailed/reached at "i aim robin" on aim or [email protected] to discuss.
    thanks for your time.

    I'm not sure if an unsigned applet can do this. To get the system clipboard containing the image, call Toolkit.getSystemClipboard(), but I'm not sure if applets are restricted from accessing it. If you can get it, you'll have to parse the bytes to create the image (unless you can find a third-party class to do it). In a Windows environment, the screenshot images are like 32-bit bitmaps with a shortened file header. Also, unsigned applets cannot save files, so they cannot create the jpg and gif files. I hope this helps at least some.
    -JBoeing

  • Applets and Screencapture (Capture and Discard)

    Hello Everyone,
    I need to capture part of a screen for processing in a Java applet. The screenshot will only exist as long as the applet exists, will not be sent anywhere, will not be saved to the user's drive and is only needed to be created then distroyed when the user leaves the page. In other words, the screenshot will only be local to the client the applet runs on. My question(s) is:
    - Is there an alternative to Robot for taking a screenshot in an applet?
    - If there is no alternatives to Robot, how can I grant permissions in AWTPermission to allow for instantiation of Robot and to take such screenshots?
    Yes, Robot can be inherently unsafe. However, there are many ways Robot's functions can be used for non malicious purposes. I'm wondering if they can be enabled for this purpose.
    Devyn

    You can combine it with JavaScript (generally not so good an idea).
    You can get the document-object-model from within the applet;
    in JavaScript you can use the applets functions - when all comes together.
    In general you might consider Java WebStart to install a local application with web browser interaction.

  • Getting Screenshot of an appler

    I currently have an applet in a JFrame. I would like to know if there is a way to actually take a screenshot of the applet (and just the applet) and it needs to be able to do it even if the JFrame is minimised. The applet itself, I do not have the source for so I cannot just edit the applet to get the image before it's drawn. I have played around with the Graphics class and Robot class to try and get an image of the applet, yet this has failed abysmally. Anyway, is there any way to do this at all? Thanks in advance

    diddlewotsit wrote: I currently have an applet in a JFrame. I would like to know if there is a way to actually take a screenshot of the applet (and just the applet)
    So far so good. Try this method, using the applet as the component.
      public static BufferedImage getScreenShot(
        Component component) {
        BufferedImage image = new BufferedImage(
          component.getWidth(),
          component.getHeight(),
          BufferedImage.TYPE_INT_RGB
        // call the Component's paint method, using
        // the Graphics object of the image.
        component.paint( image.getGraphics() );
        return image;
    diddlewotsit wrote: ..and it needs to be able to do it even if the JFrame is minimized.
    I am not sure how the above will go if the JFrame is minimized. Please try it and report back.

  • LMS4.1 soft appliance: Topology Java Install Endless Loop

    Hello,
    The installation of the Java Applet is in an installation endless loop. Also after closing all Browser windows many times, Im still kept in the same step as shown in the screenshot of Topology Applet installation. Never experienced the problem in this manner for Windows and Solaris versions of LMS before. Need help.
    Did before:
    1. installed the offered new version of JRE
    2. cleared the JavaCache
    thx for help, Steffen

    Hello Michael,
    With creating endorsed and copying those files manual it still doesn’t work.
    So it doesnt works without providing write access for endorsed. But I can’t change the permissions of endorsed without having the real local Administrator Account for my company PC. This is just a test from my PC to a LMS Linux appliance in our Lab. But the real end customer will have the same problem: staff from networking department have typical not the original “Administrator” password of the company PC’s given by the PC department.
    PowerShell:
    PS C:\Program Files (x86)\Java\jre6\lib> attrib -R endorsed
    PS C:\Program Files (x86)\Java\jre6\lib> attrib -R endorsed /S /D
    Other ideas to can change permissions of “endorsed” with a user that is just in the local administrator group, but with no chance to get to the original “Administrator” user?
    JRE Version:1.6.0_24
    Recommended JRE Version:1.6.0_24
    Endorsed dir is:C:\Program Files (x86)\Java\jre6\lib\endorsed
    EXT DIR:C:\Program Files (x86)\Java\jre6\lib\endorsed
    C:\Program Files (x86)\Java\jre6\lib\endorsed\jacorb-sign-1-3.jar
    http://172.16.10.73:1741/JSP/CAMPUS/campus/res/jacorb-sign-1-3.jar
    java.io.FileNotFoundException: C:\Program Files (x86)\Java\jre6\lib\endorsed\jacorb-sign-1-3.jar (Zugriff verweigert)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.(Unknown Source)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.downloadJarExt(CampusAppletInit.java:70)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.setOrbEnv(CampusAppletInit.java:243)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.doIt(CampusAppletInit.java:123)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusApplet.init(CampusApplet.java:125)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    java.lang.Exception: DOWNLOADFAIL: Download of file logkit-1.2-sign-1-3.jar failed with error:
    C:\Program Files (x86)\Java\jre6\lib\endorsed\logkit-1.2-sign-1-3.jar (Zugriff verweigert)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.downloadJarExt(CampusAppletInit.java:98)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.setOrbEnv(CampusAppletInit.java:243)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusAppletInit.doIt(CampusAppletInit.java:123)
    at com.cisco.nm.ani.clients.lib.ui.windows.CampusApplet.init(CampusApplet.java:125)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Steffen

  • Problem with saving AWT Canvas to file

    import java.applet.Applet;
    import java.awt.Button;
    import java.awt.Canvas;
    import java.awt.Graphics;
    import java.awt.BorderLayout;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    public class Handtekening extends Applet implements MouseMotionListener,MouseListener, ActionListener {
         Canvas picture;
         Point spot;
         Point spotold;
         Button save;
         Image image;
         BufferedImage bImage;
         public void init() {
         setLayout(new BorderLayout());
              picture = new Canvas();
              save = new Button("Opslaan");
              save.addActionListener(this);
              addMouseMotionListener(this);
              addMouseListener(this);
              add(picture,BorderLayout.NORTH);
              add(save,BorderLayout.SOUTH);
              setSize(400,300);
         public void update(Graphics g) {
              paint(g);
         public void mouseClicked(MouseEvent e){}
        public void mouseEntered(MouseEvent e) {}
        public void mouseExited(MouseEvent e) {}
         public void mousePressed(MouseEvent e){}
         public void mouseReleased(MouseEvent e) {
              spotold = null;
              spot = null;
         public void mouseMoved(MouseEvent e) {}     
         public void mouseDragged(MouseEvent e) {
              spot = e.getPoint();
              repaint();
        public void actionPerformed(ActionEvent e) {
             imageOpslaan();
         public void paint(Graphics g) {
              if (spotold !=null){}
              else{spotold = spot;}
              if (spot !=null) {
              g.drawLine(spotold.x,spotold.y,spot.x,spot.y);
              spotold = spot;
         public void imageOpslaan(){
              File handteking = new File("C:\\handtekening.JPEG");
              Rectangle r = picture.getBounds();
              System.out.print(r.height);
              image = picture.createImage(r.width,r.height);
             Graphics g = image.getGraphics();
             picture.paint(g);
              bImage = createBufferedImage(image);
              try{
              ImageIO.write(bImage,"JPEG",handteking);
              catch(IOException ioe){
                   System.out.print(ioe);
         public BufferedImage createBufferedImage(Image image)
           BufferedImage bi = new BufferedImage(400, 300, BufferedImage.TYPE_INT_RGB);
           Graphics2D g = bi.createGraphics();
           g.drawImage(image, 0, 0, null);
           return bi;
    }well the drawing part works fine but the saving part doesn't work. It gives an error that the Canvas height is 0, something that doesn't make sense to me as I can draw on it (or am I drawing on the applet it self?)
    Anyone any ideas what I'm doing wrong and how to fix it?
    Nevermind I used a robot to make a screenshot of the applet
    Message was edited by:
    JongeFrank

    Hello Lorne.V.
    Does it give you any error message or display any information when it stops writing files?
    Also, have you seen our text-based examples? They are installed with NI-DAQmx. In National Instruments/NI-DAQmx/Text-based Code Support.  Maybe there are examples that could help you verify what is missing. 
    Regards
    Ernesto

  • Java applet will not install in browser

    My VI will not install a JAva Applet. I jsut keeps saying "Installing Java Applet" and it never prompts for an install or anything. Any ideas? Is there something extra that I need to do that I am not realizing? I attached a screenshot of the window where is says installing.
    Solved!
    Go to Solution.
    Attachments:
    Capture.PNG ‏54 KB

    How are you trying to install the java applet? Through a website? Calling an installer? 
    Could it be that the applet already installed on the computer?
    Has it ever worked? 
    Applications Engineer
    National Instruments
    CLD Certified

  • How can I make an applet look to the current directory to read a txt file in?

    I am using a File class passing only the file name as the contructor but forte still looks in "C:\forte_jdk\forte4j\bin\Events.txt" which is not my current directory for the project.
    If leave it and ftp this applet to my web site I get an IOException.

    I always find visual aids helpful. See below for screenshots & discriptions.
    01. The Basics
    When you create a new site & go into design view (in the example below it's the Home page), you'll see the following.
    The white box is your page.
    The grey box outside of that is your browser area.
    The black & white checkered area is the Adobe Muse CC application chrome.
    02. Add Box
    Draw / Add your rectangle or text frame (text tool). I drew a rectangle, gave it a fill color of blue & turned the stroke from 1 to 0.
    03. Extend & Snap to Browser Edge (Left)
    Click, hold  and drag your mouse on the center adorner (adorner is the little squares that you can grab to resize your rectangle) until you resize your rectangle to the browser edge (the dark grey area) until you see a red line. This means you've 'snapped' one of the rectangle's edge to the browser edge.
    04. Extend & Snap to Browser Edge (Right)
    Repeat the process except do this for the right edge. In truth, it doesn't matter in which order you resize your rectangle to snap to the browser edges. The key thing is to be sure to do this for both sides of the rectangle & snap it to the browser edge (see the red line).
    05. You're done! Preview.
    06. Bonus!
    Once again, you can make rectangles or text frames 100% width, BUT you can't do this with placed images.
    However, you can do this with a rectangle or text frame. Then set the Fill of either the rectangle & text frame to be an Image & set the Fitting to 'Scale to Fill.'
    (see below for example - I used a rectangle & changed it's Fill property)
    Now when I preview, the image is 100% width. In truth, it's a 100% width rectangle with a fill of an image.

  • Screenshot Error in Mac OS X 10.8, Short key working but no file generated

    Today I'm going to use the mac screenshot (screen capture from COMMAND+CONTROL+SHIFT+4) to capture the window while the problem comes. The short key is working and the icon of pointer has changed accordingly, but once I clicked there is no file generated in the destination folder. I would like to know what's wrong with my screenshot? Is there anyone who encountered the similar errors before?
    I'm using Mac OS X 10.8.5 and I believe the screenshot is still avalaible after the update from the 10.7.x. I guess the problem is more about the screenshot applet rather than the system. Besides, I'm eager to know that is there any method to solve this problem.
    Thank you.

    I am running a Retina Macbook Pro with Mavericks 10.9.3 installed.  I was having this problem today, but I did a few things that got rid of the issue...
    1)  Go to System Preferences > Keyboard > Shortcuts > Screen Shots, and click each of these 4 boxes...
    Then close the window.
    2) Open the application "Terminal."
    Type in killall Finder > Push enter
    Type in killall Dock > Push enter
    Close the program
    3) Turn off the computer.  Now turn it on, but hold down "CMD + OPTION + P + R" on the keyboard as it boots up.  This will restart your computer.  Let the keys go after the restart, and let it boot all the way.  Pressing these keys clears your PRAM and NVRAM settings--it doesn't harm your computer at all, but it is supposed to help give your battery a boost.  Apparently, it also resolved my screen shot issues.
    I blame my screen shot issues on a program I tried installing today--it must have messed with the OS somehow.  Hope all of this helps!

  • Signed applet working in Netscape 6 but not in IE 5.5

    I have an applet that reads a file from a server and tries to write it to a client machine. To this i self signed the jar file containing the applet using the keytool and jarsigner. So now I had a self signed applet. I tried to run this in IE. It gave the same error message that i used to get when I tried to run it the applet as unsigned. What am I missing here? Is self signing not enough to run the applet in IE? The same applet works in Netscape 6 and successfully downloads the file to the local machine. Please help me. I have added the certificate to the IE security panel as trusted.

    Netscape 6 has Java VM 1.3. if you use MSIE, you should try JavaPlugin.
    If interested in an appli that helps in signing process, you may download XLRSecTool for
    free at:
    . Windows:
    http://www.xlreader.com/download/stl10ea/InstData/Windows/NoVM/istl10ea.exe
    . Unix and Linux:
    http://www.xlreader.com/download/stl10ea/InstData/Unix/Others/istl10ea.bin
    . Other Java-enabled OS
    http://www.xlreader.com/download/stl10ea/InstData/Java/install.zip
    Requires Java VM 1.3.1
    Screenshot:
    http://www.xlreader.com/images/sshot_s673x548.gif
    -- Robert
    =====
    [email protected]
    XL-Reader Project - Secured online documentation solutions
    www.xlreader.com
    =====

  • Nm-applet icon not showing in KDE

    hey guys,
    I'm running gnome networkmanager with the latest kde. The applet works fine but i can't see the icon.
    The icon shows up when i restart networkmanager (/etc/rc.d/networkmanager restart) but when i reboot the icon goes blank.
    Here's a screenshot:
    The applet is meant to show up on the left of the volume control.
    How do i fix this ?
    thanks.
    Last edited by Abraham Salloum (2012-01-04 23:42:39)

    Same here. It's an upstream bug with GTK+3 applications, and reported
    to upstream: https://bugs.kde.org/show_bug.cgi?id=278131 and
    in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=716358
    The problem is that some apps have a larger systray icon than the panel's size, and plasma's systemtray implementation is not always able to resize these icons correctly. You can reproduce this problem with other GTK+3 apps also if you launch them multiple times: empathy, transmission-gtk.
    I don't know any solution, is there any idea?

  • Java Applets font rendering with no AA

    So I've exhausted all possibilities on my end here and have no idea how to get anti aliasing to work with java applets. I've followed all of the suggestions from the wiki entry for the subject here:
    https://wiki.archlinux.org/index.php/Ja … ment_Fonts
    I've attached a screenshot of a few browsers and the appletviewer running a script from a book I am following at the moment. It's consistent, but it's an itch I haven't been able to scratch. OCD at it's finest here. It doesn't halt production or anything, but it bugs me.
    Thanks for any help offered!
    http://cigii.com/javajunk.png
    Moderator Edit:  Redacted in-line picture and converted it to a url link
    Last edited by ewaller (2011-12-01 04:13:44)

    transmutated:
    The picture in your original post was well beyond the size permitted by our policy.  If you would like to include a thumbnail picture, go ahead and edit that post with image tags that point to the thumbnail inside the url tags.  Have the url tags point at the big picture.  That way your readers can see the thumbnail and click through it to see the full image.
    Thanks

  • Gnome Power Manager Applet

    Hi all,
    since the last update, the gnome power manager applet is gone. I can change the preferences with the gnome-power-preferences tool, but the applet in the system bar is gone... Any idea?
    Acker

    Master One wrote:
    So what's going on?
    I do not assume, that users of other distros have such problems, at least in Foresight Linux the applet is working as supposed to, which confirms that it's not an upstream problem. There is a bug open, but no info about any progress.
    Is anybody working on a fix?
    Jan de Groot has been assigned to this task a few days ago. Jan works on 580 open tasks, most of which have a higher priority then this bug.
    As seen from the screenshot threads, quite some Arch users are on Gnome, so that's surely not something just a minority is in need of.
    What's with the Gnome 2.18.1 updates (though the working version of the Gnome Power Manager in Foresight Linux is 2.18.2 as well)?
    Oh my, an icon is not shown, man the life boats. The gnome-power-manager works perfectly -- at least for me -- it just doesn't show an icon in the notification area. If you absolutely need the icon, deploy Iloeki's script. It should do the job.

  • Is there a way to adjust popup applet size according to applet contents so that I dont have to scroll ever?

    Hello,
    Could anyone please let me know if there is any way to adjust the popup size according to contents displayed in the popup so that I dont have to scroll in the applet.
    Thanks.
    Nanta

    Sorry mate, cant post a screenshot as the site is client confidential...can get me in trouble.
    its just that default width of the popup is 300px(using inspect element); but when the popup opens, some of the buttons are not visible and I have to scroll horizontally to see these.
    I was looking for something wherein I can permanently set the popup width to 700px.
    Any help is appreciated. Thanks.

Maybe you are looking for

  • How do I stop my Reader version 11.0.1 from crashing when opening any PDF file?

    I've had this problem since yesterday and it started very suddenly but now I cannot view any of my files because the reader crashes after a few seconds. I cannot use the app at all, please help! The files I'm trying to view on my reader are not new,

  • Does apple tv work with ee router

    does apple tv work with my ee smartbox router

  • Oracle Date function.

    Hi Team, I have a table with date column (16/06/1996 15:03:59) as value in the displayed format. As I have tried with the below query format I could n't able to retrive the records. select * from <table> where DATE_INSERT=SYSDATE; Could you please he

  • Elements 11 Organizer and Editor not working together (Mac)

    Is there a way to get the organizer that comes with Adobe Premiere Elements 11 (Mac) with Photoshop Elements 11 Editor (Mac)? I previously downloaded Elements 11 Editor from Mac iTunes Store, this version does not come with Organizer.  I then found I

  • Extensions with custom EO and VO

    The requirement I have is to add columns of a custom table into oracle seeded page(LeadCrtePG) and have those columns of the custom table get updated to the db when the apply is clicked on the seeded oracle page. I created a custom EO and a VO using