Change cursor to hourglass

i want to change cursor to hourglass when a new servlet is loading. working of my program is that on click of submit,the present servlet unloads and a new servlet is loaded.this new servlet takes time. so i can't write the code in prevoius servlet for cursor and the new servlet which is being loaded changes cursor to hourglass only after fully loading. please help me in this regard

Write the javascript, flush the output stream, and the hourglass should be shown right away...
note: You should write some stuff before the javascript -- send some text maybe the top of the output page. IE has some internal buffer you have to fill up before server-side flushing works.
Again: You should make sure you send the javascript and flush before you start processing.
Also: You will not be able to do a send redirect if you use this approach. If this is not satisfactory, you could try using one of the "Please Wait" mechanisms described on this site (use the forum or google search for JSP "Please Wait" to find them) to do the job.

Similar Messages

  • Change cursor to hourglass in JFileChooser

    Greetings,
    I'm trying to find a method to change the mouse cursor into a hourglass in JFileChooser when the user navigates through the directory structure.
    I'm currently developing an application where files need to be loaded over Windows 2000 NetBEUI network. In JFileChooser, refreshing directory views can take quite a long time (sometimes a minute or so) when navigating through another user's computer through the network. Therefore, it would be a good thing to change the mouse cursor into a hourglass (JFileChooser doesn't change it by default) whilst refreshing the file view so that the user won't get the impression that the program has hanged...
    Is there a method for doing this besides modifying the actual JFileChooser class? This would be an easy solution but I've gotten the impression that is illegal (against Sun's J2SDK license, that is) to modify the classes in java.* and javax.* packages?
    Thank you for your time!

    Thanks, that points me to the right track. I should have thought of extending JFileChooser myself.
    There's still a slight problem, the code snippet you provided changes the cursor back to the default too early, i.e. before the files in a specified directory are visible. I think the cursor should be set back to the default one in some other overridden method...
    But thanks anyway, back to the JFileChooser JavaDocs :)

  • Showing a "Please wait..." window / Changing mouse cursor to hourglass

    Can one of the following be done using javascript:
    1) Show a "Please wait" window (when using synchronous SOAP requests) with the ability to "hide" it
    2) Change the mouse cursor to hourglass
    I went over the JS API and found nothing, any ideas?

    Was the PDF opened within a web browser and was the PDF on a web server?

  • No cursor or hourGlass cursor

    hi,
    I have a window which has a Viewport, Viewport has a gridField as it's
    child. (There are other widgets, which are made invisible at runtime).
    The way window does display using a Draw method, which in its simplified
    form looks like:
    <theGridField>.state = = FS_INVISIBLE;
    localPanel : Panel = new;
    localPanel.row = 1;
    localPanel.column = 1;
    // set other attributes of localPanel
    localPanel.parent = <theGridField>;
    localPicture : PictureGraphic = new (name = .. etc);
    localPicture.parent = localPanel;
    <theGridField>.State = FS_UPDATE;
    The cursor becomes 'hourGlass' while 'Draw' is running and becomes
    'pointer' at end. This is OK; but once in a while, we find cursor not
    changing to 'pointer' (or totally disappearing) unless mouse is moved
    out of the window and bring back Or move to menu bar and bring back.
    This is a trouble for the automated tests, though not for the end users
    as much.
    We have 3.0.G.2. I have already tried Setting self.window.mouseCursor,
    <theGridField>.mouseCursor and <theViewport>.mouseCursor to
    MC_SYSTEMDEFAULT. It works for first 4-5 windows. (One can have as many
    instances of the window as (s)he wants ).
    Any suggestion is welcome. Thanks in advance.
    -- Shriyal
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    It can be tuned and there are some things I can do to speed it up in certain cases, but the search is a people search so if they use % in part of the search string, it is bound to be slow.
    So for those instances, I was hoping there was just some setting I was missing that would put up an hourglass while it searched.
    I changed it so that if someone puts in a last name without the %, that it uses indexes and it comes right back in just a few seconds. But the other way is still slow.

  • How to change 'cursor'

    Is there a way to change the 'cursor' so that it is always a 'hand' or something else that is easier to see - this is for one of the users that I support. They're looking for the cursor to always be this way, no matter what (ever, regardless). I have not been able to find this feature and other Adobe users I have talked to haven't found anything like it either.

    Hi, showing some messages when moving over a button can be done by standard-functionality useing property "tooltip-text" for the button.
    If you want your own bean start with overwriting the class oracle.forms.ui.VButton, use method with code similar to the following
      protected void processMouseEvent(MouseEvent p0)
        if ((p0.getID()==MouseEvent.MOUSE_ENTERED) && this.isEnabled())
          // Add your code for changing cursor here
          super.processMouseEvent(p0);
        } else if ((p0.getID()==MouseEvent.MOUSE_EXITED) && this.isEnabled())
          // Add your code for changing cursor here
          super.processMouseEvent(p0);
        } else
          super.processMouseEvent(p0);
      }hope this helps

  • Can I change cursor motion using tab key?

    Hi everyone,
    I'm Tae from Japan.
    Now, I'm developing UI with WD4J and I'd like to change cursor motion.
    for example:
    - left to right
    - up and down
    Environment:
    SAP NW CE 7.1
    SAP NWDS CE 7.1 SP05
    Thanks and BestRegards,
    Tae

    Hi Tae,
    Cursor motion through Tab is default given in WD Java, Cursor goes to next defined element in view. By designing the view layout properly you can manage the cursor movement as per requirement.
    some points :
    1) Tab moves the cursor to next item (if Label property "Labelfor" is  not defined for any ui element, it considers label as one element. Hence define labelfor property)
    2)you can use any of layouts grid, matrix, flow or row to define the ui elements.
    3)Tab will go to the next element in the same container. After completing all elements in one cotainer cursor goes to next container as defined in view.
    3)Shift+Tab will move the cursor backward.
    Regards
    Deepak

  • Changing cursor apperiance..How?

    I'm working on some school project and I have three frames. I need to change cursor apperiance while it's over those three internal frames. I know how to handle listeners, and all other stuff I need just I cann't find any way to setup cursor apperiance...I was looking in swing but nothing..or my docs are not good...

    All descendents of Component inherit setCursor. Use it as follows:
    component.setCursor(new Cursor(Cursor.WAIT_CURSOR));

  • WAd Report - How to change Cursor Type...

    Hi,
    In BI WAD report output, the cursor type is Pointer (Hand sign). I wanted to change it to some other type, is this possible, If yes, could u pls let how can i do that. I tried a lot but didn't suceed.
    Thanks...

    I think this would be possible by having custom CSS embedded in web template. E.g. see here:
    http://www.zimmertech.com/tutorials/css/20/changing-cursors-tutorial.php

  • How can I change cursor while it does something?

    hi, all
    following code dosen't change current cursor.
    I want to change cursor to wait_cursor while it opens file,
    but, it doesn't change cursor at all.
    What's problem?
    class aClass extends JFrame{
    btOpen.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){                
    int returnVal = jfcFileDialog.showOpenDialog(SourceEditor.this);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
    openedFile = jfcFileDialog.getSelectedFile();
    setCursor( Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));      
    //read openedFile and return text
    String fileContent=readSourceFile();
    setCursor( Cursor.getPredefinedCursorCursor.DEFAULT_CURSOR));
    thank you.

    I finally figured it out. You have to set the cursor on the JFrame's GlassPane. The solution was alluded to in the Evaluation section of a couple of bug reports:
    http://developer.java.sun.com/developer/bugParade/bugs/4357573.html
    http://developer.java.sun.com/developer/bugParade/bugs/4320939.html
    There is also some discussion about this in various Forum threads. (Search for topics using "+getGlassPane +setCursor".)
    My corrected code follows. With this method, you don't even need to start up a secondary thread to get the cursor to change. I do, however, because I have other UI elements that I want to be updated (such as a sort indicator on my column headings.) I also reduce the priority of the sort thread a bit so my UI gets priority.
    Note that I removed the code that tries to remember the original cursor, since, with all the asynchronous execution going on, the wait cursor could actually be the frame's current cursor when this gets executed. If you're not doing a sub-thread as I am, you don't have to worry about this. Also, I have extended JFrame to JFrameBase to handle threading issues and consolidate redundant code (among other things not pictured here). The JFrameBase class definition follows the example code.
    Component lTopLevelComponent = JTableSortable.this.getTopLevelAncestor();
    final JFrameBase lFrame;
    if ( lTopLevelComponent instanceof JFrameBase )
        lFrame = (JFrameBase)lTopLevelComponent;
        lFrame.setFrameCursor( Cursor.getPredefinedCursor( Cursor.WAIT_CURSOR ) );
    else
        lFrame = null;
    Thread lSortThread = new Thread( "JTableSortable" ) {
        public void run()
            ((SortableTableModel)lModel).sortByColumn( lSortCol, lAscending );
            if ( lFrame != null )
                lFrame.setFrameCursor( Cursor.getPredefinedCursor( Cursor.DEFAULT_CURSOR ) );
    lSortThread.setPriority( Math.max( Thread.MIN_PRIORITY, Thread.currentThread().getPriority() - 1 ) );
    lSortThread.start();
    public class JFrameBase extends JFrame {
    public void setFrameCursor( final Cursor aCursor )
        SwingUtilities.invokeLater( new Runnable() {
            public void run()
                getGlassPane().setCursor( aCursor );
                getGlassPane().setVisible( true );

  • How to change cursor when need to open a new dialog?

    Hi,
    I try to change cursor to WAIT when client open a new dialog, which it tell user the program was running to ready display new dialog.
    My code was like the following
    scene.setCursor(Cursor.WAIT);
    someclass.showMyDialog(); // The dialog was a new stage with StageStyle.UTILITY style
    scene.setCursor(Cursor.DEFAULT);
    But the cursor didn't be changed, I didn't know it why? Anybody know it? thank in advance!
    I had search the google, and didn't find the perfect answer, most of they was like to use setCursor(Cursor.WAIT) mode.
    the current ENV in my host was: windows 7 and Java
    java version "1.7.0_13"
    Java(TM) SE Runtime Environment (build 1.7.0_13-b20)
    Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
    Best regards,
    Edited by: user13005878 on May 27, 2013 1:48 AM

    If you have a long running process ("long" means anything the user will notice), you need to run it in a thread other than the JavaFX Application Thread. In other words, you need to change the cursor to the wait cursor on the FX Application Thread, launch a user-defined thread for your long running process (connecting to the database), and once that thread is complete, show the dialog and change the cursor back on the FX Application Thread again. If you try to do everything on the FX Application Thread, you'll likely block that thread and prevent any changes from being visible to the user until the long process is complete (so you'll never see the wait cursor).
    All that said, and as jsmith said, there are some bugs in JavaFX 2.2 with the appearance of the cursor. So on my system (Mac OS X 10.7.5) the "correct" behavior is only observed with JavaFX 8.
    This is an example of doing things wrong. Here I don't see any change to the cursor, even on JavaFX 8:
    import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Cursor;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class WaitCursorDemo extends Application {
      @Override
      public void start(Stage primaryStage) {
        final BorderPane root = new BorderPane();
        final Scene scene = new Scene(root, 600, 400);
        Button button = new Button("Do something time-consuming");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            System.out.println("Starting...");
            scene.setCursor(Cursor.WAIT);
            try {
              Thread.sleep(2000);
            } catch (InterruptedException exc) {
              exc.printStackTrace();
            scene.setCursor(Cursor.DEFAULT);
            System.out.println("Done");
        root.setBottom(button);
        primaryStage.setScene(scene);
        primaryStage.show();
      public static void main(String[] args) {
        launch(args);
    }This works on JavaFX 8: after pressing the button I see the wait cursor for two seconds, then it reverts to the default cursor.
    import javafx.application.Application;
    import javafx.concurrent.Task;
    import javafx.concurrent.WorkerStateEvent;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Cursor;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.layout.BorderPane;
    import javafx.stage.Stage;
    public class WaitCursorDemo extends Application {
      @Override
      public void start(Stage primaryStage) {
        final BorderPane root = new BorderPane();
        final Scene scene = new Scene(root, 600, 400);
        Button button = new Button("Do something time-consuming");
        button.setOnAction(new EventHandler<ActionEvent>() {
          @Override
          public void handle(ActionEvent event) {
            System.out.println("Starting...");
            scene.setCursor(Cursor.WAIT);
            Task<Void> task = new Task<Void>() {
              @Override
              protected Void call() throws Exception {
                try {
                  Thread.sleep(2000);
                } catch (InterruptedException exc) {
                  exc.printStackTrace();
                return null;
            task.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
              @Override
              public void handle(WorkerStateEvent event) {
                scene.setCursor(Cursor.DEFAULT);
                System.out.println("Done");
                // Display your dialog now you have the data from the database...
            new Thread(task).start();
        root.setBottom(button);
        primaryStage.setScene(scene);
        primaryStage.show();
      public static void main(String[] args) {
        launch(args);
    }

  • Change Cursor During Processing?

    Hi everybody!
    Is there a way to change the mouse cursor while processing a JSP page? For example my page looks like this:
    <HTML>
    <% change cursor to type 'wait' %>
    <% do a large task on the server which takes some time.... %>
    <% change cursor to default %>
    </HTML>
    Thanks in advance!
    /Paul

    No. A JSP does not have a mouse cursor, as it runs on the server and not on the client. Here's what happens in real life:
    1. At the client browser, the user clicks on a link or a Submit button.
    2. The server starts running the JSP file and turning it into HTML. The client does nothing but wait.
    3. When it is finished generating the HTML, it sends it to the client.

  • Customizing Cursor Color and/or appearance:  Does anyone know if you can change cursor color?

    Customizing Cursor Color and/or appearance:  Does anyone know if you can change cursor color in Mountain Lion? Any software for customizing and saving different cursors for Mountain Lion? Already have cursor size changed, but would like more options. Are more cursor customization options coming in future Mac OS X versions?

    There may be some haxies/3rd party s/w that can do this, but I've not heard of them.
    Customisation is limited on macs, unless you start hacking deep into the coreservices of the system - dodgy at best and almost certainly to get reset on the next update from Apple central
    Think different? Nooo....that was just a slogan.

  • Changing Cursor Shape to Hourglass

    I can change the cursor to the Hourglass prior to a long running process like so :
    setCursor(Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR));
    Toolkit.getDefaultToolkit().sync();
    Problem is that the cursor reverts to it's default state when the cursor is moved off the Applet or I switch to another application. This gives the impression that the background task has finished, when it hasn't.
    Please can anyone tell me how to prevent this.
    Hopefully simply as I'm only just a starting out Java programmer !
    Thanks
    Richard

    I had the same problem in a project. One thing is that it was a bug in early versions of the jdk/jre 1.1.x. So if you for example try to run your applet in netscape 4.x, then you will see this bug.
    Actually I think there is another problem. Your applet is busy and you move your cursor away from the applet and then back in. The thread is busy so how will it be able to change the cursor to the hour glass? I mean, if you put another window on top of your applet and remove the window again, the applet won't repaint itself before it finishes the task it is doing. And I think the same might go for the cursor (maybe I'm wrong). Otherwise, try to run your applet with jre1.3.x and see if it works there (you can also try with netscape 6.x which uses the same jre).
    Instead of using the hour glass, you could perhaps do something else in your applet showing that it is busy..

  • Change cursor under script control

    It would very helpful to be able to display a 'wait' cursor while an Illustrator script is running. I have several scripts which work on large numbers of objects, and I'm sure anyone running them would appreciate seeing the spinning colourwheel or hourglass while the script is looping away.
    I understand that Adobe's Javascript Toolkit would let you build a progress-bar dialog, but the delays are rarely long enough to justify such a thing. All the same, a change of cursor would reassure users that things were indeed happening.
    Scripting is an important feature for Illustrator, not just in saving effort, time and frustration, but because the work of the scripting community invariably suggests new features to be built into the core product or into plug-ins. Often scripts are seen and used by numbers of people other than their original authors. Anything that builds confidence in scripting's utility and capability is likely to be a good thing - and not just for Illustrator.

    Thanks, Mark - helpful to know that you tried.
    I think we can take the answer to my question as a 'no'. I'll post a suggestion in the Land of Forlorn Hopes, aka Illustrator Feature Requests.

  • Change Cursor Size with Pen Pressure

    Does anyone know of a way to make the paintbrush cursor size change dynamically according to pen pressure with a tablet?
    I'm coming to Photoshop from GIMP, and in GIMP when you use more or less pressure on the tablet, the cursor icon automatically changes size based on the pressure so you know exactly how large a line the tool will draw.
    In Photoshop it seems you can choose "normal" or "full size" for the cursor circle, or else use crosshairs, but there doesn't seem to be an option for a dynamically shaped cursor. Am I wrong and just missing something? Or does Photoshop really not have this feature?

    When you press and hold Option/Alt  + Control  and Left mouse click and drag nothing happens?
    (the button on your pen is set to left click?)
    The Option/Alt key should always be the second key to the left of the spacebar
    The Control key should always be the third key to the left of the spacebar

Maybe you are looking for