Turn off close window icon

Does anybody know how to disable the X in a JDialog so that it cannot be closed by the user? How do I do that? I see a setDefaultLookAndFeelDecorated(boolean) on JDialog and could set that to false but then what would I do?
thanks,
dean

Err...
On my computer, JDialog doesn't have window minimizing, maximizing or closing icons in the upper right corner of the dialog box itself. Did you mean that you don't want people to be able to close the parent (or application) window whenever there is a dialog box being displayed?
For example, you cannot close the web browser by clicking on the "X" if there is a dialog box present?
In which case you want the dialog box to be modal. That means the user cannot send any input whatsoever to any other window within the application - the dialog box commands focus and will not give it up until you click the YES, NO, or CANCEL buttons for example.
By default, JDialog() is not modal. Certain JOptionPanes such as JOptionPane.showMessageDialog(), are modal. However, making things even more confusing, showMessageDialog() extends JDialog. If you ask that it extend JInternalFrame instead, the result is non-modal by default.
Anyway, look at the examples within:
http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html
Depending on what you are trying to do within your application, it may be easier to just simply switch the JComponent from JDialog to JOptionPane.showMessageDialog() or another option. If not, there is a section in there on dealing with window closing events.

Similar Messages

  • Open a pdf or a doc with close window icon

    I am opening pdf or doc file in the url which opens up in the browser window. To make it user friendly, we want to put close window icon or button in the browser window.
    Note: we are not in favor of using frames as we not using in any pages.
    Thanks for your input.

    Hello!
    Can you post me example to open pdf file using browser..?
    Thanks..

  • Coding to allow the X (Close Window icon) to close a window.

    I have coded a number of Modal screens called from a main screen.  I can't seem to find what allows the windows Close Window icon (X) to close the screen.  The user must hit my exit button to leave, and I want to keep that as an option, but also allow the X to close the window and be able to handle it in my User Command module.
    Thanks in advance

    Hi Paul,
    First set the PF-status with CANCEL and activate it
    for the model screen.
    in PAI.
    module leave_screen.
    in program
    case ok_code
    when 'CANCEL'.
    leave to screen 0.
    endcase.
    Best Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Dec 23, 2008 11:06 AM

  • Turn off BlackBerry Messenger icon

    I would like to continue to use the Blackberry Pin Messenger, but would like to know how to turn off the messenger icon. My intent is to check the Messenger when I would like, without the icon appearing on the screen. this as a privacy issue. help is greatly appreciated.

    Are you referring to the message preview on the external display or the new message icon that appears on the inside display?

  • Best Practice - IPv6 Turn Off? Windows 2008 (and R2) Servers

    Hi,
    I work for a large organization.  We have close to 10,000 servers globally.  A question has come up if we should disable IPv6 on our Windows 2008 servers.  Our network is not yet capable of using IPv6.
    It seems like you have to go out of your way to disable IPv6; therefore, I would assume that it is best to leave IPv6 turned on.
    Does anyone have any thoughts about this.  It would be most helpful to have links to pros/cons - best practice.
    Thank you.

    No, do not disable IPv6. There is no reason to do so unless you have a very specific application issue which is highly unlikely (although there are a few documented ones out there).
    http://blogs.technet.com/b/ipv6/archive/2007/11/08/disabling-ipv6-doesn-t-help.aspx
    http://blogs.technet.com/b/jlosey/archive/2011/02/02/why-you-should-leave-ipv6-alone.aspx
    Jason | http://myitforum.com/cs2/blogs/jsandys | Twitter @JasonSandys
    Whoever marked this as an "answer" obviously doesn't remember that bad-old-days of "Everything's on by default! It just works!!" and the billions of dollars in lost productivity that ensued from the hundreds (thousands?) of exploits that followed this
    painfully short-sighted decision. You'd think Microsoft would have learned their lesson from the "IIS is on by default!" debacle, but that doesn't seem to be the case.
    Best practices for system administration say "turn off the services and protocols you don't use." As such,
    IPv6 should ALWAYS be disabled on servers and business workstations if you're not currently using it, just like any other protocol or service you haven't implemented or aren't using. Not using FTP? Don't install or enable
    an FTP server. Not using IPv6? Why would you have IPv6 enabled? Just because IPv6 is the newest, shiniest thing on the block doesn't mean you have to use, and it definitely shouldn't require you to start hacking about in the registry to turn it off.
    The only exception to this rule would be laptops or mobile devices where the user might (conceivably) take them into an IPv6 environment. Even then, though, you have to balance the "convenience" of not having to switch-on IPv6 against the risk that
    your unconfigured IPv6 stack might be exploitable by nefarious patries. Even so, the fact that almost nobody has switched their internal networks to IPv6 means that turning it off on laptops is still probably a "good idea." 
    For example, my laptop wireless interface might make sense to leave IPv6 enabled--I don't have any idea when I'll walk into an environment that uses IPv6 and want to use my wireless. But in the office when I'm hard-connected? We don't use IPv6 so it needs
    to be "off." Even if it's just a bit of code in the Windows firewall that can be used to say "just reject IPv6 traffic on x interface" is still a big improvement. An absolute home-run would be the addition of logic that allows Windows to dynamically disable
    IPv6 when there aren't any NICs or WNICs that are allowed to use it.
    Finally, none of this should be construed to mean I'm advising against implementing IPv6, because I'm not. However, like any major technology project you should plan carefully, making sure you understand ALL of the consequences (not just the marketing hype,)
    and making sure you'll be able to administer the changed environment as well as your administer the current one. You definitely should not let a vendor (of all things) force the decision to use it upon you because it's "on by default."

  • Screens do not turn back on after being turned off by windows power saving

    I have Windows 7 on my T410 set to turn off my monitors (I use a docking station) after 15 minutes of inactivity.
    The problem is that when I come back to the computer, I cannot get the monitors to come back on.  They actually turn on, but remain blank.  No matter what I do they won't come on.  This happens every time.
    I have found that if I close the lid and make it go to standby mode, and then open and come out of standby, it will SOMETIMES make the screens show a picture.
    What is also weird is that when I open the lid, sometimes Windows will ask me for my password, and then after I enter it, the screens will go blank again.  So I have to keep going to standby 2 or 3 times till it works.
    This happened both on the Lenovo version of Windows 7 and my own clean version of windows 7 that I installed.
    Any ideas?

    For the time being I think I'm just going to plug my modem directly into the ethernet port. I can't stand that this ******** is happening with a brand new iMac when I just got done dealing with a fried iMac G5. Is Apple ever going to make another iMac that doesn't have something wrong with it?
    If anyone knows of any fixes or other helpful information I would greatly appreciate it.

  • How do you turn off a Windows 8 computer?

    I set up my new computer afew days ago, and when I went to turn it off, there was no place to do it. I was about to give up and just hit the power button when I found something that said I should just hit the power button. I did, and it turned off, sort of. If I just push the button quickly, it reboots itself. If I hold it a little longer, it turns off. The screen goes dark, says "no signal" and it seems to be off, except that every few seconds the power button flashes. Sometimes when I come back the next morning, it is on and sometimes it is off. 
    I don't trust it, so I disconnect it from the internet, physically. It's probably not a good idea to leave unsupervised computers connected to the internet. No telling what they will do.
    Is it off even when it is flashing? Is there a certain way you should hold your mouth when pushing the off button? 
    Windows 8 doesn't seem to be as bad as some people say, it's just that so many things are different from XP, but once you learn them it's ok. Of course, I don't do anything fancy, so once I can get my browser up, find my files and find my programs, (which are apparently called apps now) I'm fine.
    This question was solved.
    View Solution.

    Hi,
    Please try:
    (a) Hold down Win key and Press I
    (b) Turn off it using the power icon on the right of the screen
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Turn OFF 'gliding' windows?

    I believe Apple added this 'feature' since Panther (maybe even earlier) but I've finally had more than enough of it.
    Is there anyway in Terminal (or wherever) to prevent the windows from moving when dragging/dropping files/folder to a partially exposed window?
    I ask this because of the numerous times over the years that I have had to end up doing a search for the file/folder I just dragged/dropped because the window slid into full view and I released the mouse button on the wrong folder after the window moved.
    Please don't tell me to wait for the window to stop moving before I release the mouse button... I know that and try to remember to do that which is why I have put up with it for years. But occasionally I forget and it then becomes a pain not being able to find a file/folder that I 'know' should be in a folder.
    And even if you wait for the partially visible window to slide into full view before you release your mouse button you still then have the window moved and often in the way.
    Apple really needs to make this 'feature' optional so it can be turned off easily.
    Thanks for anyone with advice as to how to turn this off... no matter what I have to do to accomplish this. (With the exception of course of going back to Classic or using a PC.)
    Using OS X 10.5.2

    Devin,
    Unbelievable!
    You're absolutely right, but I was so certain that Apple could not be some dumb as to have 'rolled' this new feature (since OS X) into the long-standing pre-existing feature of Spring-Loaded folders that's existed waaay back into many versions of Classic that I didn't even bother giving it a try before posting.
    Incredible! Especially now that the Spacebar is used as a shortcut for QuickLook and if you hit it a little too soon all that you get is a QL of a generic folder icon.
    But then... Apple it appears 'knows best' and we shouldn't be able to specifically disable ONLY that feature without also disabling a long time feature "Spring-Loaded Folders."
    Then of course no one needs to be able to disable Spotlight easily either (before it was finally fixed in 10.5.2).
    Thanks Devin for posting. Though now I see I won't be disabling it since the Spacebar is now something I'm using so often with QuickLook.

  • Why not turn off restore windows?

    I really don't like the restore windows feature.  I want my computer to only open to the desktop. But one site I saw disabling it is "overkill" and suggests downloading a third party app that lets you at least select which app windows to open or not.  What advantage am I missing out on by turning it off altogether?

    What are you missing out on? It is one of the over 250 new features of the World's Most Advanced Operating System called Resume.
    When choosing Restart, Sleep or Shutdown there is a checkbox you can uncheck to prevent the apps from launching.
    Also in System Preferences > General there is a hard-to-find checkbox under "Number of recent items" you can turn off.
    Also, you can hold the shift key to disable resume on a one time basis.
    If you want to turn it off on a per app basis, (TextEdit is by example, replace TextEdit with the name of the app)
    Launch Terminal and copy/paste this at the prompt...
    defaults write com.apple.TextEdit NSQuitAlwaysKeepsWindows -bool false
    Press return.
    To turn off Resume globally...
    chflags uchg ~/Library/"Saved Application State"
    Press return
    The reverse of the first one is to replace false with true.
    The reverse of the second one is
    chflags nouchg ~/Library/"Saved Application State"

  • 3GS turning off when Camera Icon clicked

    Whenever I click onto my Camera Icon.... my 3GS turns off :-/
    i've just put the 5.0 on it but bought it 2nd hand, I got told it was working fine apart from the Vibrate which is fine,
    i've just set it all up now but when I click the Camera, it just turns off,
    why? and how can I fix it?

    Thanks for the response.
    I am on the latest itunes offers me. The apps are all up to date.
    I do clear the multitask bar often and this will happen regardless of whether there are 10 apps running or just the one. It will still crash and the battery will still be at least 30% or more.

  • W530's Optical Drive Turns off Running Windows 8

    With Win8 on W530 , the optical drive powers off soon after boot. Device management bogs down after this. Accessory optical drive and a UJ-260 do the same thing.
    BIOS 2.52 and 2.53: same problem. Main board has Intel RAID option ROM.
    Running Windows 7, the optical drive stays on with no issues.
    Would like to hear if there's a fix before restoring Windows 8. Win7 good for now.
    What's on your Thinkpad? T42 2379-R9U, T61 6460-DWU, W530 2436
    Solved!
    Go to Solution.

    Try this: http://techdows.com/2011/09/windows-8-turns-off-power-to-optical-drive-when-there-is-no-media.html
    W520: i7-2720QM, Q2000M at 1080/688/1376, 21GB RAM, 500GB + 750GB HDD, FHD screen
    X61T: L7500, 3GB RAM, 500GB HDD, XGA screen, Ultrabase
    Y3P: 5Y70, 8GB RAM, 256GB SSD, QHD+ screen

  • Turning off slideshow (flower icon) on the lock screen

    Hi,
    I have been unsuccessful in trying to figure out how to turn off the sideshow button that appears on the lock screen (the flower icon) when I have pictures on my ipad. I don't like how someone can access my pictures without having to unlock the ipad.
    Anyone have any ideas?
    thanks
    Eli

    There is an option in Settings > General > Passcode Lock as to whether to have the Picture Frame icon enabled. Not sure whether this applies to all iOS versions.

  • Ipod Nano , wont turn off ,displaying "charging" icon instead

    Hey y'all
    ive been using this ipod nano for a while now,no problems
    recently updated it to the newest firmware
    anyhow it doesnt turn off now,instead when the stop button is pressed for a few seconds,the screen goes blank then the "charging" icon appears even when the ipod is disconnected
    also,when the ipod is working the battery meter doesnt show,
    and the "charging" icon is displayed instead
    i tried restoring the ipod a few times,no effect
    any ideas?

    Hi, my ipod nano has exactly the same problem---won't turn off, shows the big charging icon instead, even after resetting it many times, and successfully restoring/updating the firmware to v1.2. It plays music fine, but it won't shut off.
    What ever happened at repair shop, did they say what is wrong? Maybe I have to send mine to a repair shop too.
    Thanks
    Ipod Nano    

  • Turn off floating windows

    How do I turn off the floating command windows in 10.5.8?
    Thank you

    HI,
    Macworld published a terminal command that stopped all help windows from being floating windows.
    Do you mean if you clicked on another window the "floater" would move behind?
    Carolyn

  • Satellite P100 - 429 A3 Turning off when windows loads

    Heya. This is a serious problem that has rendered my Notebook unusable. I was just wondering if anyone knows what it is.
    I was in a source game when it happened for the first time, I jumped in the game and the laptop just cut out. No shutting down, it just turned straight off as if someone had held the power button. I stared at it for a minute then powered it back on. It seemed to go fine, I thought it was just an odd hiccup, but then after it had finished the windows loading screen, it did exactly the same thing. Now every time I start up, it get's past the loading screen and sometimes it get's to the Welcome message, soemtimes before the cursor is even loaded it will turn off in the same mannor.
    The only things I have recently changed is the BIOS (which is my obvious suspicion.) I was just browsing the Toshiba website drivers page and I found a BIOS update for my Notbook cliaming that it had been improved. So I downloaded and installed it, once the installation had done it's job the Notebook restarted, but on first run Windows bluescreened before it had even loaded. Then after that it was working fine until now.
    I also tried to use a Windows disk to do a recovery of windows. However, the recovery console caused the same thing. Within a few seconds of initializing, the computer just cut out.
    If anyone has a clue what's goind on, please let me know.
    Sorry for any typos, I'm not on a familiar keyboard.
    Thanks again.
    Wolfy

    > I jumped in the game and the laptop just cut out. No shutting down, it just turned straight off as if someone had held the power button.
    Well, this sounds like an overheating issue. Fact is that all internal devices run with a full performance during the game playing. This leads to a high temperature inside the notebook. If your ventilators are not free due to the dust and debris then the notebook will shouts down to prevent the hardware from damage.
    In such cases the fan cleaning is necessary and advisable.
    I have had a similar issue on my notebook and solved it using an compressed air spray!
    In my knowledge the Sat P100-429 belongs to the PSPA3 series.
    You should really be 100% sure that you use the right BIOS.
    However, its also possible that the notebooks hardware malfunctions.
    In such case the hardware check is needed. Such test can be done by an authorized service provider in your country.
    Good luck

