Quit Application with "Alt+F4" or "X"-Button

I have created an application with LabWindows/CVI 5.0. To quit the application
I have created a Callback Function which takes care of it. My problem is
now that I'd like also to shut down the application the "standard" windows
way with "Alt+F4" or the little "X" in the application bar. This does not
seem to work and I can not find any information how to do that.
Any help is kindly appreciated
thanks in advance
ps: my OS is: WinNt 4.0 (SP5, Build 1381)

oh well,
few minutes after i had posted my first message i found the solution :-)
so here is it:
specify a callback function for the main-panel itself. the auto-create the
code for this panel callback. delete all the events you are not interested
in and give the code for the "close-event".
that's it - thanks for reading both messages

Similar Messages

  • Is there any app to quit from application with out pressing home button every time

    is there any app to quit from application with out pressing home button every time?

    Months ago my home button was screwed up, and I was worried. I'd have to wait atleast for a week to get it repaired as I was busy with my exams. So I found a solution. Goto Settings->General->Accessibility.
    Scroll down, and under "Physics & Motor", select "Assistive Touch". Toggle it on, and you get lots of options. You don't need to click the home button all the time. It is a very simple widget like stuff, that stays no matter what app you're using and you can do various functions with it. Initially, it's irritating as you see it everywhere. But it fades itself out and appears when needed. After you get used to it, it's really helpful.

  • I would like to have an email account that is password-protected that I can access on my Mac, Iphone and Ipad, separate from the Mail application, with an alert button that indicates unread messages

    I would like to have an email account that is password-protected that I can access on my Mac, Iphone and Ipad, separate from the Mail application, with an alert button that indicates unread messages

    Try a search... I'm sure if you put forth a little effort you can find a solution that will work for you.

  • Software Center Application Uninstallation Button Greyed Out and Deploying an Application with Uninstall switch Fails

    Hi,
    I tried everything I could find on the internet but no luck so far. I can successfully deploy MS Visio 2013 to the clients. I also want to be able to uninstall it from the clients. On the client machine Uninstall button is greyed out. This deployment is
    installed as "Available" and there is only one deployment type within that MS Visio 2013 Application.
    I tried the following uninstall commands in my deployment:
    setup.exe /uninstall
    setup.exe /uninstall
    VisPro
    /config .\vispro.ww\uninstallvisio.xml
    “\\SRVSCCM2012\Sources\MSApplications\MSVisioPro_2013_64Bit_ENG\setup.exe” /uninstall VisPro /config "\\SRVSCCM2012\Sources\MSApplications\MSVisioPro_2013_64Bit_ENG\vispro.ww\uninstallvisio.xml"
    \\SRVSCCM2012\Sources\MSApplications\MSVisioPro_2013_64Bit_ENG\setup.exe /uninstall VisPro /config \\SRVSCCM2012\Sources\MSApplications\MSVisioPro_2013_64Bit_ENG\vispro.ww\uninstallvisio.xml
    I checked Product ID from Setup.xml and I know it is correct. My uninstallvisio.xml' content is below:
    <Configuration Product="VisPro">
    <Display Level="basic" CompletionNotice="yes" SuppressModal="yes" AcceptEula="yes" />
    <Setting Id="SETUP_REBOOT" Value="Never" />
    </Configuration>
    Last night, I downloaded and installed Cumulative Update 1 for SCCM 2012 R2 and I haven't tried the deployment after the update,yet. I will try it today but please let me know what else to check.
    Yavuz Selim Atmaca

    After I updated SCCM Server and test client pc with CU1 , I tried to deploy visio as Required. It installed successfully. Then I uninstalled visio by deploying the application with Uninstall Action.
    After that I tried to deploy visio as "Available" to see if Software Center Uninstall button works. However visio deployment does not come to Software Center's Available Applications List. I check the status of the deployment under the Deployments monitoring
    node and it says Success "Already Compliant". I dont know what it means. Does config manager thinks that visio already installed?
    Yavuz Selim Atmaca
    2 or 3 hours later that -Succes "Already Compliant"- status of the deployment under the Deployments monitoring node is vanished automatically and Software Center application list showed the new deployment. I installed it and  uninstalled it succesfully.
    So, you are right Solution is the CU1 but I am still wondering why my available deployment took so time to be visible in Software Center althought I didn't enter any schedule to be available.
    Yavuz Selim Atmaca

  • Exit application with button

    hi...i need to close the main frame when user key in the correct username and password.when user do a mouse click o key press,the userinput box will show and with correct input the application will exit.my problem now is i need to click the ok button twice then application will exit.why is this so?how can i do to make it work with one click on the button?thanks

    oh ya i got two actionlistener...erm...
    my codes pretty long because i put everything into a class...sorry...
    import java.awt.event.*;
    import java.awt.*;
    import javax.swing.*;
    public class WindowTest
         public static void main(String args[])
              new WindowTestWindow();
    //create a black screen
    class WindowTestWindow extends JWindow
         WindowTestWindow()
              super();
              // Components should be added to the container's content pane
              Container cp = getContentPane();
              addKeyListener(new KeyAdapter() //for key press
                   public void keyTyped(KeyEvent event)
                        char key = event.getKeyChar();
                        if (Character.isLetterOrDigit(key))
                             PasswordBox pw = new PasswordBox(); // show the frame for user to input
                             pw.setVisible(true);                                        //username & password
                   public void keyPressed(KeyEvent event){}
                   public void keyReleased(KeyEvent event){}
              addMouseListener(new MouseAdapter() //for mouse click
                   public void mouseEntered(MouseEvent event){}
                   public void mouseExited(MouseEvent event){}
                   public void mouseClicked(MouseEvent event)
                        PasswordBox pw = new PasswordBox(); // show the frame for user to input
                        pw.setVisible(true);                                        //username & password
                        //System.exit(0);
                   public void mousePressed(MouseEvent event){}
                   public void mouseReleased(MouseEvent event){}
              //get screen size
              Toolkit kit = Toolkit.getDefaultToolkit();
    Dimension screenSize = kit.getScreenSize();
              // Show the frame according to the user's window size
         int screenHeight = screenSize.height;
         int screenWidth = screenSize.width;
         setSize(screenWidth, screenHeight);
              //set background color black
              cp.setBackground(Color.black);
              // Show the frame
              setVisible(true);
              requestFocus();
    //class to exit the whole     application
    class CloseActionHandler implements ActionListener
         public void actionPerformed(ActionEvent e)
              WindowTest w = new WindowTest();
              dispose();
              System.exit(0);
    //user to input username & password
    class PasswordBox extends JFrame
         private JTextField username;
         private JPasswordField password;
         private JButton ok, cancel;
         private JFrame PasswordBox;
         public PasswordBox()
              super("Unlock Screensaver"); //set the frame size
              setSize(280,120);
              JPanel backPanel = new JPanel();
              backPanel.setLayout(new BorderLayout());
              backPanel.setBackground(Color.blue);
              JPanel panel = new JPanel();
              username = new JTextField(5);
              panel.add(new JLabel("Username:", JLabel.RIGHT));
              panel.add(username);
              password = new JPasswordField(5);
              panel.add(new JLabel("Password:", JLabel.RIGHT));
              panel.add(password);
              backPanel.add(panel, BorderLayout.CENTER);
              JPanel OKPanel = new JPanel();
              ok = new JButton("OK");
              //ok.addActionListener(this);
              OKPanel.add(ok, BorderLayout.WEST);
              //add listener to the 'ok' button
              ok.addActionListener(new ActionListener()
              public void actionPerformed(ActionEvent e)
                   if(e.getSource() == ok)
                        if(username.getText().trim().equals("fyp"))
                             if(password.getText().trim().equals("fyp"))
                                  CloseActionHandler cah = new CloseActionHandler();
                                  ok.addActionListener(cah);
                             else
                                       clearInputFields();
              JPanel CANCELPanel = new JPanel();
              cancel = new JButton("CANCEL");
              //cancel.addActionListener(this);
              CANCELPanel.add(cancel, BorderLayout.EAST);
              JPanel buttonPanelss = new JPanel();
              buttonPanelss.add(OKPanel);
              buttonPanelss.add(CANCELPanel);
              backPanel.add(buttonPanelss, BorderLayout.SOUTH);
              setContentPane(backPanel);
              // Center the box
         Dimension screenDim =
    Toolkit.getDefaultToolkit().getScreenSize();
         Rectangle frameDim = getBounds();
         setLocation((screenDim.width - frameDim.width)
              / 2,(screenDim.height - frameDim.height) / 2);
         public void clearInputFields()
              username.setText("");
              password.setText("");
    thanks

  • How can I start any application with buttons

    Hello, I want to start any kind of applications with Buttons. I want to make me a GUI with buttons and with one button I want to start Outlook, but I dont know how this will work!
    THX for your help

    Runtime class exec methods
    If your Outlook executable is in different path ... import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Test2 extends JFrame implements ActionListener
       public Test2()
          super("Test");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          setSize(300, 200);
          JButton b = new JButton("Outlook Express");
          b.addActionListener(this);
          getContentPane().setLayout(new FlowLayout());
          getContentPane().add(b);
       public void actionPerformed(ActionEvent e)
          try{
             Runtime runTime = Runtime.getRuntime();
             Process proc = runTime.exec
                         ("C:\\Program Files\\Outlook Express\\msimn.exe");
             proc.waitFor();
          }catch(IOException ioe){System.out.println("Wham");}
          catch(InterruptedException ie){System.out.println("Bop");}
       public static void main(String[] args)
          new Test2().setVisible(true);
    }

  • "Add to bookmarks - button" for application with application alias

    How to make "add to bookmarks - button" to login page of the application with the application alias?
    The idea is to ensure that end-users are storing the application alias to bookmarks rather than the direct link to application id which might change.
    rgrds Paavo

    Jari, here are some of my trials hosted now in apex.oracle.com. All url's to be bookmarked are "hardcoded" in to the login page html-header's javascript function.
    Sample db application - url with workspace name.
    http://apex.oracle.com/pls/apex/f?p=COM_ORACLE_APEX_PRODUCT_PORTAL:LOGIN:0&c=PAAVO_POC
    - the LOGIN alias defaults to login page
    - the session id is = 0 as recommended here: http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/concept_url.htm#HTMDB03020
    - workspace name is actually Internal in the administration so omitting workspace name leads to error " Error The application alias "COM_ORACLE_APEX_PRODUCT_PORTAL" can not be converted to a unique application ID. ", perhaps other workspaces have also the same sample app alias
    - so used the PAAVO_POC as workspace name (got it during registration)
    - LOGIN page HTML-header is:
    <script type="text/javascript">
    function bookmark()
    window.external.AddFavorite("http://apex.oracle.com/pls/apex/f?p=COM_ORACLE_APEX_PRODUCT_PORTAL:LOGIN:0&c=PAAVO_POC","COM_ORACLE_APEX_PRODUCT_PORTAL in ws paavo_poc");
    </script>- LOGIN page HTML Body attribute is:
    <form>
    <input type="button" onclick="bookmark()" value="Bookmark me">
    </form>- tried to also add "Click here to bookmark me" button in the login region with the following code (couldn't figure out how to do button for this via apex developer)
    <form>
    <input type="button" onclick="bookmark()" value="Click here to bookmark me">
    </form>- login doesn't work anymore
    Copy of the same sample application but with more different / more unique alias and without the "Click here to bookmark me" button in the Login-region.
    http://apex.oracle.com/pls/apex/f?p=paavos_product_portal:LOGIN:0&c=PAAVO_POC
    - the bookmark could be stored without workspace name, but it might break if the same app. alias name appears in some other workspace http://apex.oracle.com/pls/apex/f?p=paavos_product_portal:LOGIN:0
    - login works now because no hassling with the button-code in the Login-region :)
    Then fresh new application with the following URL's and with the same symptoms.
    http://apex.oracle.com/pls/apex/f?p=POCTEST_NO_B_BUTTON:LOGIN:0&c=PAAVO_POC
    http://apex.oracle.com/pls/apex/f?p=poctest:LOGIN:0&c=PAAVO_POC
    - Enter with "demo" and "ApexIsGood". Please don't kill my workspace with lots of 'fishes' :).
    It would be good to have the URL constructed dynamically e.g. fetching the application_alias_name and the correct workspace to be used.
    In perfect world it would also be good to have feature in for redirecting the user from old version to production 'application alias' with dynamic action requesting the user to update his/her bookmark.
    But as said I am bit stuck ..
    rgrds Paavo
    Edited by: paavo on Apr 7, 2012 3:20 PM
    Edited by: paavo on Apr 10, 2012 4:05 PM

  • Where can I find a sample of application with textboxs ,buttons and ..

    Hi,
    I'm new to Java and I'd like to know where can I find a sample of application with textbox, buttons and accessing a database (Oracle or MS-Access) something like a commercial application to start my knowledge in Java. I'm a developer and I use Visual Basic with Oracle DB. I have knowledge in C language.
    Thanks.
    Autair

    Hi Lionalx,
    I've tried to follow your tip but I got a page that contains the following message : "This directory contains some helper apps and scripts for setting
    up Microsoft Access, SQL Server, or Sybase databases to use with
    the examples in examples/Table. For details see the online
    documentation in:
    http://java.sun.com/products/jfc/swingdoc-current/db.html". Just it. So I've copied the indicadet address but it's redirect to main page of 'swing'. I was there before.
    Despite of this error, I'm finding some interesting tips in the address that you indicated. OK?
    Thanks.
    If you have something new or tip please write me
    Thanks
    Autair

  • HT4463 I keep getting the message "The application could not be downloaded. The installation could not be started."  with a "Retry" and "Cancel" button,  I have been re-trying for several hours to no avail.  What is the problem?

    I keep getting the message "The application could not be downloaded. The installation could not be started."  with a "Retry" and "Cancel" button,  I have been re-trying for several hours to no avail.  What is the problem?

    You'll need to contact support and have them check your account
    https://expresslane.apple.com/GetproductgroupList.action

  • How to realise a point track application with user-defined original point?

    hi,
       I am developing a simple point track application, it is not the same as the traditional mouse cursor tracking problem and i get really confused. 
       there are two pictures to describe my application:
       the first one descirbes the default state of my application:
       1.red circle is the point that user can move;
       2.white cross is the original point;
       3.blue circle is the range of red circle motion
       the second one describes the track process of my application:
       1.user can move the red circle with a click of mouse button in any place within blue circle;
       2.application should show coordinates of red circle relative to white circle in real time;
       3.once user release the red circle(or the button of mouse), the application should return to its default state.
       I realy do not know how to realise the key parts of this application, like showing a circle in panel and connecting the points within it to the labview code? can anybody give me some suggestions? thanks a lot 
    Attachments:
    default state.png ‏10 KB
    action state.png ‏12 KB

    Attached is a very rough implementation of what you're looking for.  Add a "draw (white) line" after the "draw circle" function to make the crosshairs persist when the circle is near the center. Prob want to delete the crosshairs from the blue circle picture (currently contained in a constant) to avoid drawing them twice and them not quite lining up.  All of the constants are empirically determined and need slight adjustments (e.g. centering of the red circle when mouse is up, etc.).  They will need further adjustment if you resize the blue circle picture. 
    Not sure what you mean by connecting the points within the LV code.  I suspect you're using the eyeball to drive an XY stage or such and need to use the red circle coordinates to moderate the travel speed? 
    Attachments:
    Untitled 1.vi ‏25 KB

  • How to externally trigger the execution of TestStand with a start and abort button through a digital interface?

    Hello,
    I'm Currently evaluating TestStand as an alternative for an in-house developed Test Sequencer.
    To start our own Test Sequencer we use a small box, connected to a DIO board. The box has a start button and an abort button. The box also has a pass, a fail and a running led.
    The interface with this box is made via some digital lines of a PCI-DIO-96.
    In our own Test Sequencer we have groups named Init, Run, Abort, Exit.
    The Init group is executed at startup (only once). It is used to initialize all the HW and SW. -> I guess this is the Pre UUT Loop callback in TestStand.
    The Exit group is only executed once at the end of the day when the application is terminated. It is used to free all the used hardware and cleanup all the resources. This probably is the Post UUT Loop Callback in TS.
    When a product needs to be tested, the operator presses the "start" button which triggers our own Test Sequencer and the run and abort group are being executed (first the run group, afterwards the abort group).
    When the product is being tested the "running led" of the little box lights up to indicate to the operator that the application is running. (only when the run and abort group are running)
    The Run group has all the functional tests in it. (MainSequence)
    The abort group is used to put everything back in it's original state after the test on this single product is done. (Post UUT)
    When executing the tests and something goes wrong (operator gets stuck in a clamper, ...) the operator can still press the abort button and then the execution immediately jumps from the currently executing step in the run group to the first step of the abort group. So, when something goes wrong, immediately the abort group is called.
    At the end of the run and abort group, if no errors occured, the "pass led" lights up. If one or more steps went wrong the "fail" led lights up.
    This setup can also be used to test multiple product in parallel. At that time all the different parallel testers have such a small box which contains a "start" and "abort" button and a pass, fail and running led. (it is possible that they are all connected to the same PCI-DIO-96 board. )
    My question:
    Is it possible to do something similar like this in Teststand? If yes, is there an example available that shows me how to do this in TestStand? (externally trigger the execution of TestStand)
    Typically, in the Init group (Pre UUT Loop) the digital interface box gets initialised.
    In the Close group (Post UUT Loop) the digital interface box is taken out of scope.
    Note: The PCI-DIO-96 board to which the digital interface box is connected will also be used in the rest of the developed application (MainSequence, ...)
    What's really important for me is that I can create a process model that all the application developers in our organisation can use. I really don't want any of the application developers (limited software experience) to mess around in all the features of TestStand.
    For them it's important that they just add the function DigitalInterfaceBoxInit () in the Pre UUT Loop Callback and the DigitalInterfaceBoxClose () in the Post UUT Loop Callback, and then everything works!
    It is important that the appliation developers do not have to create any global variables, other functions, synchronisations, parallel sequences, ... in TestStand. All this needs to be done with a simple call to the DigitalInterfaceBoxInit function.
    Thanks in advance for all the help!
    Best Regards,
    Dennis Vanotterdijk
    [email protected]

    Dennis-
    Your application sounds very well suited to TestStand's abilities. I am also quite impressed with your knowledge of how TestStand's architecture is arranged when you are still just considering whether or not to use it.
    I think that TestStand would work really well for you in this application. Like you mentioned it will provide you with a form of standardization for your application developers to work from. It also provides the flexibility for you to add your custom routines in many different places. TestStand also makes parallel and batch testing much easier in TS 2.0 so that you could develop one test for your product and execute different instances of it in parallel to test multiple products at once.
    As for your specific question about how to c
    ontrol TestStand using a DIO board. I think this is very feasible and should not be too difficult. Since TestStand provides you the ability to create a custom operator interface your operator interface could monitor the status of your DIO board and launch/abort executions based on the read values. Usually the executions are launched/aborted when a button on the GUI is pressed however, I do not see any thing different about basing the action on a DI signal vs a mouse click. I am sure your application is more involved than this high level description but from the sounds of it I think it is very possible to do with TestStand.
    Based on my experience of building test systems with TestStand and your description of the application, I would feel very confident in using TestStand to achieve all the goals you mentioned. If you have further detailed questions on how one of your features might be implemented, feel free to contact one of our Application Engineers or email us at www.ni.com/ask
    and we would be glad to help you.
    Best regards,
    Richard McDonell
    National Instruments

  • Closing Applications with red X prevents restarting of applications

    Hi,
    first of all, I switched from PC to Mac just 2 days ago, so forgive my lack of common iKnownledge of macLingo.
    My system is OS X 10.5.6 running on the latest MacBook (standard model).
    I performed the software update.
    As former windows user (and every other OS user, btw.) I assumed that clicking on the red X button closes the application, which it apparently doesn't. I found out the pressing the button with the swirly symbol + Q is the way to go.
    Anyway, sometimes I just want to close an application with a click, so I push the X button and restart the closed application later, although - as I understand it - the application is still loaded (which is indicated by the small white dot in the dock). Just to be clear: Closing e.g. Safari with the red X closes the window but doesn't minimize it to the dock.
    However, every so often a red-X-closed application remains white-dot-active but can't be restarted or maximised again, unless I first go to the dock and close it manually by use of the context menu.
    This is an eminently stupid behaviour of OS-X if that was intended.
    So, ist there a fix for this ? Or a way to tell the red X to close an application for good ?
    What's the use of three colored window control buttons anyway, if two of them just basically minimize an application ?
    Thanks for the help.
    PS: Maybe I should mention that this behaviour is not reliably reproducable. Sometimes it works, sometimes it doesn't. It happens way too often to ignore, though.
    Message was edited by: arotto

    I was hoping you'd say that. It is as it's supposed to do in that particular case at least.
    Now just so you know, (though I suspect you already have some idea). That red cross will as a general rule close just that window. In some cases, (usually where the app only ever has that one window), clicking the X will close the app down, otherwise the app will still run in the background. This is normal. To close the program down you need to Quit it, ⌘Q.
    You are right that it can't be maximised again, +that's because you didn't minimize the window you closed it.+ To minimize you need to press ⌘M, or click the minus symbol.
    Strictly speaking the buttons do not both minimise, one maximises.
    I think the minus button is there to put the window in the dock.
    I think the plus button is there to alternate between minimum and maximum window sizes while that particular window is active on the desktop.
    I think once you understand how it works you should find it consistent. Give it a shot and let us know.
    Message was edited by: gumsie

  • How can I alt tag the TOC button that appears at the top of the menu?

    Running the current version of Cp7 on a windows 7 machine.
    A 508 hang up once again: The customer insists on an active TOC for the project file. We've activated the TOC and it works fine, but there's a secondary TOC expand/collapse button located at the top of the slide right here:
    Although I can change the icon for the expand/collapse TOC in the TOC setting menu:
    I can't put an alt tag on the button, meaning that JAWS and other screen readers just reads it as an unnamed button - which would be "bad" if you're trying to pass a 508 compliance test - which I am. I know alt tags don't travel with the image file, and I can't find any way to access the file in Captivate to give it an accessibility name. Anybody have a workaround?
    Justenuf

    You can replace the current image with one of your own choosing.  But even if you make the replacement just a one pixel GIF, I think it will still register somewhere in the screenreader as a button. 
    However, to be fair to Captivate, you can use the TOC button on the playbar to activate the TOC if need be, or you can set up on screen buttons to do that.
    Personally, I wouldn't be using an overlay TOC at all.  I'd be trying for a Separate TOC so that it was available all the time.
    However, I had read somewhere on this forum (a year or so back) about someone else finding that the links on the TOC itself were not completely 508 compliant.  So maybe you're just chasing your tail here if you're trying to achieve perfect 508 compliance.

  • How to close a Webdynpro Application with some action, if it is opened with a Tcode

    Hi Experts,
         I am looking to get some info regarding my post over here.
    Scenario 1:
    I opened my webdynpro application in SAP GUI (created a tcode for my webdynpro application and ).
    Now, I have to add some button where I have to write a piece of code to close the GUI screen along with the webdynpro application. (ie, entire Tcode where the webdynpro application is shown, should be closed)
    Please let me know if you have some info on this.
    Scenario 2:
    If the above scenario is not possible, then I wanted to know if I can call some screen in SAP GUI.
    Note: The GUI screen must be called only from the webdynpro application that is opened with a tcode in SAP GUI.

    Hello,
    Please try this:-
    Window Plugs: Startup and Exit - Web Dynpro for ABAP - SAP Library
    You can close the WD Application by follwoing way-
    Create a button in a view and assign an action on it.
    Create on exit plug in window level and fire that in the view button action level.
    Z2-wd comp.
    NAME
    EXT:-Window
    exit plug name.
    DATA lo_z2 TYPE REF TO ig_z2 .
    lo_z2 =   wd_this->get_z2_ctr( ).
      lo_z2->fire_ext_plg(

  • Problem with Alt , JMenu and Mnemonics

    I have built an application with a JMenuBar containing several JMenu's, the first of which is a File menu. All JMenus and JMenuItems have mnemonics associated with them. When I press the alt key the underlines show and focus appears to be given to the File menu (though it has not dropped down). If I then press a key, for example 'S', that is a mnemonic of the 'Save' jmenuitem in the File menu, the Save action is invoked. This should not occur because the menu has not opened yet.
    The behavior is what I'd expect had an accelerator (Alt+S) been defined for the Save menu item. But I have not defined any accelerators.
    Why does this happen and more importantly, is there a work around?

    Except for the 1st line in jbinit() it's all pretty standard stuff. Here's a snippet of the code:
    public class MainFrame extends JFrame implements ChangeListener {
    JMenuBar jMenuBar1 = new JMenuBar();
    JMenu jMenuFile = new JMenu();
    JMenuItem jMenuFileNew = new JMenuItem();
    JMenuItem jMenuFileSave = new JMenuItem();
    JMenu m_editMenu = new JMenu();
    JMenuItem m_editCutMenuItem = new JMenuItem();
    JMenuItem m_editCopyMenuItem = new JMenuItem();
    JMenuItem m_editPasteMenuItem = new JMenuItem();
    public MainFrame() {
    jbInit();
    //Component initialization
    private void jbInit() {
    getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
    KeyStroke.getKeyStroke(KeyEvent.VK_ALT, Event.ALT_MASK, false), "repaint");
    // file menu
    jMenuFile.setText("File");
    jMenuFile.setMnemonic(KeyEvent.VK_F);
    jMenuFileNew.setText("New...");
    jMenuFileNew.setMnemonic(KeyEvent.VK_N);
    jMenuFileNew.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jMenuFileNewSpecial_actionPerformed(e);
    jMenuFileSave.setText("Save");
    jMenuFileSave.setMnemonic(KeyEvent.VK_S);
    jMenuFileSave.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    jMenuFileSaveSpecial_actionPerformed(e);
    jMenuFile.add(jMenuFileNew);
    jMenuFile.add(jMenuFileSave);
    // edit menu
    m_editMenu.setText("Edit");
    m_editMenu.setMnemonic(KeyEvent.VK_E);
    m_editCutMenuItem.setText("Cut");
    m_editCutMenuItem.setMnemonic(KeyEvent.VK_T);
    m_editCutMenuItem.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    editCutMenuItem_actionPerformed(e);
    m_editCopyMenuItem.setText("Copy");
    m_editCopyMenuItem.setMnemonic(KeyEvent.VK_C);
    m_editPasteMenuItem.setText("Paste");
    m_editPasteMenuItem.setMnemonic(KeyEvent.VK_P);
    m_editMenu.add(m_editCutMenuItem);
    m_editMenu.add(m_editCopyMenuItem);
    m_editMenu.add(m_editPasteMenuItem);
    jMenuBar1.add(jMenuFile);
    jMenuBar1.add(m_editMenu);
    this.setJMenuBar(jMenuBar1);
    etc...
    Pressing Alt+S invokes the action listener for the jMenuFileSave menu item. It should do nothing since there is no top level menu with a mnemonic of 'S'.

Maybe you are looking for

  • Problem with Page Break In ALV Report

    Hi I have got a problem in my ALV report. I have a checkbox in the user input screen where users decide whether they want a page break or not in the print preview (or print) page. Now i also have the option to have layout name in the input screen. so

  • Mac Mini Freezing Issues

    So, I recently bought a refurbished Mac Mini, late 2009 model. It worked fine for the first few months, but after moving back to school, it started acting oddly. First, it had problems booting. It would freeze up during the boot up, or occasionally r

  • SET PARAMETER ID sak - Simple doubt

    Hi Experts, PLs. clarify me that, I copied standard SAP prog. RFITEMGL into my_z_rfitemgl prog. Actually, this prog. is for Transaction code of FBL3N. So, issue is that, If I(some one else) ran this tx FBL3N, with selection criteria, say, G/L acct of

  • Thinkpad t61p series....screen replacement problems

    I replaced my screen and it function properly. After I did a function check I turn my computer off and then turned it back on and it just stop workin. The computer does not turn on at all.Did I mess up my battery or something. Has this happend to any

  • Can i use debit card to purchase iphone on apple store?

    can i use debit card to purchase iphone on apple store?