Disable a stage, dialog, window to prevent user actions

Dear all,
I'am developing an application with JAVA8 b96 and I'm asking myself how to prevent the user from doing user actions.
I have long running Tasks (e.g. 3sec. to load detail data) and would like to disable the gui (prevent user from pressing other buttons, show wait Cursor, etc.). The StackPane approach is not realy working, because it does not prevent the user from using the tab and space key to e.g. use Buttons (it only supresses mouse clicks).
Thank you in advance, Tim

Just experimented with this a bit; I don't really claim to fully understand this (at least, not at this time of night). It looks like you need to consume key events from the scene using an event filter. You can consume mouse events by placing an overlay over the entire scene (using something like a transparent rectangle) with the mouseTransparent property set to false.
Something like the following seems to do the trick; there may be a much easier way I'm not seeing.
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Cursor;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import javafx.util.Duration;
public class InputConsumerExample extends Application {
  @Override
  public void start(Stage primaryStage) {
    final BorderPane root = new BorderPane();
    final HBox top = new HBox(5);
    final Button showTextButton = new Button("Show text");
    final TextField textField = new TextField();
    final TextArea textArea = new TextArea();
    top.getChildren().addAll(textField, showTextButton);
    showTextButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        System.out.printf("textField has %s%ntextArea has%n%s%n",
            textField.getText(), textArea.getText());
    root.setTop(top);
    root.setCenter(textArea);
    final Rectangle mouseConsumer = new Rectangle();
    mouseConsumer.setFill(Color.TRANSPARENT);
    mouseConsumer.setMouseTransparent(false);
    mouseConsumer.setX(0);
    mouseConsumer.setY(0);
    mouseConsumer.widthProperty().bind(root.widthProperty());
    mouseConsumer.heightProperty().bind(root.heightProperty());
    mouseConsumer.setVisible(false);
    final Button pauseButton = new Button("Pause UI");
    pauseButton.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
        final EventHandler<KeyEvent> keyEventConsumer = new EventHandler<KeyEvent>() {
          @Override
          public void handle(KeyEvent event) {
            event.consume();
        pauseButton.getScene().addEventFilter(KeyEvent.ANY, keyEventConsumer);
        pauseButton.getScene().setCursor(Cursor.WAIT);
        mouseConsumer.setVisible(true);
        Timeline pause = new Timeline(new KeyFrame(Duration.seconds(8),
            new EventHandler<ActionEvent>() {
              @Override
              public void handle(ActionEvent event) {
                mouseConsumer.setVisible(false);
                pauseButton.getScene().removeEventFilter(KeyEvent.ANY, keyEventConsumer);
                pauseButton.getScene().setCursor(Cursor.DEFAULT);
        pause.play();
    HBox pauseButtonContainer = new HBox(10);
    Label state = new Label();
    state.textProperty().bind(
        Bindings.when(mouseConsumer.visibleProperty()).then("Paused")
            .otherwise("Available"));
    pauseButtonContainer.getChildren().addAll(pauseButton, state);
    root.setBottom(pauseButtonContainer);
    root.getChildren().add(mouseConsumer);
    primaryStage.setScene(new Scene(root, 600, 400));
    primaryStage.show();
  public static void main(String[] args) {
    launch(args);

Similar Messages

  • Dialog windows close prior to action  Illustrator CC

    When I select "open" from the menu, the "open" dialog box opens and then immediately shuts.  I can't open a document in Illustrator.  Also, this has been happening in other dialog boxes, such as save as....
    Creative Cloud indicates my software is up to date.  Any Clues?
    Thanks!

    This was happening to me in all my Creative Cloud programs.  When the dialog comes up quickly change the view option to list view.  Mine was on Cover flow and that seems to be the issue.  Since I've changed it I haen't had any quickly closing boxes.

  • Shared variable dialog window

    I want to ignore the dialog window or prevent it from coming up when there is an error in my shared variable.  I am reading data from a PLC on a manufacturing machine.  I am doing this on a separate server system and it isn’t monitored, so the fault does nothing but lock the Vi and prevent it from collecting data until someone happens to look at it.
    I have a loop that is waiting for the variable to change and the most common error is when the PLC is turned off and there is no data available, however there are others that come up now and again.
    I want to simply return to the loop and keep cycling until the data is there and readable again.
    Is there a way to prevent the Shared Variable from halting on error?  Can I turn off the dialog box so that it doesn’t stop the Vi?

    It is coming from LabVIEW's autmatic error handler.  There is also a VI option that can be changed globally for the VI to ignore the error.  But I don't recommend changing that unless you have accounted for all other errors you could possibly get elsewhere in the VI.  Any node that has an error output not wired to something else will have this dialog box pop up if the VI option is set to automatically handle the errors.
    Another alternative is to wire the shared variable error to a tunnel on the loop, but don't do anything with it afterwards.

  • How to read the pop-dialog window data in adf

    HI All,
    Using the jdev 11.1.1.6.
    I have two questions here :
    1) How to read the selected table row data from the Pop -dialog window .
    2)hOw can i forward to another URL view/view after selecting the data on dialog window and then click 'ok".
    NOte : One of the blog says ' we cant apply the action and actionListener on button ,if we apply showPopupbehavious ,SO how can i forard to another page/URL view ? ,
    scenario:
    Upon click of some button , infomration ll be displayed on pop-dialog window and then user will select the any one of the row and click "OK"
    . based on some data check i should forward it to the view/urlView .
    any hits highly appriciated
    thanks

    1) How to read the selected table row data from the Pop -dialog window .simple . get the employeevo and jobvo with relationship(fk or association/viewlink) drop the employee vo as af:table. show a detail icons at the end of column. make popup with show popup behaviour with lazyuncached drop the af:dialog it wiil show the details in job of concern employee
    2)hOw can i forward to another URL view/view after selecting the data on dialog window and then click 'ok".
    NOte : One of the blog says ' we cant apply the action and actionListener on button ,if we apply showPopupbehavious ,SO how can i forard to another page/URL view ? ,can you show the blo url to me.
    grasp things.
    http://hazem-adf-tips.blogspot.in/
    https://blogs.oracle.com/jdeveloperpm/entry/how-to_efficiently_redirect_to_an_adf_faces_view_using_adf_controller
    http://adf-lk.blogspot.in/2011/06/oracle-adf-how-to-redirect-url-in-bean.html
    http://adfdeveloper.blogspot.in/2011/07/adf-auto-redirect-while-still-passing.html
    http://www.slideshare.net/baigsorcl/oracle-adf-task-flows-for-beginners
    http://www.techartifact.com/blogs/2012/03/adf-jsf-some-handy-code-for-backing-beans.html

  • Preventing users to copy mails to Windows File System

    Hi,
    We want to prohibit users to copy mails from their Outlook inboxes (and other folders) to Windows explorer folders, by using Ctrl + C.
    I'm trying two approaches:
    1st - Change Windows clipboard settings to prevent users to add .msg files (Outlook messa format) to clipboard;
    2nd - Change Outlook settings to prevent copy mail from folders.
    I already searched in Group Police Management for an clipboard setting and also tried Office 2010 Administrative Template files, but there's no such option for Outlook.
    We don't want to disable the clipboard for Outlook or Office, since users still can copy content from and to message bodies.
    Is there a way to accomplish it?

    This would be impossible to prevent AFAIK.  There are many ways to save an email to a file, or drag and drop.  You couldn't prevent all of them.
    Eric Legault (MVP: Outlook)
    About me...
    Outlook Appins: Store Social Media fields in your Outlook Contacts!

  • How to prevent user from disabling plugins like censureblock or adblock?

    I'm thinking about using censureblock and adblock in classroom in school, but it is easy to disable these plugins. Is there a way to prevent users to disable or delete these plugins?

    Hi microspace
    you mean add-ons, like censureblock or adblock.
    see if this helps : [https://addons.mozilla.org/en-US/firefox/addon/public-fox/ Public Fox - addon]
    thank you

  • Prevent user to open window with same session

    Hi all,
    I have a requirement to prevent user from opening a new window of same session, either by right click, middle click or any other method.
    Can anyone tell me how can i use session state to find that new window of same session is opened, and if yes, i can give an alert message that 'Only one window is allowed at a atime for a user'. Thanks alot.
    With Regards,
    Sunil Bhatia
    Oracle APEX

    You can enable the checksum feature in the Application Security attributes to prevent users.That would be closest you can acheive towards your requirement.
    <li>However you try and prevent users from creating a new page, they can always use their browser features to duplicate a page ,and this works even with a checksum in the URL
    For example in firefox, place your cursor in the URL bar and press {CTRL} + {ENTER} , it duplicates a page.
    <li>Now, assuming that they did this, how do you identify which page is valid, For apex either page sents a request only and it doesn't know what happens at the client side. Remember apex session details are stored at the server side only.

  • How to disable Open File dialog in Preview

    After I upgraded from Mavericks to Yosemite, Preview app started popping up the Open File dialog box every time I launch it.  It used to just launch and do nothing.
    Is there a way to prevent Preview in Yosemite to present the Open File dialog box to the user?  I vaguely recall a "defaults write" kind of command that would disable this feature.
    The use case this behavior is breaking is as follows:
    1. Want to take a screenshot and save it to a file.
    2. Press Cmd-Ctrl-Shift-4 to snap a screenshot and save it on the clipboard.
    3. Cmd-Space to bring up Spotlight, type Preview and launch Preview
    4. Cmd-N to instruct Preview to paste the contents of the clipboard to a new file.
    With Yosemite, step-4 above breaks, since I have to hit Esc first to clear the dialog box.

    Try this it will give the full directory structure.
    REPORT  ZTEST3460  line-count 30(2)   .
    PARAMETERS: FILE LIKE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE.
                         CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
                         EXPORTING
                           DIRECTORY              = ' '
                           FILEMASK               = ' '
                          IMPORTING
                            SERVERFILE             = FILE
                         EXCEPTIONS
                           CANCELED_BY_USER       = 1
                           OTHERS                 = 2
    Cheers

  • Close dialog window by clicking on 'X'

    Hi
    I am displaying a dialog window that allows the user to modify data.
    When the user clicks on the 'Cancel' button I have placed on the window, the action code fires and the return listener fires.
    I have added some java script that executes the following command when the user closes the dialog by clicking on the close icon.
    submitForm("groupCaptureForm",0,{source:"cancelGroup"});
    Basically simulating a click on the 'Cancel' button.
    For some reason when the user closes the window by clicking on the close icon, the action code fires, but the return listener code never fires.
    Any idea why?

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • CS4 poor dialog window performance with huge screen dual 30 inch

    Hi, I am running dual 30 inch monitors each one at 2560x1600 resolution, on windows xp sp3 on an nvidia quadro FX 3700M (dell precision M6400 laptop)
    If I use CS4 from the single laptop screen, everything is fine. However, whenever Im on the huge dual screen desktop any dialog box activity has a very poor performance. For example, I select File>New and the dialog window takes some two to three seconds to draw on the screen... it might not seem like a big problem but it is very very annoying since I am used to the snappy response of the user interface from years of PS use. It really affects my workflow since I work with many files at the same time.
    Also, the bigger the dialog window the slower it takes to appear. If I select File > Save for Web and Devices, that dialog window will take up to five seconds to appear on the screen.
    The problem seems to get worse the longer the OS has been working, ie. if the PC is freshly booted the problem seems a bit lighter. So it might be related to video card memory or something.
    Here's what I have tried so far to solve this:
    Since what I'm using is a laptop, the driver choices are limited, however I've been able to force install the 181.20 version of the nvidia driver, but it made no difference. All the official driver versions (176 series) from Dell also have the problem.
    The problem doesn't seem related to Photoshop's use of the GPU as the problem remains while the GPU acceleration disabled.
    This problem is also present in PS CS3 as well as CS2 CS1 and version 7 which are all I am able to test.
    I was able to reproduce this problem on a desktop computer with the same setup on an nvidia quadro FX 5500 card. The dialog box window performance is really terrible.
    I did not notice this problem in any other application that spans the two screens, even high end 3d ones.
    Ok well it seems from my testing that Photoshop is simply bogged down by having such a huge desktop area to work with. It is really disappointing since PS was my only reason to spend so much money on this dual 30 inch screen setup.
    Has anyone else noticed this? Are there any other suggestions? Any adobe support on this?
    Thank you

    I have tried with both open gl enabled and disabled (edit > preferences > performance)
    The problem is present even in Photoshop version 7, I think that one didnt even notice the presence of a 3d accelerator chip.
    Both video cards tested have 1GB of video ram.
    Thanks.

  • IME mode disables on file dialog

    We have this custom photo uploader that we designed to help non-computer types to be able to figure out what pictures they were about to send us before actually using their often limited bandwidth. It turns out that in Japan as soon as the multi-file select dialog is used it disables the IME mode switcher and our users have to exit the browser and restart before they can type in Japanese into the site again. We tried rolling back to a couple older flash players, 10.0.102 and 10.3.181 which didn't help. We also rebult the project with CS5 and that didn't work either. We're stumped because it worked in May, but sometime in June it seems to have stopped working. We're pretty sure it's not the uploader itself because it works in Chrome and Firefox, but it fails in IE7 and 8, on XP, Vista, and Windows 7. I'd add a code snippet, but there just isn't anything unusual in there, and nothing specific to Japan or even mentioning the IME mode. Anyone else experience this or have an idea as to what we can do with it?

    LabVIEW 2014 SP1 seems to solve that problem here on my Mac OSX 10.10 system.
    Now Apple may be nice for end users, but all those Apple fan boys sure would think a little different about it, if they had to write programs on the Mac. Apple keeps changing its APIs and their behaviour continously, inventing new APIs (which is fine) in a rapid pace, only to depreciate and remove older APIs at almost the same speeed!
    Microsoft sometimes goes to the other extreme with maintaining backwards compatibility but working with Apple systems surely isn't easy as a programmer (unless maybe when one uses their high level click and point together web design applications, but I don't know that).
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • "ESC" button to close Dialog window? how it can be done

    Dear Friends,
    my application has got lot of Dialog windows, How can i map ESC button so that when the users press ESC button the window will get close automatically, all these windows designed so show data only.
    Please advise me.

    For Esc button it is not possible anway u can use F1 key,use Key-Help tigger on block level and write
    Exit_form (no_validate);
    but it will disable help menu on this block but i dont think so it is relate to user the sample code would be for F1 key is
    Tigger : Key-Help
    Level : Block
    exit_form(no_validate);
    By pressing F1 on this block your form can exit .You can exit this trigger on Form level and it will work for all blcoks in ur Forms if any problem contact my personel email address
    [email protected]
    thank you
    Khurram Siddiqui

  • Prevent user from downloading data

    Hi folks,
    I am currently exploring SQL Developer. I have this problem and hope u folks can help me.
    Currently, I am trying to prevent users that have access to the database from downloading ALL the data in the database, esp in the data window of the tables, user can easily right click and export the data into csv files etc. I was wondering if this can be disabled.
    Would it be disabled from the software i.e. sql developer or has it got something to do with the role and privileges that I need to set with the account??
    Any advice is appreciated.
    Thanks!

    The first question that comes to my mind is that if you are that worried about your users accessing data and copying it off then is SQL*Developer really a tool you want to be giving them access to. As others have stated, if the users have access via SQL*Plus then they can spool off the data to files. There are many other tools they could use to extract the information (MS-Access, MS-Query (part of Excel), JDeveloper &c, they could even write their own tool if they so wished).
    You either trust your users in which case SQL*Developer isn't a problem or you don't which means that you have to deal with more issues than just SQL*Developer. If there are certain fields that you don't want your users to be able to see but they need to access the table then you could, for example, deny them access to the table but create a view that excludes the fields you don't want them to see or use encryption/obfuscation from your application on those fields.
    Also, if you don't trust your users, you really need to talk to your HR department about hiring practices and salaries. Your company may be lax in it's hiring (hiring untrustwothy people) or not paying your staff enough (the less you pay yopur staff the easier they are to tempt).
    Stephen

  • Open File dialog window when setting the value of a path type input argument in a VI call

    Hi,
    I am new to TestStand (running 4.0) and I want to create a sequence of VIs to turn on, setup and measure a device. One of my VIs sends a configuration file to my device. An input argument to this VI is the path of the config file. I would like to make it simple to modify this path when setting up the sequence by popping up the File Open dialog window and choose my file. Is this possible? I do not want to manually change the file during execution, just to have multiple calls of one VI, each call opening a different file according to the path given to it during the setup. 
    So far I have only succeeded in manually entering the absolute path each time I add this step. What makes it even more annoying is the fact that LabVIEW interprets the path with the escape codes, rendering the path unusable. Manually adding a 2nd backslash at each '\' occurence adds another step to the process. I tried both String and Path type of inputs, and the SearchandReplace() or ToUpper() (trying to bypass the escape codes) functions in TestStand don't seem to help m.
    Your help is very much appreciated,
    Fred

    Eudaemonic,
    If you want to create a series of easy to configure step types so others can develop sequence files easily, you could use custom step types. When you create a custom step type you implement your own configuration dialog. Since you have control over what controls you expose in your configuration dialog, you can design it so the desired path is selected using a open file dialog. Refer to chapter 13 of the TestStand reference manual for more information about custom step types.
    If you do not want to create a custom step type but you still want to give access to your sequence developers to pre-configured steps, you can use templates. A step template is a snapshot of a step that you can reuse later. Let's assume that instead of asking your users to edit the step to enter the desired path, you create several step templates with different pre-configured paths and based on their applications requirements they could use the appropriate template. Refer to the NI TestStand Help for more information about the Templates list on the Insertion Palette.  
    Hope it helps.
    Antonio Lie. 

  • "Save As" and "Open" file dialog windows very slow to appear...

    I have a home network with 4 PCs, three using XP/3 and 1 using Win7.  Until recently, I had the three XP boxes in one workgroup (not homegroup) and the Win7 box in a different workgroup.  Everything was running fine.  I got anal and decided
    to rename some of the boxes and put them all in one workgroup, the one that the Win7 box is in.
    Immediately after I did all that, I noticed that every time I did a "save as" file function on the Win7 box, no matter the application, the dialog window took much longer to appear - sometimes almost 10 seconds.  This is not the case on the XP
    boxes.
    Following a suggestion I got on the Microsoft Answers Forum, I removed all the shares on my network and even removed the 3 XP boxes from the network, and I turned off Network Discovery.  The problem persisted.  Only when I disabled my LAN
    connection did the dialog windows appear instantly, as they had done before.  I have now restored the original configuration, but the "save as" dialog window continues to come up very slowly on the Win7 box.
    Any thoughts, clues or suggestions as to how to fix this non-critical but very irritating problem would be greatly appreciated...
    H.
    Hawgman

    I've hit a similar problem since (or at least exaserbated since) changing to a new ISP service (BT Total Broadband) which included a wifi router upgrade.  LAN has a stable Win XP SP3 fully updated, a W7 also fully updated (I love Office) and a previously
    stable Zyxel router.  Then this occasional problem:  File -> Save As from any application stops dead for up to a few minutes, no CPU burn so waiting on interupt or external event.  Patience, then it works. 
    So I'm guessing a confused IP table somewhere.  I'm off to play with using fixed IP addresses and lease expiries in the LAN part of the new router's config to see if that makes it easier for XP to handle closed connections. 
    And isn't there a "not persistent" option somewhere ... 
    But I don't networked drives, I use shortcuts with network addresses. 
    More anon after some exploration. 

Maybe you are looking for

  • I want to setup my 9 year old for family sharing and seperate iTunes account but do not have credit cards

    I am unable to setup a new iTunes account / family sharing for my 9 year old as I do not have credit cards, it seems that it is only possible to do so with a credit card, however I feel it is unfair that I would need to apply for a credit card just s

  • Embedding view in view container UI element

    Hello,    I have a requirement which is given below:   I have a MAIN view where there is a view container UI element. This container holds one of 3 views(VIEW1,VIEW2 and VIEW3) depending on user input. Initially VIEW1 is displayed (this is set as the

  • How can i fix my itunes when it is not opening?

    For some odd reason my itunes will not open. Every time I click the itunes application all it does is open it for olny 2 seconds then closes down and a little message shows saying The application iTunes quit unexpectedly. Mac OS X and other applicati

  • Battery backup low.

    On bettery backup, laptop running max only 30minutes on full charge. Do i need to change my battery or there is something else. using this macbook pro around 20 month. Pls give me a suggestion.

  • Stuck PDF file

    A pdf file has stuck/embedded in Preview making it impossible to save it or any other file opened in Preview.  I cannot even close Preview without a Quit Force.  Remedy?