Disable the "ALT + F4" in my frame

how can i disabled the "ALt + F4" funcionallity in my frame?
I have the keyListener and when i get the "Alt + F4" key, my application dies.
thanks

Pressing Alt+F4 is the same than closing the window with the "x" widget.
By default, Swing JFrames hide themselves when they are closed.
There are two ways to change this behaviour, one inherited from AWT Frames (adding a WindowListener) and one new to JFrames (using setDefaultCloseOperation).
I don't think you can distinguish close operations initiated by the keyboard from those initiated by the widget.

Similar Messages

  • How can I enable/disable the transmission of a can frame? (filter etc...)

    Hello,
    I use the CAN
    Transmit-periodic.vi in LV 8.5, I want to enable or disable the
    transmission of a frame without stop the loop of my VI, does it exist
    in the frame api a vi which could stop, or mask the transmission of a
    frame?
    It's important I don't want to stop my VI that
    send my frame just filter a frame that I don't want send on my CAN
    bus...(I would command it with a boolean for example).
    Thank you.
    Bye.

    Hi there
    I'm not familiar with NI-CAN, but take a look at
    \vi.lib\Nican\nican.llb\ncAction.vi
    Can be found in the CAN\Frame API\Advanced palette.
    Start Transitions the CAN object from stopped (idle) state to started (running) state. If the CAN object is already started, this operation has no effect.
    Stop Stops the CAN Object. For example, if the CAN Object is configured to transmit data frames periodically, this action stops the periodic transmissions. This action will also clear all entries from the read queue.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Need way to disable the Alt-Space menu

    We are using xulrunner with a some kiosk software. The kiosk software does not trap the Alt-Space. Does xulrunner provide a configuration option to disable or remap the alt-space to prevent the user from being able to minimize or close the browser?

    Mr Green wrote:Alt-f4 closes windows not sure what Window Manager you are using in Gnome for example you could edit keyboard shortcut
    I am using metacity. I wonder if there is a app specific way.  I don't want to disable all alt-f4.
    In fedora with metacity and their QEMU, alt-f4 will only close window in guest not the host window.

  • How can I disable the alt-menu shortcuts

    I'd like to disable the menu-key shortcuts (alt+h, alt+f, alt+b, etc).
    They are interfering with vimperator. How can I turn them off?

    I don't think that you can disable those shortcuts.
    You may be able to change the modifier that is used.
    *http://kb.mozillazine.org/ui.key.chromeAccess
    *http://kb.mozillazine.org/ui.key.contentAccess

  • How do I disable the alt key function?

    I have tried to clean my alt key on my macbook keyboard and now my macbook is acting like the key is hold down all the time eventhough it's not. Have tried to play around with the key, but its still the same. I wonder if I can disable the functions of the alt key in the mac os?

    you can do it system preferences->keyboard and mouse->keyboard->modifier keys. set "option" to no action. however, option is really a pretty useful key so you might consider trying to fix you keyboard.

  • Disable the alt key?

    Hi everyone,
    As my name suggests, I am a student who is not a techie so please excuse me if I make any mistakes, and I would like to mention that any kind of re - coding would be useless because I am hopeless
    with computers.
    I recently had a friend come over, we are working on a school project together. I'd gone to get us some drinks and I came back upstairs and he was mucking about with the keys on my laptop. A few minutes later I tried to go into bookmarks (on Mozilla Firefox)
    and the bars weren't there (file, edit, view, history, bookmarks, tools, help) and he'd told me to press alt. I did and they re - appeared. Phew. But when I click off anywhere on the screen, the bars disappear
    yet again. It wasn't like that before, and yes, I am certainly sure. Now I have to press the ALT key every time I want to use any of the bars; and while it doesn't render my laptop useless, it is rather annoying.
    I am using Windows 8.1 on a Lenovo G505.
    P.S. Sorry if I chose the wrong forum, as I say, I have no understanding of most of the forums' meanings & what they're for.
    Hope someone can help,
    Thanks for reading.

    You posted to the VB Developer's forum - definitely not the right place.
    It sounds like the problem is related to Firefox options, so you might try a Firefox forum.  If the problem is occurring in every program (not just Firefox) then it may be a Windows8 Setting and you could visit a Windows 8 forum.  Either way, it
    definitely won't be any of the forums here at MSDN.
    Sorry about that; moving this to off-topic.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

  • Disable "ALT + VK_TAB" in my frame

    how can i disabled the "ALT + VK_TAB" , and the "ALT + "VK_ESCAPE " funcionallity in my frame?
    I have the keyListener, but doesn't get these keys and my application loses the focus.
    thanks.

    Ugly way.
    You put a WindowListener to your Frame. In the windowDeactivated() callback method call toFront() on the frame.
    Kurta

  • Disable close opearion(X) on the title bar of a frame.

    Hai,
    I need to disable the close operation on the title bar of the frame.
    Can anyone give me the solution.
    Thanks
    SmartStar.

    hai,
    the code given is allowing me not to colse the frame, but it is not displaying the frame with the size i had given in the setSize().
    I need a code to achive a task such that, even after i click on the close on the title bar, it should not perform any function and display the frame as it is. with out any resizing.

  • CS4 - Is it possible to disable the application frame?

    I have been cursing and hating the application frame in Windows for the last month, but now I get my hands on the Mac version, I'm discovering my days of cursing have only just begun it seems.
    In the Mac version of InDesign/Photoshop/Illustrator they at least provided a way to disable the application frame, but I'm not seeing the same thing in Flash.
    Am I blind or did they truly not include the option?!
    Options for people that want them are fine. Universal decisions that some company knows better how to do UI for an app than the primary OS it is running in make me want to set a UI engineer on fire.

    Hello,
    >> I need to disable the export button/functionality in a customer's apex installation (3.2.1) as part of the security measures.
    >> this need applies for both development and production enviroments although if a solution is available, it will be first tried in the development enviroment.
    I agree with Tyler, this is indeed a really strange request. If your customer can’t rely on his developers, I would say you have a problem. I’m saying it because disabling the export button, even if it’s possible, doesn’t really give you any kind of protection. A malicious developer can still export APEX application using the Java utility APEXExport; it can be done with SQL Developer; it can also be done on a page level, and I only named the documented options.
    I don’t think this type of action should be considered for a development environment. Of course, the production environment is a completely different ball game. You can use the APEX run-time only environment, and by that neutralize most of the developer related “risks”.
    Just my 2 ¢,
    Arie.

  • Can I disable the audio pitch adjustment when using frame rate conversion?

    We have a mov file containing digitized film material with audio scanned at 25 fps (1 frame film for 1 frame video) while the film should be 18 fps.
    So both video and audio are too fast.
    Compressor provides the framerate conversion so source plays at x frames per second.
    This works well for video but the audio slowed down remains the pitch it has in the original speed. A great feature but an unwanted result in this case.
    Audio should be at a lower pitch since it was recorded too fast.
    Can we disable the pitch adjustment, when using rate conversion, so the pitch is corrected (lower) as well?

    Hi Jason
    This does sound tricky - the only other suggestion that I can add to David's is to use the smallest GOP setting you can, I'm in PAL land so the default is 12frames but I push it down to 7, this forces more I-frames into your mpeg. It makes the file size higher but in a project your length it doesn't matter. Make sure you encode your audio to .ac3 (use the Dolby 2.0 preset in compressor). Although David's limit is 7.4, if I'm not playing back on a laptop I'll set my CBR to 8Mbps (in Compressor CBR is called 'one-pass').
    Once you create your mpeg, play it back in Quicktime first to make sure there are no artifacts full screen (with Simulators reduced size sometimes artifacts exist in your orig mpeg that you may not notice).
    Also as David said, DVDSP doesn't re-encode an existing mpeg so something else must be going on. Before you re-import your new mpeg, delete your DVDSP prefs and any menu mpegs that it has created.
    If you have Toast, try just doing a Build, instead of Build & Format. This will give a VIDEO_TS folder that you can then burn in Toast. Use the Data tab and select DVD-ROM/UDF.
    If this doesn't work I don't know what will.
    Good luck!
    B

  • 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

  • How i disable the frame window??

    how i disable the frame window??
    i had used frame.disable(); function but its not work...
    disable function works only on components its not work on frame..

    hi!
    1) which one you are using? Frame/JFrame ?
    2) exactly what do you want to disable?
    a) entire frame including titlebar buttons
    b) just all the child components, menus, toolbar buttons
    c) what should be the behavior of taskbar at the time of disabled frame object?
    i think for a proper and to the point solution these are thing one need to know.
    regards
    Aniruddha

  • How I disable the iPad picture frame mode?

    Several times I looked in the settings but could not find this option, just in the passcode settings, but I turned off the passcode, the picture frame is turned on WHY? And how I disable the picture frame? I looked this on youtube in an iPad review video at 2:35 min: http://www.youtube.com/watch?v=Aly5Q_mUhVI
    Thanks for the help.

    Of course you can.
    If you don't want the little flower icon appearing on the unlock screen, set the Allow Picture Frame to Off under Passcode in General Settings.
    If you want to deactivate the Pcitrue Frame mode while its running, tap the home button once, and click on the Flower icon at the bottom right whihc should be blue since its on.

  • Is it possible to disable the minimize, maximize and close on a Frame?

    Is it possible to disable the minimize, maximize and close buttons on a Frame?
    Is it possible to make invisible, minimize, maximize and close buttons of the frame?
    What methods would I use to do so?
    Thank You

    The minimize, maximize and close buttons are defined as the windows decoration. To disable the windows decoration,frame.setUndecorated(true);The setUndecorated() method can only be called while the frame is not displayable.
    Then you can redesign the look and feel of the rootpane and call
    frame.getRootPane().setWindowDecorationStyle(JRootPane.FRAME);

  • Why does the ALT key disable mouse clicks on some machines?

    I have a drawing program, the main Window of which extends JFrame and contains a Canvas, which extends JPanel. The Canvas has a MouseAdapter, KeyAdapter and JMenuBar. It also has a Tools palette, which extends JDialog and has Buttons, which extend JToggleButtons.
    One button is called Zoom. After pressing this button, you can Zoom In and Zoom Out by clicking the mouse on a point of the illustration. It differs from pressing Ctrl Plus and Ctrl Minus, because the point where you click is kept in place, and only all the other points move.
    Zooming In is done by clicking the mouse and Zooming Out is done by pressing the ALT key and clicking the mouse. The Zooming In works on all computers, but for some strange reason, the Zooming Out doesn't work on all computers. The computer where it doesn't work, after pressing the ALT key and clicking the mouse, it does not recognize the mouse click, and never reaches the mousePressed method in my debugger.
    The computer where it doesn't work has the Windows XP Professional operating system. But some computers where it does work have the same operating system. The problem also does not depend on the keyboard or mouse, because I tried a different keyboard and mouse, and it still didn't work.
    I wonder if the reason why it doesn't work on some computers has to do with that the ALT key is also used differently (which might depend on the operating system)? Pressing the ALT key and clicking the mouse Zooms In a picture by keeping the point in place and only moving all the other points
    I do not want to use a different key, since one release of my program is a plugin for Photoshop, and Photoshop also uses the ALT key to achieve the same thing.
    Thanks for checking on this! I will appreciate your help!

    Ok, I did apply KeyBindings. Since the AnanyaCurves class extends JFrame, I couldn't apply KeyBindings there, but I could apply KeyBindings to my CurveCanvas class, which extends JPanel, which extends JComponent. However I still have my first two problems:
    1) After pressing the ALT key, clicking the mouse doesn't get recognized. You never reach the mousePressed method, where it's supposed to exit the program.
    2) After opening a menu, such as the Nothing menu by pressing ALT and N, pressing a key which is not an accelerator key of a menu doesn't get recognized, such as pressing the E key. You never reach the actionPerformed method of the exitF action, where it's supposed to exit the program.
    Here is my SSCCE with the KeyBindings:
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.*;
    import java.lang.reflect.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.plaf.*;
    public class AnanyaCurves extends JFrame
      CurveCanvas canvas;
      JMenuBar menuBar;
      Command quitCmd;
      JMenu fileMenu, nothingMenu;
      JMenuItem quitItem, nothingItem;
      boolean alt;
      public AnanyaCurves(Dimension windowSize)
        Font boldFont = new Font("Verdana", Font.BOLD, 12);
        Font plainFont = new Font("Verdana", Font.PLAIN, 12);
        Object top;
        Basics.ananyaCurves = this;
        alt = false;
        try
          UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
          SwingUtilities.updateComponentTreeUI(this);
        catch(Exception e)
        UIManager.put("MenuItem.acceleratorFont", new FontUIResource(UIManager.getFont("MenuItem.acceleratorFont").decode("Verdana-PLAIN-12")));
        Basics.ananyaCurves = this;
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        setTitle("Ananya Curves");
        Dimension docSize = new Dimension(274, 121);
        canvas = new CurveCanvas(docSize);   
        menuBar = new JMenuBar();
        setJMenuBar(menuBar);
        fileMenu = new JMenu("File");
        fileMenu.setMnemonic('F');
        fileMenu.setFont(boldFont);
        quitCmd = new Command("quit", "ctrl Q");
        quitCmd.putValue(Action.NAME, "Quit");
        quitItem = new JMenuItem(quitCmd);
        quitItem.setFont(plainFont);
        fileMenu.add(quitItem);
        menuBar.add(fileMenu);
        //fileMenu.setVisible(false);
        /*JMenuBar hiddenMenuBar = new JMenuBar();
        hiddenMenuBar.add(fileMenu);
        getContentPane().add(hiddenMenuBar, BorderLayout.CENTER);
        getContentPane().add(new JPanel(), BorderLayout.CENTER);*/
        nothingMenu = new JMenu("Nothing");
        nothingMenu.setMnemonic('N');
        nothingMenu.setFont(boldFont);
        nothingItem = new JMenuItem("NoAction");
        nothingItem.setFont(plainFont);
        nothingMenu.add(nothingItem);
        menuBar.add(nothingMenu);
        addMouseListener(new MouseAdaption());
        addKeyListener(new KeyAdaption());
      public static void main(String[] args)
        Dimension windowSize = new Dimension(300, 200);
        AnanyaCurves ananyaCurves = new AnanyaCurves(windowSize);
        ananyaCurves.pack();
        ananyaCurves.setBounds(0, 0, windowSize.width, windowSize.height);
        ananyaCurves.setVisible(true);
        ananyaCurves.requestFocus();
      public void exit()
        this.dispose();
        System.exit(0);
      class MouseAdaption extends MouseAdapter
        public void mousePressed(MouseEvent e)
          if (AnanyaCurves.this.alt == true)
            AnanyaCurves.this.exit();
      class KeyAdaption extends KeyAdapter
        public void keyPressed(KeyEvent event)
          /*int keyCode = event.getKeyCode();
          if (keyCode == KeyEvent.VK_ALT)
            AnanyaCurves.this.alt = true;
          else if (keyCode == KeyEvent.VK_E)
            AnanyaCurves.this.exit();
        public void keyReleased(KeyEvent event)
          AnanyaCurves.this.alt = false;
    class Basics extends java.lang.Object
      public static AnanyaCurves ananyaCurves;
      public Basics()
    class Command extends AbstractAction
      String name; // the command name (not the menu item string)
      String accelerator;
      public Command(String name, String accelerator)
        super();
        this.name = name;
        if (accelerator != null && !accelerator.equals(""))
          this.accelerator = accelerator;
          KeyStroke k = KeyStroke.getKeyStroke(accelerator);
          putValue(Action.ACCELERATOR_KEY, k);
      public void quit()
        Basics.ananyaCurves.dispose();
        System.exit(0);
      public void actionPerformed(ActionEvent actionEvent)
        try
          Method f = getClass().getMethod(this.name, (Class[])null);
          f.invoke(this, (Object[])null);
        catch (NoSuchMethodException e)
        catch (InvocationTargetException e)
        catch (IllegalAccessException e)
    class CurveCanvas extends JPanel
      public CurveCanvas(Dimension docSize)
        super();
        Action altF = new AbstractAction()
          public void actionPerformed(ActionEvent e)
            Basics.ananyaCurves.alt = true;
        Action exitF = new AbstractAction()
          public void actionPerformed(ActionEvent e)
            Basics.ananyaCurves.exit();
        this.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ALT"), "alt");
        this.getActionMap().put("alt", altF);
        this.getInputMap(WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("E"), "exit");
        this.getActionMap().put("exit", exitF);
    In the getInputMap method I was trying to use the condition WHEN_IN_FOCUSED_WINDOW, hoping that the bound key would be recognized, but it didn't work. And, by the way, I still used the KeyAdapter so that the alt attribute of AnanyaCurves can be set to false when the ALT key is released.
    I will appreciate your help very much! Thanks for your time!

Maybe you are looking for

  • MacBook Pro (late 2011) restarts suddenly and safari quits unexpectedly

    Hi. I've a macbookook Pro (Late 2011) 10.8.4 mountain lion. Safari unexpectedly quits and if not that, my macbook restarts without notice and sometimes a black screen with white text appears so it fails to restart. I went on disk utility to repair my

  • Signal booster needed?

    I moved and cannot get a signal at my more remote location.  I cannot receive or send out phone calls, it registers phone call failed.  I do however receive text messages and email.  I have a strong WIFI signal but my Verizon service is not working.

  • How do you make a photo in DW that changes automatically in a loop and needs  no visable buttons

    How do you make a photo in DW that changes automatically in a loop and needs  no visable buttons?

  • How do I get rid of the Security Pop-Up?

    Windows 7 - 64bit IE 8 run in 32 bit Latest version installed of Flash Player All of a sudden (I think it started when a web page tried to open adobe reader) I get a continual IE security popup that keeps re-appearing over and over again on the same

  • Rogue AP detection

    The WLSE have detected rouge APs. Theses APs are high RSSI and have variable channel set. How can i handle it? As i know. WLSE is not able to protect my APs from rogue APs attack, only detect it. Should i use wire LAN? any other solution clear this r