Application Modal Stage(Window) possible in JFXPanel?

I'm working on an app using JDK 1.7 (can't move to 8 yet) where the main view code is Swing. In one subapp I am creating a JavaFX Scene which is inside a JFXPanel. I have a JFrame which has a JPanel which has a JFXPanel which has the Scene.
I am setting up "windows" to allow operations  which are launched off off of right click ContextMenu instances on the scene. I would like these "windows" to be modal over the JFXPanel or even the whole java app if easier.
So far I have been creating instances of Popup and putting my nodes inside that. I then show the popup over the parent node. This works fine but the popup itself isn't really modal on the scene or app. It does stay open even if the user does other actions on the scene but it also stays open even if the user goes to another subapp which isn't fx and the JFXPanel goes out of focus.
A couple of problems are that the main app can be moved around and the popup doesn't move with it. Also actions can still be performed on the scene while the Popup is shown. I can stop the actions by in the handlers checking if a popup is open and doing nothing if it is. Also I can hide the popup if the user switches away from the fx subapp by listening on focus events on the JFXPanel.
Some of the actions launched from within the nodes inside the Popup require confirmation windows to the user. I have been able to get those to work and they do work modally like I expect. They are on top of the Popup window and the user can't do any actions underneath the confirmation window. The confirmation dialogs are implemented by creating a new Stage and setting it's parent to the Popup and setting the modality to Application or Window.
Since the confirmation window behavior works as I wanted I am trying to make the content nodes of my Popups to behave the same way by putting them in a new Stage and setting the modality to Application or Window. For the parent of the new stage the only thing I can think of is to call getScene().getWindow() on the JFXPanel. This returns a Window instance (EmbeddedWindow I think) and  it seems to work ok with the initOwner() call on the new Stage.
The new Stage shows up with my contents in it when launched from the right click ContextMenu on the stage. It does seem to be modal as I can't do any operations in the JFXPanel underneath. The problem is that if I do anything in the scene inside the JFXPanel then the 2nd stage goes to the back of focus. I set the 2nd stage to application modal. If I set the 2nd stage to window modal then the other nodes in the scene are not blocked and the 2nd stage isn't modal at all.
I think I could accomplish what I want if I put another JFXPanel with the Popup contents in it inside of a JDialog every time but I would like to do this with JFX code only if possible.
I guess the real question is if it's possible to have some kind of truly modal window that stays on top  of a scene inside a JFXPanel using JFX 2. Any ideas that don't involve moving to JFX 8 since that isn't possible for me?
Thanks,
-Darryl
EDIT:
I see an exception now and maybe this is the real problem. I'm not sure if it was always happening or just started.
Error: Unsupported type of owner com.sun.javafx.tk.quantum.EmbeddedStage@ce2dc4
Exception in runnable
java.lang.ClassCastException: com.sun.javafx.tk.quantum.EmbeddedStage cannot be cast to com.sun.javafx.tk.quantum.WindowStage
  at com.sun.javafx.tk.quantum.WindowStage.setVisible(WindowStage.java:422)
  at javafx.stage.Window$9.invalidated(Window.java:739)
  at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:127)
  at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:161)
  at javafx.stage.Window.setShowing(Window.java:779)
  at javafx.stage.Window.show(Window.java:794)
  at javafx.stage.Stage.show(Stage.java:229)
  at javafx.stage.Stage.showAndWait(Stage.java:395)
Message was edited by: RDarrylR Added Exception
Message was edited by: RDarrylR
Changed title to be more clear

I changed the title as I think I understand the issue better now. I don't see the exception most of the time but the real question is if I can have an application wide (not just the JavaFx part but the whole outer app) modal stage shown inside a JFXPanel? If I open a Popup inside my JFXPanel on top of the JFXPanel scene then I can have a modal stage with the Popup as the parent. When trying to open a modal stage on top of the scene from the JFXPanel, the modal stage always gets pushed to the back of focus if I click on something outside the JFXPanel.

