Disabling the Close Button of JFrame or Frame

Dear Friends,
can anybody please help out to solve the problem i am having in disabling the close button of Jframe . Or try for hiding the close button from the screen
thanks kalyan

to disable the close button
myFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE)

Similar Messages

  • 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.

  • Disabling default close button in JFrame

    hi,
    in JFrame there are by default 'minimize', 'maximize' and 'close' button. is it possible to disable or not to show the 'close' button'
    regards,
    tom

    If you want to control the closing of the frame you can use
    frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE)If you are interested in listening whether this button was clicked (for example as an alternative to a "Close" button you can register a WindowListener and handle the windowClosing(...) event
    About disabling/hiding - maybe you will have to subclass the frame header UI class, which is L&F specific.
    HTH
    Mike

  • How to disable the maximise button of a awt Frame

    Hi guys..
    Is there any way to disable the maximise button of the awt Frame (Not JFrame). I have tried the
    setResizable(false), but that one is not solving my problem. Any code will highly be Appreciated.
    tks in advance
    Jameel
    My ids r
    [email protected]
    [email protected]

    i used setResizable and it disables theframes max button
    import java.awt.*;
    import java.awt.event.*;
    public class frame extends Frame
    public frame()
    setSize(200,200);
    setVisible(true);
    setResizable(false);
    public static void main(String a[])
    new frame();
    what do u really need

  • This is possible to hide the Close button in JFrame

    As title
    If can, please let me know how

    You can tell the frame not to decorate with JFrame.setFrameUndecorated() {or something like that,
    look it up in the API}, or you can specify your own decorations. I'm guessing that you really don't
    want to do either of those, though.

  • Disable the Close Key on Yoga 13

    I am looking for a way to disable the Close button (where F4 button is located) while still keeping the functionality of the FN keys.
    The Close button is incredibly annoying (not even really sure why it is needed) as whenever I go to increase sound using the volume up button, I sometimes end up pressing the Close Window button. Which obviously closes any window (Word Document, Web Browser, etc) that I have open.
    Is there any way to completely disable or swap the functionality of the button for something else?

    Added it to my patch, a long time ago, just for you:
    http://forums.lenovo.com/t5/Idea-Windows-based-Tablets-and/Who-wants-a-program-that-disables-the-tou...
    Look for the post with a lot of red.

  • 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 disable the minimize button on the JFrame?

    Does anyone know how to disable the "Minimize" button on the JFrame (Window)?

    Why bother using a JFrame at all? Just extend JDialog, and there won't be a minimize button to worry about at all. The only drawback is that a JDialog doesn't put an icon in the taskbar, so you have to move/close other windows until you can see the JDialog window on the desktop.
    The windowMinimized stuff doesn't let you stop what the window is doing -- you just get an event telling you what happened.

  • Maximise,minimise and close button of Jframe to be disabled

    Please help me out to to disable the close,maximise and minimise button of Jframe

    Use the
    setUndecorated(boolean ); method of JFrame
    or
    Use the Dialog
    or
    set resizable false

  • How to create a jframe which has only the close button

    hi
    i want to create a jframe which hold only the close button on the title bar. just like an JOptionPane.
    hussain52

    Well, if you are in a window's environment and using forte, you can go to sample forms, MDI, and then just highlight and delete what you don't want from the menubar.

  • JFrames with only the close button

    I have been writing a notepad as my first java project and have done most things but cant seem to fix this: coding a JFrame with only the close button. Most of us know that when you click Help > About... a window pops up describing the company that wrote the software.
    Please help....

    I have been writing a notepad as my first java
    project and have done most things but cant seem to
    fix this: coding a JFrame with only the close button.
    Most of us know that when you click Help > About... a
    window pops up describing the company that wrote the
    software.
    Please help....so whats the problem? you're asking if a person clicks on help->about then a description dialog box should pop up describing the company right? you can use JDialog or a popupmenu. look at the swing tutorial at sun

  • Remove the close button in upper right corner

    How do I remove the close button in the upper right corner?

    I'm trying to do the same thing. I discovered that it's not a Java limitation, but a look-and-feel limitation. You can use JFrame.setUndecorated(true) and JFrame.getRootPane().setWindowDecorationStyle(some_style_without_close_button), but this will only work if the current windowing system supports disabling native decorations (MS Windows does), and if the current look-and-feel supports window decorations. A quick test (in J2SE 1.4.2) shows that:
    Metal LAF -- supports
    Motif LAF -- does not support
    Windows LAF -- does not support
    Anyway this is not sufficient for me since I need to use the native look and feel on all systems.

  • Is it possible to change the size of the 'Close' button in Full Screen viewing mode?

    I am currently using Firefox for a kiosk type scenario. We require that the browser run full screen. The issue is that the 'Close' button is not large enough for users to consistently see, so they're having issues figuring out how to close an active browser window.
    Can anyone tell me if it's possible to change this icon? I've tried using themes, but they tend to theme everything but the close button.
    Custom configuration details are below.
    Firefox version: firefox-3.0.4-1.el5.centos
    Customisations:
    Access to local drives disabled:
    Modified the contents of /usr/lib/firefox-3.0.4/chrome/browser.jar, so that browser.js has the added stanza:
    <pre><nowiki>if (location.match(/^file:/) ||
    location.match(/^\//) ||
    location.match(/^resource:/) ||
    (!location.match(/^about:blank/) &&
    location.match(/^about:/))) {
    loadURI("about:blank");
    }</nowiki></pre>
    Various menus & bookmarks disabled in chrome/userChrome.css
    <pre><nowiki>/* Kill "normal" bookmark icons in the bookmarks menu */
    menuitem.bookmark-item > .menu-iconic-left {
    display: none;
    /* kill icons for bookmark folders in Bookmarks menu */
    menu.bookmark-item > .menu-iconic-left {
    display: none;
    /* kill icons for bookmark groups in Bookmarks menu */
    menuitem.bookmark-group > .menu-iconic-left {
    display: none;
    /* Remove the Edit and Help menus
    Id's for all toplevel menus:
    file-menu, edit-menu, view-menu, go-menu, bookmarks-menu, tools-menu, helpMenu */
    helpMenu { display: none !important; }
    tools-menu { display: none !important; }
    file-menu { display: none !important; }
    edit-menu { display: none !important; }
    view-menu { display: none !important; }
    go-menu { display: none !important; }
    bookmarks-menu { display: none !important; }
    #autohide-context { display: none !important;}
    #bookmarksToolbarFolderMenu { display: none !important;}
    #organizeBookmarksSeparator { display: none !important;}
    .tabbrowser-tabs .tab-icon {
    display: none;
    #urlbar {
    font-family: Arial !important;
    color: Black !important;
    font-size: 26 !important; }</nowiki></pre>

    Try code like this:
    <pre><nowiki>#window-controls .toolbarbutton-icon {
    width: 25px !important;
    height: 25px !important;
    </nowiki></pre>
    The three buttons have these IDs:
    <pre><nowiki>#minimize-button
    #restore-button
    #close-button</nowiki></pre>

  • Is there a Way to lock apps or disable the home button?

    I often allow my 16 month old to play toddler games on my iPhone. He knows how to slide his finger to unlock the phone and he loves pressing and holding the home button to activate Siri so he can talk to her! LOL! I am worried that he will accidently delete or move an app to another screen by accident so is there a way to prevent that from happening. Also while he plays his games, he likes to press the home button which closes him out of his game. Is there a way to disable the home button so he can just stay within his toddler games?

    You can use Guide Access to restrict your child to using a single app. See:
    http://support.apple.com/kb/HT5509
    Regards.

  • I am using a Microsoft Natural keyboard and when i use the close button on Ver. 5.0 or newer it closes the whole screen not just the active tab is there a fix for this

    I am using a Microsoft Natural 4000 Keyboard
    IF I update to Mozila 5.0 when i use the close button it shuts down the whole browser nut just the active tab
    Is there a workaround for this because I like the close button feature

    Could you try disabling graphics hardware acceleration? (I'm having trouble determining from your "More system information" whether it's enabled or disabled.) Since this feature was added to Firefox, it has gradually improved, but there still are a few glitches.
    You usually need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    orange Firefox button ''or'' classic Tools menu > Options > Advanced
    On the "General" mini-tab, uncheck the box for "Use hardware acceleration when available"
    If you restart Firefox, is the issue resolved?

Maybe you are looking for

  • How to open a Poplist

    Hi Experts, I am working in Oracle 10g. I have a doubt regarding the poplist in oracle forms. My Question is, How to open and close a poplist through keyboard when a cursor navigates to an item? If tab or enter key is pressed the cursor goes to the n

  • How to install hp laserjet 1020 on windows xp

    sir, i want to install hp laserjet printer on windows xp. it is displaying an error message "inappropriate invocation.unable to start application". plz tell me what to do and how...

  • Change the Apple ID for a game and not lose the progress made?

    Short version of my question: can I change the apple id associated with a game to another one and not lose the progress made in the game thus far? Long version: when there were only a few iGadgets in the house, all games and music were downloaded thr

  • Is it possible to share a backup with different generations of iPod touch?

    For example, if I bought a new iPod touch 3rd generation and I want to put the backup of my old iPod touch 2nd generation. Is this possible?

  • Best Practice for Enterprise Application Integration

    I would like to integrate a few corporate systems together by using Oracle Fusion Middleware. I suppose the integrated process is running in synchronous mode such that it also supports two phase commit. In BPEL Process manager, there is a tool called