Maybe you are looking for

  • OIM 11.1.1.5.0 + BP03 Integration with BI Publisher 11.1.1.5.0

    Folks, Has anyone been successful in integrating BIP 11.1.1.5.0 with OIM 11g? I have recently integrated BIP 11g with OIM11g for reporting. After doing all the necessary configurations as mentioned in the OIM 11g developers guide and BP03 read me doc

  • PI 7.1 high availability - adapter framework error

    Hello, I've Configured PI 7.1 with SLD and getting error in RWB: Message: Cannot construct URL for runtime check using entries in SLD for component af.xip.hfabwsappxdb; correct the entries in SLD Stacktrace: com.sap.aii.rwb.exceptions.OperationFailed

  • Data/field line item / PO item level

    Hello, I would like to know which field I could use at SC item level to store a reference number for each line item. This reference number should also be transfered to the PO line item in the backend. Regards, Lina Edited by: lina shaiek on Nov 7, 20

  • Accessing Smart Albums in finder

    Hi, I have created a number of Smart Albums in iphoto11, containing photos I wish to use in a digital photo book (created with 3rd party software, not iphoto). Is there any way I can direct the photobook software to the folders containing the smart a

  • TS1286 Hello All, I am using a PC and have an iphone - has anyone gotten the error message when sync'g itunes Ox800000A?

    Hello All, I have lost the ability to connect to itunes to update software and apps etc., My PC is giving me an error message of Ox800000A - apple says it may be a USB port problem. Has anyone else received this error problem and if so did you fix it