Finish painting before Robot captures screen

Hi. I have a little math practice program on a JFrame. When a child gets a problem right, I use Robot to capture a screen shot and then use that image on a new JFrame as a backdrop for crazy effects.
My problem is that I want all swing painting on the original JFrame to finish prior to the Robot screen capture. In particular, the button the child clicks to submit an answer should no longer look 'depressed.' Unfortunately, the Robot screen capture catches the screen before the original JFrame is fully updated/repainted. This occurs despite me putting the call to Robot.createScreenCapture into the EventQueue with invokeLater.
My question is: is there any way to stop and wait until repaint/update is completed, and then proceed with the Robot screen capture?
Thanks for any help.
josh

Thanks for your attention and observations. I should have posted earlier -- I'm getting tangled on words. But it has been instructive.
Here is a sample app. The method submitAnswer is called when the user clicks on the submit button or presses enter when either the textfield or the submit button has the focus. In that method, I attempt to first change the background of a label, and then do a 'special effect' that includes a screen capture. My problem is that the label color change does not happen until after the screen capture.
Thanks again for your assistance.
import java.awt.*;
import java.util.concurrent.*;
import javax.swing.*;
public class MathPractice {
     private JFrame frame;
     private JLabel problem;
     private JTextField answerBox;
     private JButton submit;
     private JLabel scoreLabel;
     private Rectangle screenSize;
     private int score = 0;
     private ScheduledExecutorService scheduler =
               Executors.newScheduledThreadPool(1);
     public void initialize() {
          screenSize = getScreenSize();
          frame = new JFrame("Math Practice");
          frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          JPanel viewPanel = new JPanel();
          problem = new JLabel("1 + 1");
          Action submitter = new AbstractAction() {
               public void actionPerformed(ActionEvent arg0) {
                    submitAnswer();
          answerBox = new JTextField(3);
          KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
          answerBox.getInputMap().put(ks, submitter);
          submit = new JButton("Submit");
          submit.addActionListener(submitter);
          submit.getInputMap().put(ks, submitter);
          scoreLabel = new JLabel("0");
          scoreLabel.setOpaque(true);
          viewPanel.add(problem);
          viewPanel.add(answerBox);
          viewPanel.add(submit);
          viewPanel.add(scoreLabel);
          frame.add(viewPanel);
          frame.pack();          
     private void submitAnswer() {
          //correct answer to 1 + 1 :)
          if (answerBox.getText().equals("2")) {
               score++;
               scoreLabel.setText(score + "");
               scoreLabel.setBackground(Color.GREEN);
               specialEffect();
          else {
               scoreLabel.setBackground(Color.ORANGE);
     private void specialEffect() {
          Robot robot = null;
          try {
               robot = new Robot();
          } catch (AWTException e) {
               e.printStackTrace();
               return;
          final BufferedImage screen =
                    robot.createScreenCapture(screenSize);
        final JFrame effectFrame = new JFrame();
        effectFrame.setUndecorated(true);
        JPanel panel = new JPanel() {
            public void paintComponent(Graphics g) {
                 g.drawImage(screen, 0, 0, frame);
                paintMessage("Great", g);
        panel.setPreferredSize(new Dimension(
                  (int) screenSize.getWidth(),
                  (int) screenSize.getHeight()));
        effectFrame.add(panel);
        effectFrame.pack();
        effectFrame.setVisible(true);
        Runnable closer = new Runnable() {
               public void run() {
                    effectFrame.dispose();
        scheduler.schedule(closer, 5000, TimeUnit.MILLISECONDS);
     private Rectangle getScreenSize() {
        GraphicsDevice gd = GraphicsEnvironment.
                  getLocalGraphicsEnvironment().
                  getDefaultScreenDevice();
          DisplayMode dm = gd.getDisplayMode();
          return new Rectangle(dm.getWidth(), dm.getHeight());
     private void paintMessage(String message, Graphics g) {
        Font font = g.getFont().deriveFont(15 * (float)
                  g.getFont().getSize());
        g.setFont(font);
        FontMetrics fm = g.getFontMetrics(font);
        int sw = fm.stringWidth(message);
        int sh = (int) font.getLineMetrics(message,
                  fm.getFontRenderContext()).getHeight();
        int descent = fm.getDescent();
        g.setColor(Color.RED);
        g.drawString(message, (int)(screenSize.getWidth()/2 - sw/2),
                  (int)(screenSize.getHeight()/2 + sh/2 - descent));
     public void setVisible(final boolean b) {
          EventQueue.invokeLater(new Runnable() {
               public void run() {
                    frame.setVisible(b);
     public static void main (String [] args) {
          EventQueue.invokeLater(new Runnable() {
               public void run() {
                    MathPractice mathPractice = new MathPractice();
                    mathPractice.initialize();
                    mathPractice.setVisible(true);
}

Similar Messages

  • Robot Class (Screen Capture)

    Hello friends,
    i have a problem and i don't know if it's a bug or something wrong with my code i just developed this code below to create a screencapture application and i do get the screen capture in the jpeg format but the problem is that i don't see the mouse pointer in the screenshot that i get why don't i see the mouse pointer when i can see everthing else
    import java.awt.*;
    import java.awt.Image.*;
    import javax.imageio.*;
    import java.io.*;
    public class test{
    public static void main(String args[]){
    try{
    Robot tt=new Robot();
    Rectangle screen=new Rectangle(1024,768);
    File f1 = new File("/home/hari/java/test.jpg");
    javax.imageio.ImageIO.write(tt.createScreenCapture(screen),"jpg",f1);
    }catch(Exception e){System.out.println(e);}
    I would like u guys to go through this code and check my claims
    one more thing u need jdk1.4 for this as iam using java advanced imaging api
    Thanks in advance
    regards
    hari

    Hey,
    Why did you ask me that question this is a fully functional code tested on linux and windows and works, Except for i don't see the mouse pointer at all as i already mentioned you should have jdk1.4 for this
    Please let me know as my running out of patience because of this problem
    regards
    hari

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

  • Capturing Screen using java

    Hi,
    Is there anyway I can do a printscreen using java and then send the image over the network?
    axlrose82

    hi,
    I'm using java.awt.robot to do a print screen and trying to save the image or sending it over the network.
    I tried to use applets but I got a "XTEST extension not installed on this X server: Error 0". Have you any idea how I can get around this?
    Thanks for the help.
    Sri.
    My code for the applet is as follows:
    import java.io.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.Robot;
    import com.sun.image.codec.jpeg.*;
    import java.awt.*;
    import java.awt.Image.*;
    import java.awt.image.BufferedImage;
    import javax.imageio.*;
    import javax.imageio.stream.FileImageOutputStream;
    import java.util.*;
    public class CaptureScreen extends JFrame{
    JButton button1 = new JButton("ScreenCapture");
    JButton button2 = new JButton("Quit");
    Image img = null;
    JFrame jframe = null;
    JLabel jl = null;
    ActionListener al = new ActionListener(){
         public void actionPerformed(ActionEvent e){
              String id = ((JButton)e.getSource()).getText();
              if(id.equals("ScreenCapture")){
              System.out.println("Screen capture button pressed");
              getImage();
              else if(id.equals("Quit")){
              jframe.dispose();
              System.exit(0);
    public void getImage(){
         System.out.println("Getting Image");
         try {
         Robot robot = new Robot();
         // Capture the whole screen
         area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
         BufferedImage bufferedImage = robot.createScreenCapture(area);
         Image image = toImage(bufferedImage);
         jl.setText("get image");
         try
              { // this try set turns the image into a jpg that is saved to the hard drive in the program dir.
              FileOutputStream output = new FileOutputStream("Screen.jpg");
              JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(output);
              encoder.encode(bufferedImage);
              output.flush();
              output.close();
         catch(IOException e)
         catch (AWTException awte) {
         awte.getMessage();
         //repaint();
    // This method returns an Image object from a buffered image
    public static Image toImage(BufferedImage bufferedImage) {
    return Toolkit.getDefaultToolkit().createImage(bufferedImage.getSource());
    public void paint(Graphics g){
    public void Startproc(){
         Container cp = getContentPane();
         jframe = new JFrame();
         jframe.setSize(500,500);
         jframe.setLocation(10,100);
         JPanel jp1 = new JPanel();
         JPanel jp2 = new JPanel();
         jl = new JLabel("Hello");
         cp.setLayout(new FlowLayout());
         button1.addActionListener(al);
         button2.addActionListener(al);
         jp1.add(button1);
         jp1.add(button2);
         jp2.add(jl);
         cp.add(jp1);
         cp.add(jp2);
    public static void main(String[] args){
         CaptureScreen capturescr = new CaptureScreen();
         capturescr.Startproc();
         capturescr.setSize(500,500);
         capturescr.setVisible(true);

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

  • Black capture screen in Win 7 unless aero themes are turned on

    I have discovered through trial and error that unless I disable Aero themes on my powerful Windows 7 laptop, my captures always seem to drop a frame or two despite the souped-up resources I have (super fast processor, 16GB RAM, capturing to second hard drive,etc).  By the way, I am capturing through firewire from a Canon XL2 (DV) camera.
    However, on other machines on which I have older versions of Premiere Pro installed, I can do this automatically by right clicking on my desktop Premiere Pro icon, choosing the compatibility tab, and putting a check in the "disable desktop composition" tab.  This basically toggles Aero off as soon as Premiere Pro starts loading, and toggles it back on when I close it.  But this has never worked with Premiere Pro CS6.  I have always had to manually disable Aero even though I have supposedly disabled it through the said compatibility tab of Premiere Pro CS6. 
    That's never been a major problem until now.  Now, if PP CS6 is open and aero themes are disabled, I get a black capture screen (I can hear the audio but the capture screen is completely black).  But as soon as I toggle aero back on, the capture screen again displays video normally.  So, basically, if I intend to capture with PP CS6, I am forced into leaving Aero themes on so that I can monitor my capture, but if I do so, I drop frames.  Infuriating.
    This seems to be a similar problem to the one I had a few months ago, "I get a black capture screen (preview), but video captures fine.  What gives?"
    I got no suggestions for that problem other than to "use another application to capture," (UNacceptable since I paid BEAUCOUP bucks for CS6 and I have a perfectly reasonable expectation that it should perform), and "roll back to the previous update" [again, unacceptable, as  1) I have no idea how to do that and 2) updates are issued to resolve other problems, right?  So why should I be forced to roll back?].  Sorry, but these didn't help.
    That particular problem was apparently "resolved" with a subsequent update, and there were no problems for a while (other than the fact that I could still not disable aero through PP CS6's compatiblity tab).  But now, apparently, there has been a further update that has caused this latest problem that never existed before.  Please help.

    Regardless, Premiere Pro should not have an issue if I want to disable Aero themes.  CS6 is the only version that apparently does have an issue with it (and, even then, only recently, which leads me to beleive that a recent update is to blame).
    I know this because I also have the old, old Premiere Pro 2.0 installed on the same machine.  If I disable Aero and then Open PP 2.0, the capture screen is just fine. 
    But if I disable Aero and first open PP CS6, close it, and then open PP 2.0 instead, the capture screen in PP 2.0 is now black as well, and I cannot get it back unless I reboot.  Obviously, when I close PP CS6, some service or other, that I haven't been able to identify so far, is remaining open and affecting PP 2.0.
    Again, all prior versions of PP have never had an issue with disabling Aero themes.  Why does CS6, all of sudden, absolutely need it enabled in order to work properly (though it doesn't work properly, it drops frames)?

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

  • Premiere CS4 hangs at capture screen

    I recently loaded CS4 on a Windows 7 64bit computer. I only have 2 prodjects loaded. When I open the first project, it hangs on a blank (White) capture screen. It won't let me do anything but close out. It doesn't matter if the capture device in connected or not. I can open the 2nd project by activating the capture device first and allowing it to open Premiere. The first program won't open this way either. I thought it may be something else on the the computer interferring but there's not much more on this computer. Another odd quirk but this one won't let me do anything with my project. Any ideas?
    Thanks
    Art

    I did update SonicFire Pro 5.0 to 5.5 just after I installed CS4. It is a new computer build, Windows 7 64bit 12 gig ram HD7850 videocard.
    When CS4 starts it goes to the open screen. I click on the project and Premiere opens but hangs on the capture screen but it's blank.(no controlls)  This happens before I do anything else. I can't minimize or close without going into the task Mgr. I can't open from the file on the harddrive, Bridge etc. When I connect my capture device and turn it on, autoplay gives me the option to open in CS4. SOMETIMES I can open one of my projects. (I only have 2) sometimes I can't.  Frustrating! When it does open, it works fine. The first project that has the band will open to CS4 but hangs on the capture screen. When no capture device is connected, the band project will open to CS4 and STILL hang at the capture screen with no capture device connected.

  • Capture screen to image, but shockwave3d!

    Ok got problem capturing the screen to member. I guess the
    problem is the 3d is overlay, right? As you see in the code below
    I've tried switching to software renderer before the capture but
    that doesent work either. Other stuff works fine, but not the 3d
    window.
    Free solutions welcome :)
    Cheers friends.
    quote:
    on mouseUp me
    _movie.preferred3dRenderer = #software
    printMember = new(#bitmap, member(14))
    printMember.image = image(624, 372, 32)
    img = _movie.stage.image
    destRect = rect(0, 0, 624, 372)
    srcRect = rect(464,265,784,479)
    printMember.image.copyPixels(img, destRect, srcRect)
    _movie.go(2)
    img = _movie.stage.image
    _movie.go(1)
    destRect = rect(0, 0, 624, 372)
    srcRect = rect(464,265,784,479)
    printMember.image.copyPixels(img, destRect, srcRect)
    -- ScreenToFile(464, 265, 784, 479, string("test"))
    _movie.preferred3dRenderer = #auto
    end

    I have successfully taken screenshots of DTS Shockwave 3d
    sprites using
    scrnXtra's StageToMember() command. scrnXtra is free and
    cross-platform:
    http://homepage.mac.com/klkersten/xtras/ScrnXtra/scrnxtra.htm

  • T450s startup takes 35 seconds before showing splash screen. (11 sec wake-up)

    The follwing are my problems:1. When starting up the machine, it takes about 35 seconds before the first screen activity appears (Lenovo splash screen). After that it boots quite normal.
    2. When waking out of sleep mode it takes 11 seconds before I see the power led stopping to "breath" and the screen wakes up.
    It feels like this is a hardware/bios related issue, as (so far I know) hdd/ssd is only accessed after the bios has loaded and has finished its hardware checks. When sticking in a bootable usb it only starts flickering after the bios had loaded on screen.
    Question:
    Does anyone has an idea why my laptop is waiting so long to boot or to wake up? I don't mind waiting a bit, but waiting for 35 seconds + the normal boot time is really annoying. Specially with the fact that the laptop doesn't show any sign of live for 35 seconds after briefly lighting up the keyboard backlights. The wake-up delay is also very annoying since even my 7 year old BSOD laptop wakes-up faster, and I'm using sleep mode a lot.
    Some origins that I'm thinking about:
    - Hardware check during initial hardware startup does not yet recognize a dedicated GPU card. (POST: Power On Self Test)
    - I don't think this is a problem with my software since the problems occurs before reading any media.
    Things I tryed already:
    - Reset bios.
    - Start in legacy mode.
    - Bios update
    - rebuilding MBR (although I don't expect this to be the problem.)
    - Refreshing windows installation although I don't expect this to be the problem.)
    This problem was already at the beginning (with origenal hardware):
    From the first time I started the laptop (so even with the HDD) I noticed it took quite long to start. I remember pressing the ON/OFF button multiple times and thinking I did something wrong, when suddenly the "Lenovo" splash screen appeared.
    I hope someone can help me!

    My problems have been solved! An engineer contacted me that they have recieved a spare mainboard and they wanted to make an appointment. I gave them the adress where I worked the next day since I'm very mobile, and the next day an engineer came by. He seemed like a skilled IBM engineer and tested my machine and came to the same conclusion as me. He then did a few tests to see if the problem was caused by something else then the mainboard but ended by replacing my mainboard with good care. After the replacement the the boot and wake-up time was normal like it should be. I'm very pleased by the service Lenovo ThinkPad has given me. I need to add that when I called for support I got someone on the line that could not really understand me, neighter dutch or english. But that was also duo a bad connection it seemed.. But after that call I did not really expect this would come to a good end. I was then really suppriced that 5 day's later a dutch engineer manager called me to make a appointment. 

  • 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 restart my computer instead of the gray screen that is supposed to appear before the login screen it shows a screen with a lot of letter

    I upgrade my ssd for my macbook pro retina from the 256 to 480 GB but when I tunr it on or restarted the computer the gray screen that is suppost to apper dosent show insted a screen with lettler show before the login screen besides that the computer works fine. 

    I cannot decipher what is written on the images you have posted but they are reminiscent of what I have seen when a MBP is dealing with some totally incompatible software or perhaps in your case hardware.
    How and or who installed the larger SSD and what manufacture is it.  I suspect that is the problem.
    Ciao.

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

  • I awoke this morning to find my iPhone 3g in recovery mode.  I tried rebooting, charging, and when I connected to iTunes it gave me a message saying I had to finish recovery first. My screen shows the iTunes logo and the USB cable. Any ideas?mode

    I awoke this morning to find my iPhone 3g in recovery mode.  I tried rebooting, charging, and when I connected to iTunes it gave me a message saying I had to finish recovery first. My screen shows the iTunes logo and the USB cable. Any ideas?

    http://support.apple.com/kb/HT1808

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

Maybe you are looking for

  • Problem with drivers/ sound stopping / vista32bit/ xfi fatal

    i have an xfi fatality, installed the latest drivers and since then, sound will stop at random times usually happens when i am pausing something on media player (videos) and it might come back when i reopen the video sometimes i will watch a video on

  • Nfs mount created with Netinfo not shown by Directory Utility in Leopard

    On TIger I used to mount dynamically a few directories using NFS. To do so, I used NetInfo. I have upgraded to Leopard and the mounted directories are still working, although Netinfo is not present anymore. I was expecting to see these mount points a

  • Java.io.File renameTo does not work on Solaris

    Hi Experts, I have a code-piece which tries to move files from one directory to another on the SAME FILE SYSTEM using java.io.File.renameTo method. It works fine when there less no. of files in the source directory. But the renameTo does not work as

  • Problem in licence manager service

    Hello, Even though the licence manager service is set as automatic is services, it stops suddenly and this happens many times. Each time, the service should be restarted manually. I need your help please. Thank you.

  • How to hide rows?

    Hello folks, I just would like to know that how to hide rows except dbms_rls package? I mean, it has been said that I can hide rows to create views but lets said that I have got 200 students and each student can see only their rows in students table,