How to mark window close button as "unsaved"?

Using SWT, you can change the main window quit/close icon/button (in upper left corner of title bar) to indicate that the file/whatever of the application has not been saved. The code to do that in SWT is something like this -
Shell shell = new Shell(new Display(), SWT.CLOSE | SWT.TITLE | SWT.BORDER | SWT.MIN);
shell.setModified(true);
Is this feature available in Java FX 2.2? If not, has there been a bug/request filed for it?

I had a question going in the same direction: "Is there any way to disable the close button in a decorated stage?" but from your answer to the previous question, I guess this is not possible... could you please confirm this? A workaround would be to set an event handler to consume the window close event. Looks like I'll need to go that way. Or could you suggest a better way?I don't think it's possible with to disable the button in JavaFX 2.2 - if you did, it would provide an inconsistent native windowing experience for the user anyway as I've never seen a close button on a Windows 7 app disabled.
However, as you point out, you can capture (and handle or ignore) the events if generated. You can do this by setting an onCloseRequest event handler for the window and calling event.consume() in the handler. (relevant javadoc comment):
https://docs.oracle.com/javafx/2/api/javafx/stage/Window.html#setOnCloseRequest%28javafx.event.EventHandler%29
Called when there is an external request to close this Window. The installed event handler can prevent window closing by consuming the received event.------
You could check out my related answer at StackOverflow: http://stackoverflow.com/questions/12874664/javafx-entirely-customized-windows, for some other thoughts on this on customizing decorated and undecorated windows, but I think most has already been said in this thread.