Similar Messages

  • Modal Popup Window Hides Help Popup Window

    Hello Everybody,
    today I stepped upon an issue regarding popup windows.
    I have created an application with popup windows for editing and inserting new records.
    I left the item label templates to "Optional with Help".
    When I now click upon an item label the help - popup window appears but it is hidden behind the popup window I am working in.
    Is there a workaround for that.
    Is there a possibility to modify the z-order either of the help popup or of the modal window ?
    Any advice is appreciated.
    Regards
    Marc

    There are lot of options to customize the behavior of jQuery dialog. You can set height as auto, however you need to specify some fixed width depending on the content.
    $( "#TEST_POPUP" ).dialog({ height: "auto", width:500 });Default for height is auto, so you may not need to specify it.
    See http://docs.jquery.com/UI/Dialog for more info.
    Regards,
    Hari

  • Position of an non modal external window

    How is it possible to set the position of an non modal external window?
    I've tried it over
    window.setWindowPosition(new WDCssSize(500,WDWindowUnitOfLength.PX),new WDCssSize(200, WDWindowUnitOfLength.PX));
    and also over
    window.setWindowPosition(500,200);
    The result is always the same, the window is shown on the top left.
    Best regards,
    Thomas

    Hi Thomas,
    I tried the same. The code I tried is:
    IWDWindow pop1=wdComponentAPI.getWindowManager().createNonModalExternalWindow("http://www.google.com","google");
         pop1.setWindowSize(512,600);
         pop1.setWindowPosition(50,100);
         pop1.show();
    Its working fine for me. Even I tried changing the parameters for size and position. It worked fine.
    Just 1 thing I noted in you post. You gave the code as:
    window.setWindowSize(512;400);
    although I think it should be
    window.setWindowSize(512,400);
    I do not know whether it was a typo or its in the application(it would have been syntax error in your application).
    I am using IE 6.0. May be its something to do with the versioning.
    Regards.
    Rajat

  • Modal dialog window to system

    Hi,
    I could not find proper link to post this, so I am posting here.
    I want a system level dialog window i.e. when this window is visible it should always be at top most and user should not allowed to select other applications.
    I used runModalForWindow method of NSApp but it is creating modal window with respect to my application and I am able to select other applications.
    I want my modal dialog should be top most dialog to my application and user should not be able to select other application.
    Thanks.

    Hi
    My application is running in kiosks environment. So I want when any modal dialog pops up in desktop from my application, user should not be able to select any other application from the desktop i.e. I want my modal dialog window should always be at the topmost.
    If it is not possible to have a system level dialog window, any alternate solution so that my modal dialog will be at topmost and user should not be able to select any other application as long as this dialog is visible will really helpful to solve my problem.
    Thanks.

  • Modal Dialog window

    Hi,
    I have designed a XDP form using Adobe designer 7.0 in which i have a button. now i want a modal dialog window to be opened on click of a button.
    how can i do this? what should be the type of button?
    Thanks,
    rajasekhar MV

    Hi
    My application is running in kiosks environment. So I want when any modal dialog pops up in desktop from my application, user should not be able to select any other application from the desktop i.e. I want my modal dialog window should always be at the topmost.
    If it is not possible to have a system level dialog window, any alternate solution so that my modal dialog will be at topmost and user should not be able to select any other application as long as this dialog is visible will really helpful to solve my problem.
    Thanks.

  • Application Runs Under Windows 8.1 But Not Under Windows XP (I Know XP Is Deprecated)

    The problem is with the obtuse error message put out by Windows's program loader. It reads, in part, "..is not a valid Win32 application." The application runs everywhere except on Windows XP. Looking for root cause of the problem. It's a very
    simple application. Only a few lines of code. 
    C:\Packaged-Software\32-BIT\Reboot.exe is not a valid Win32 application.
    Proposed nature of the problem:
    1. The file was downloaded from a website but the download was incomplete.
    2. The full file system filename path contains bad characters such blank space.
    3. Visual Studio constructed an application that won't run anywhere much less on XP.
    4. The supporting libraries are not properly installed (e.g. .NET Framework4, and VCREDIST).
    Retorts:
    1. The file wasn't downloaded from a website and is intact.
    2. The filename path doesn't contain any spaces.
    3. The application runs under Windows 8.1.  Also on Windows 7.
    4. The supporting libraries are properly installed.
    So, what's the problem?  One surely will not discover the root cause from "not a valid application."
    Body must be 4 to 60000 characters long.  I had put the code here.  It isn't 60000 character long.  But it validated as if there are more than 60000 characters.  Sorry for the incomplete submission due to website construction error.
    MARK D ROCKMAN

    Hi F7H2fw,
    How did you develop the application ?
    Here is a similar symptom and this may explain the issue somehow:
    Setup.exe is not a valid Win32 application
    http://blogs.msdn.com/b/vsnetsetup/archive/2012/10/16/setup-exe-is-not-a-valid-win32-application.aspx
    I suspect there is a compatibility issue here .
    Considering this is more likely a developing issue .It is recommended to ask for help from our MSDN Forum .They are more familiar with the developing issue .If it is possible ,please attach the code in that thread .Thanks for your understanding and cooperation.
    MSDN Forum
    https://social.msdn.microsoft.com/Forums/en-US/home
    Best regards
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • BUG! Not system locale Filenames support for 32-bit applications error in Windows 8.1 x64 and other microssoft x64 OS-s.

    BUG! Not system locale Filenames support for 32-bit applications error in Windows 8.1 x64.        
    All Windows x64 (XP,2003,2007,Vista,7,8) have no support for not system locale filenames|foldernames for all 32-bit applications. I think it is BUG!
    For example,  it is possible to read files|folders with French or Chinese in English locale windows installed, rename it, but it is not possible open it, edit or delete. (ERRORS: File not found OR Unknown format)
    With using 64-bit programs no such problems. How does it works and how can I fix this? Is it problem with encoding in translating kernel instructions for 32-bit apps in x64 Windows OS's? Whether there are
    solutions to this problem OR some hacks|fixes? 

    Hi,
    Have you installed the language package for French or Chinese?
    If no, please download the language package and install them.
    To download language package, please click the link below,
    http://windows.microsoft.com/en-US/windows/language-packs#lptabs=win7
    Best Regards.
    Steven Lee
    TechNet Community Support

  • How to create an application with a 'Windows' like interface?

    Hi,
    I am trying to create an application with an windows like interface where menu selections need to open bound taskflows in a page/window but i can not get it to work. I did the following
    - i created a page template with a panelStretchLayout
    - added a menuBar with commandMenuItems
    - created a start page based on the template
    - created bound taskflows with page fragments for all menu items
    - placed a dynamic region on the start page which initially shows a taskflow with an empty/blank page fragment
    - change the dynamic region taskflow from every menuitem and added partial triggers on the dynamic region for every menu item
    When i run the application the first empty page fragment is showed correctly but when i select a menu item the correct new page fragment is showed but it keeps showing a loading data .... hint and seems to freeze. So no data is showed while the underlying datacontrols work while using the bc tester.
    Besides this problem i am wondering if i at all am going the right way with this with using a dynamic region? In the final application i will have a total of about 25 menu items over several menus and if they all will be showing in one main dynamic region with partial triggers set to all menu items it may get a bit complex? I saw you can also create a window in a popup which i like even more because it looks like an actual window but this is modal. I would like a bound taskflow to be opened whenever a menu selection is made.
    Any pointers or tips or the solution to not showing data?
    Kind Regards,
    Andre

    Hi Sascha,
    If have not encountered that problem. Are you sure you have a taskflow entry under the executables tag in the page definition of the page which has the dynamic region on it? I have one like this:
    <taskFlow id="dynamicRegion1" taskFlowId="${DynamicRegionBean.dynamicTaskFlowId}" xmlns="http://xmlns.oracle.com/adf/controller/binding"/>
    During the selection of its initial value when it is rendering for the first time it should have the session bean already initialized. My bean looks like this:
    public class DynamicRegion {
    private String taskFlowId = "/WEB-INF/startTF.xml#startTF";
    public DynamicRegion() {
    public TaskFlowId getDynamicTaskFlowId() {
    return TaskFlowId.parse(taskFlowId);
    public String feitenTF() {
    taskFlowId = "/WEB-INF/feitenTF.xml#feitenTF";
    return taskFlowId;
    public String themasTF() {
    taskFlowId = "/WEB-INF/themasTF.xml#themasTF";
    return taskFlowId;
    public String feitCategorienTF() {
    taskFlowId = "/WEB-INF/feitCategorienTF.xml#feitCategorienTF";
    return taskFlowId;
    The startTF is the initial taskflow and the other methods are being called from my menu. The dynamic region has the menu items as partial triggers. That is all i did.
    Kind Regards,
    Andre

  • TIP: Building Modal Popup Windows

    Build Modal Popup Pages
    Introduction
    The following is based on the 'How To Document' - 'Build Custom Popup Pages'.
    This How To will show the developer how to create Modal Popup windows with the ability to pass information back to the parent window.
    Example Scenario
    The example described in this how to adds a custom modal popup LOV to a form on the SCOTT.EMP table. Clicking the popup LOV link on the form page will popup a Modal LOV page that allows users to search by ENAME, JOB, and SAL. Selecting a value from this LOV page will close that popup LOV page and populate the ENAME, JOB, and SAL fields on the form page with the selected values. Additionally, had the user entered some data into the ENAME, JOB, and/or SAL fields on the form page, that data would be used in the initial search when the popup LOV page is first shown.
    Step 1 - Create a simple form page on SCOTT.EMP
    To create the form page, simply step through the HTML DB "Form on a Table or View" wizard against the EMP table accepting the defaults. For this example, create the form with a page number of one, and make sure to allow the ename, job, and sal fields to be editable. When the wizard completes, page 1 of the application should have the items P1_ENAME, P1_JOB, and P1_SAL on it as text fields.
    Step 2 - Create a popup page with search fields
    Next, create a page that's to be used as the popup window: Page 2. Ultimately, this page will have javascript, a report region, and some buttons. For now, though, just create a page 2 with the items P2_ENAME, P2_JOB, and P2_SAL on it as text fields.
    Step 3 - Set Modal popup page header requirements
    A) Modal windows by default cache the information they display. When creating a popup window which displays different information each time it is called or to allow searching the caching default must be switched off.
    Add the following meta-tag to the "HTML Header" field of the page-level attributes screen for page 2 to accomplish this:
    <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
    B) Modal windows by default open a new window when running any redirect calls. When creating a modal popup which passes back parameters to the parent window. The modal window has to be forced to fire redirect calls within its own window rather than open a new window for the redirect.
    Add the following tag to the "HTML Header" field of the page-level attributes screen for page 2 to accomplish this:
    <base target="_self">
    Step 4 - Add Javascript call to the popup page
    Because the popup page should filter its result set based on any values that the user might have entered onto the form page, you need to add a javascript function that would pass those values off. Add the following function to the "HTML Header" field of the page-level attributes screen for page 1 to accomplish this:
    <script language="JavaScript" type="text/javascript">
      function callMyPopup (formItem1,formItem2,formItem3) {
        var formVal1 = document.getElementById(formItem1).value;
        var formVal2 = document.getElementById(formItem2).value;
        var formVal3 = document.getElementById(formItem3).value;
        var url;
      url = 'f?p=&APP_ID.:2:&APP_SESSION.::::P2_ENAME,P2_JOB,P2_SAL:' + formVal1 + ',' + formVal2 + ',' + formVal3 ;
      // IE Browsers modal popup window
      if (window.showModalDialog) {
        w = showModalDialog(url, window.self,"status:0; scroll:1; resizable:1; dialogWidth:25; dialogHeight:43");
        // w is an array returned from the modal popup containing the passback values
        if (w) {
          document.getElementById("P1_ENAME").value = w[0];
          document.getElementById("P1_JOB").value = w[1];
          document.getElementById("P1_SAL").value = w[2];
          document.getElementById("P1_SAL").focus();
      else {
      // mozilla based browsers modal popup window
      w = open(url,"winLov","Scrollbars=1,resizable=1,width=800,height=600", modal="yes");
      if (w.opener == null)
        w.opener = self;
      w.focus();
    </script>Though you don't need to know how to read javascript for this example, it helps to understand that this function only does one important thing: it opens a modal popup window of page two in our application while passing values to P2_ENAME, P2_JOB, and P2_SAL. It gathers those values to pass from the names of the HTML DB items provided to it. The call to this function will be added in the next step below.
    Step 5 - Add a popup link next to the P1_SAL field on the form page
    Add a link to the form page that will call the callMyPopup function above and pass it the values it needs. To do so, place the following HTML in the "Post Element Text" field attribute of the P1_SAL item:
    <~a href="javascript:callMyPopup('P1_ENAME','P1_JOB','P1_SAL');">Click for LOV<~/a>NB. remove ~ from above when deploying
    Step 6 - Add the LOV report to the popup page
    The next step is to create a report on the popup page based on the values passed from the form on page one. The tricky part of this report is providing a means for the selected values to be passed back to the form page. This can be achieved by having a column of the report render as a javascript link that would close the popup window and pass the ename, job and sal values for that row back. Start by adding a simple report region to our Modal popup page that uses a query such as:
          select ename, job, sal , 'placeholder' the_link
            from emp
           where ename like '%'||:P2_ENAME||'%'
             and (job = :P2_JOB or :P2_JOB is null)
             and (sal = :P2_SAL or :P2_SAL is null)Note that the last column in this query is just a placeholder. once the region is created, turn that placeholder into a link by doing the following:
    Navigate to the Page Definition for page 2
    Next to the name of the report region created in step 6, Click Q
    Next to the column THE_LINK, click the edit icon
    In the "Link Text" field enter the string "select"
    In the URL field enter: javascript:passBack('#ENAME#','#JOB#','#SAL#'); Click the "Apply Changes" button
    Step 7 - Add the javascript function to the Modal popup page to pass selected values to the (parent) form page.
    In the previous step you added a call to a javascript function, passBack. Now add that function to the top of Modal popup page 2. In the same manner as step 4 above, add that passBack function to the page 2 by putting it in the "HTML Header" field of the page-level attributes screen. The function should look similar to the following:
    <script language="JavaScript">
       function passBack(passVal1, passVal2, passVal3)
         // IE Browser return the passback values in an array
         if (window.showModalDialog) {
           var retVal = new Array(passVal1, passVal2, passVal3);
           window.returnValue = retVal;
           window.close();
         // Mozilla based browsers right the passback values directly into the parent window
         else {
           opener.document.getElementById("P1_ENAME").value = passVal1;
           opener.document.getElementById("P1_JOB").value = passVal2;
           opener.document.getElementById("P1_SAL").value = passVal3;
           opener.document.getElementById("P1_SAL").focus();
           close();
    </script>This function simply sets the values of P1_ENAME, P1_JOB, and P1_SAL with the values of the whatever's stored to the three HTML DB item names passed to it. It also closes the current window and puts the cursor back into the P1_SAL field.
    Step 8 - Polishing
    The basic functionality of this custom modal popup window has been created in steps 1 though 7. To make its usage a little more friendly, it's advisable to add Cancel and Search buttons to the popup window page. The Search button should just be added as a regular button that branches back to the page 2. Adding this button allows users to re-query for LOV options without having to return to our form page. The Cancel button should be created with an "Action" of "Redirect to URL". The "URL Target" of the button should be javascript:window.close(). As the code suggests, the Cancel button would just close the popup window (with no values returned).
    Hope this is of use....

    Everything said above is working fine but in Mozilla small popup is coming in top left corner of browser..
    so please help me so that it is opened in proper width and height in mozilla.

  • Modal Popup Window close issue

    Hi,
    i have a master detail form
    i added a link field on detail form to open a form in popup modal mode
    i putted on Link Attributes onClick="new Ext.ux.PopupWindow({url: this.href, height: 450}).show(); return false;"
    due Modal Popup Window example by Mark Lancaster
    ([http://oracleinsights.blogspot.com/2009/09/apex-modal-windows-are-snap-using-extjs.html])
    I can't close popup window and return on calling page
    Any help?
    Thanks in advance
    Lukx
    so --> win xp
    rdbms --> 10.2.0.4
    apex --> 4.0.2.00.07

    Hi lukx
    You will find additional information in the comments on my blog that will solve your problem.
    Also, my book contains an even better solution for this in chapter 10, page 334.
    Regards
    Mark
    demo: http://apex.oracle.com/pls/otn/f?p=200801 |
    blog: http://oracleinsights.blogspot.com |
    book: Oracle Application Express 4.0 with Ext JS

  • Installing Creative Cloud applications from shared windows folder.

    Hello.
    I got new laptop for work use and I am installing creative cloud on it. However laptop ain't that fast and I am wondering that would it be possible to install creative cloud applications from shared windows folder, since I have downloaded and installed all creative cloud applications on my desktop machine already and laptop is intented for working while not at home.rpr
    This would increase installing speed since all those needed files would be available from Local Area Network, which is faster and my broadband and it also would allow hard drive to focus on installing files instead of current simulataneous reading and writing to same hard drive.

    Hello.
    I got new laptop for work use and I am installing creative cloud on it. However laptop ain't that fast and I am wondering that would it be possible to install creative cloud applications from shared windows folder, since I have downloaded and installed all creative cloud applications on my desktop machine already and laptop is intented for working while not at home.rpr
    This would increase installing speed since all those needed files would be available from Local Area Network, which is faster and my broadband and it also would allow hard drive to focus on installing files instead of current simulataneous reading and writing to same hard drive.

  • CI/DB under Linux and AS under Windows - Possible?

    Hello all,
    I have an ECC6 running on Linux/Oracle.
    For some interface reason I need my production to communicate to a MS SQL Server Database - we found out that the best solution was to install a new Application Server under Windows.
    Is it feasable? If yes what are the constraints or does anyone can give me the procedure.
    Thanks for your time and your help.
    Regards,
    Mel

    hi melchior,
    Why not installing MS SQL on Windows Server and connect it to your SAP system without have to install SAP system on this Windows host ?
    It's possible to install SAP system on heterogent system. For UNIX/Linux and Windows system, you need to manage SAMBA service.
    ardhian
    http://ardhian.kioslinux.com
    http://sapbasis.wordpress.com

  • Can we implement iphone native application on microsoft windows machine

    Hey,
    Right now i m doing job and i want to work as a free lancer but i don't have mac machine at my home so i want to know that how can we develop iphone native application on Microsoft windows machine or not?.
    One friend is said that it is possible to work on Microsoft windows machine same like mac machine. he didn't tell me because he said that i take $125 for 1 hour so i rejected to pay this money.
    Now please anyone tell me that how can i work on windows.
    Thanks.
    Message was edited by: vavdiyaharesh

    You'll need XCode and the iPhone SDK to develop for the iPhone. These only run on Mac OS X, which is only officially supported on Mac hardware. I don't know of any solution to run XCode under any other OS.

  • Class controller Stage/Window reference

    Is there any way of getting the Stage/Window object of an FXML loaded file from the associated class controller?
    Particularly, I have a controller for a modal window and I need the Stage to close it.

    Hi!
    I have a parent FXML-file (no controller added) acting as main frame, which includes several other FXML-files. In one of those included FXML-files, I have added a controller.
    So, my setup looks a bit like this...
    -> Parent FXML
    --> include FXML-file1 + controller attached
    --> ...
    --> include FXML-file5
    Inside that controller, I am trying to access now the stage object in a similar approach like described here. This is when i get the null pointer exception....
    public class FXMLfile1Controller {
    @FXML
    private Button ButtonXYZ;
    @FXML
    protected void ButtonXYZ_Action(ActionEvent event) {
    Stage stage = (Stage)ButtonXYZ.getScene().getWindow();
    stage.setIconified(true);
    // this doesnt work either....
    // stage.close();
    Can it be, that the stage-object in the controller is not the same as the stage of the parent/main FXML?

  • Stage.window Change ?

    Am I missing something? i cant get this to work anymore, I
    even have flash.display.stage and nativewindow imported.
    Worked fine in the last release. Has this been changed?
    Thanks,
    Stephan

    This is what I have in my Code:
    <mx:Image mouseDown="stage.window.startMove()" x="0"
    y="0" source="{main}" alpha="0.98"/>
    <mx:Button x="961" y="5" height="23" width="23"
    click="stage.window.close();" alpha="0.0"/>
    <mx:Button x="930" y="5" height="23" width="23"
    click="stage.window.minimize();" alpha="0.0"/>
    Im getting this as an error:
    Severity and Description Path Resource Location Creation Time
    Id
    1119: Access of possibly undefined property window through a
    reference with static type flash.display:Stage.
    Im at a loss.

Maybe you are looking for