Similar Messages

  • How to add a close button to a edge animation ?

    How to add a close button to a edge animation ?

    Welcome to our community, Laurie
    You posted this in the FlashHelp section. Is that your actual
    output type? If so, you will need to make edits to the FlashHelp
    using Adobe Flash.
    Cheers... Rick

  • How to detect window close event and do some task before exiting

    Hi 
    Anyone knows how to detect window close event and do some task before exiting ?
    Sridhar
    Solved!
    Go to Solution.
    Attachments:
    window close event.JPG ‏34 KB

    Yes .You can discard the panel close event by passing "TRUE" boolean value to the "discard ?" terminal which is lied in the right side of that panel close(filter) event.& It will work in executables.  See attached picture.
    Attachments:
    Panel Close.JPG ‏12 KB

  • Disable/enable window close button?

    I have a new Window() open and I want to disable the close button when the window has already been opened. Does anyone know how to do this in Flex?

    Ok I got, it's an AIR app.
    You can listen to event Closing and preventDefault on it. Check this:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           closing="closingHandler(event)">
    <fx:Script>
                <![CDATA[
                    protected function closingHandler(event:Event):void
                        if(!forceClose.selected)
                                event.preventDefault();
                ]]>
    </fx:Script>
    <s:CheckBox id="forceClose" label="Force close" />
    </s:WindowedApplication>
    Regards,
    Pablo Souza

  • Popup window - Close button

    Hi,
    We have a requirement to disable/hide the standard close button present in the Internet Explorer while opening a popup window (the X icon present in the top right section of internet explorer window) . Any pointers on how to achieve this would be really helpful.
    Thanks in advance.

    I don't think it is possible to hide X of any window, as it is default feature of explorer by MSDN.
    --Mukul                                                                                                                                                                                                                                               

  • How to Hide FPM Close button

    Hi,
    I have created one FPM application. When that application is called from portal, an aditional button 'CLOSE' is appearing.
    I did not put that button to FPM application and when I test the application from R/3, the button is not appearing. But it appears on portal. How hide this close button ?
    (I have also posted the same message to FPM Forum.)
    Thanks in advance..
    Vikrant

    Hi,
    1 Open WDC FPM_GAF_COMPONENT.
    2 Go to Web Dynpro Application -> <Application> -> Applic. Configurations.
    3 Copy <Aplication config> to some u2018Zu2019 Application Configuration name and save as local object.
    4 Open that application in admin mode and copy the URL.
    5 Add that copied URL to some role so that it can be displayed in Portal or NWBC by taking care of parameter u2018sap-config-        mode=Xu2019 must be in URL.
    6 Open that application in Portal or in NWBC.
    7 Right click in Contextual navigation area.
    8 Select u2018Setting for Current Configurationu2019.
    9 Here set the u2018Closeu2019 button visibility as u2018INVISIBLEu2019

  • Disabling windows close button in dialog

    Hi,
    I am using Jdev 10.1.3.x(10g)
    I am opening a dialog pop up for a functionality. What i want is to force user to use cancel button provided inside dialog to come out of it and want user to not to use windows cance X button.
    Is there any way by which i can hide the title bar or disable the close button or on click of widow close i actually click on cancel button throgh java script?
    Main concern is i am passing some data from parent to dialog throgh process scope and i want to clear it on cancel. In my application there are many popup dialog which may lead to memeory issue so i seek solution to clear this data once it is not desired any more.
    Also i tried Request object to pass the data but in popup it is not recognised.
    Suggestion in any direction will be helpful.
    Regards,
    Kevin Chheda

    Hi,
    answering this question for 10.1.3 since 11g is different and provides a af:dialog component to handle this case. In 10.1.3 the window you open is an external browser window. You cannot disable the close button here because it is part of the browser window that JavaScript cannot control
    Frank

  • How to handle Window Close in OA Framework

    Hi All,
    In one of my application I am opening a PG into new window. Now after doing some selection i want to pass soem variable into main page and close the other page that i have opened in new window.
    Please let me know how can I handle this window.close() in OA framework.?
    Thanks
    Debashree

    Truely speaking, i could not get the answer to this even when i was in Oracle, I think the primary reason would be that the memory footprint of the page would increase with js usage, another reason could be that FWK itself uses some js and they dont want user defined js to interfere with OAF defined usage.
    For Debasree's query, yes, you can do it technically using javascript, but not recommended.
    Thanks
    Tapash

  • How to show "window close" link in the page.

    "window close" link is the standard link in the EBS.
    But how can I show it in the EBS page? Thanks.

    Hello Peter,
    Thanks for your reply! That maybe is one solution. I think I used wrong terms to define the problem. But what I really ment, was that how to define links directly to portlet application (through portal of course) not just to portal page. I didn't find help from the HttpPortletRendererUtil class.
    I try to explain the problem more clearly:
    I have an portlet application that have main page (jsp page). The main page contains different 'areas' that are implemented by an iframes.
    For example there is a result area (iframe) and browser area (second iframe). The user can browse the results forward and backward. When user clicks one of the browser links the results are seen in result area.
    Ok this works fine when the application is 'ordinary' (not portlet), but when this is adapted to a portal as a portlet (through web provider) and I have to define the source to iframe (I use HttpPortletRendererUtil class's helper method to define links) I have only option to define the portal page link and that's why there comes additional page banners/headers to the result 'area' of the main page.
    Hope this is better explained. But if it isn't, please be free to ask more...
    Regards, Robert

  • How to make a close button in Captivate 5

    I am using Captivate 5 and trying to create a close button. I have found this Creating a Close Demo Button in Adobe Captivate, however when I follow it I don't have the '...' button to input my javascript.
    Any advice would be great.
    Thanks.

    Hi There,
    Click on the "Script_Window" to add the Java Script. The above Demo is for Captivate 4 i believe and has been replaced with "Script_Window" in the later version.
    Regards,
    Mayank

  • How to disable the close button(Cross) on a dialog

    Hi,
    Is there a way to disable the close button (cross on the right top of the dialog) on a dialog.
    Thank you

    Since your posting in the swing project forum, I assume your talking about JDialog. If so, use JDialog.setDefaultCloseOperation( DO_NOTHING_ON_CLOSE ). Same method exists in JFrame as well, but not in JWindow.

  • How to make standard Close button (X) invisible in HTMLB Tray element ?

    As in the topic. I don't want to see the Close button in the tray.
    Just minimize button, or even better, no buttons at all in the title bar.

    just remove the
    onRemove = "xxxx" attribute from the htmlb:tray in your layout. this will not remove the minimize button.
    Raja

  • HT2492 how to add the close button icon on the internet tabs

    i dont know what happened but if i want to close the new tab i entered from the safari i still have to do the long process instead of just clicking the "x" button to close it,., it disappeared last night and i dont know how to put it back,., prolly i accidentally press an icon to detached it from the tool. how will i restore it?

    Since your posting in the swing project forum, I assume your talking about JDialog. If so, use JDialog.setDefaultCloseOperation( DO_NOTHING_ON_CLOSE ). Same method exists in JFrame as well, but not in JWindow.

  • How Get Quicktime Window Zoom Button to Function Properly?

    A newly opened Quicktime window won't expand when I click on the window's green toggle button in the upper left corner. But if I first expand the window by dragging its corner, I can then toggle between the new and original sizes.
    How can I get my green button to perform properly for Quicktime (it works fine for other apps)?

    Yes, the keys you suggested work. Thank you. So I guess my question has become borderline academic.
    But I'm still bothered by the initial inertness of the green button, which works as designed ONLY following the first MANUAL size change after the file has been opened. Same behavior whether that first size change was made by dragging or by the Command 1,2,3 or Command F keys.
    Is there maybe a Quicktime system file that's been corrupted that I could reinstall?

  • Safari 3.0.4 window close button and Command W not working

    Just upgraded to 10.4.11 and Safari 3.0.4, now I cannot close any Safari windows either by the Red button or command W. I am running a Powerbook G4. I had the same problem with previous beta versions of Safari.

    I was also experiencing this problem, and removing the library/input managers/SIMBL fixed it. But I dug a bit deeper, and found out that SIMBL looks in library/application support/SIMBL/plugins. I found a file in there called Taboo dated 5/8/2005 and removed it. Problem solved, even with the SIMBL files in the input managers folder.
    Hope this helps.
    Paul

Maybe you are looking for

  • Logon to SAP system failed

    my system logon failed . i am not able to logon to my ides system. server is starting but while logging into the system by using user name and passward the following error is coming user account not in validity date some other information is also ava

  • How to simplify a cumbersome workflow?

    Nearly everyday I need to update 5 large .html pages, each currently around 1.5 MB. The work involved to get these pages published is cumbersome to say the least and time consuming. I'm looking for tips or suggestions on ways to achieve this more eas

  • Problem accessing iTunes for apps with new iPad

    New iPad connects to and works fine with home wifi except when trying to download apps. Then I get message that I cannot connect to iTunes. Don't have this problem when using public wifi.

  • Function Module to get Last date of previous year

    Is there any function module to get the Last date of the previous year. e.g, if i give date as 03/02/2009 the output  should be 31/12/2008.

  • Where is the shopping button I had on the last version

    I have just downloaded the new version....where is the shopping button I had on the previous version ? How can I go back to the previous version ??