Accelerator Key Indicator Disappeared

I am building and running under jdk/jre 1.4.1.
My menu accelerators are no longer visible for the menu bar or sub menus if I use the mouse. If I use the keyboard, they are visible. I am running on XP. This was not the behavior I had with jdk/jre 1.4.0 or 1.3.1 or older versions.
Has anyone seen this behavior? I know what the accelerators are because I wrote the app, but a user wouldn't have a clue. Letters don't show up as underlined until the <alt> key is pressed. Also, from a user's perspective, they should be able to mix keyboard and mouse access.

try this and let us know if it helps,
UIManager.put("Button.showMnemonics", Boolean.TRUE);

Similar Messages

  • Accelerator Key

    I would like to create a shortcut key, such as Ctrl+space or Ctrl+z, that users can press when they get to a field which has a drop down list to display the list without having to use their mouse and click on the down arrow. The lists are either displayed from a Choice List or run a sql query to a database.
    I looked at using an Accelerator key but cannot get that to work.
    Is what I want to do possible? Any ideas on how I can accomplish it?
    Thanks in advance.
    Mary

    Yes we are using Form Designer 5.0. The objects I'm using are Drop Down List Boxes.
    I didn't know about the DropOnEnter=True property (I'm kind of new at this) but that works well if I have a Choice List typed under List in the properties of the object, but if I run a query in code it doesn't work. If, in the properties, I change the DropOnEnter=True I need to also change the DropDownStyle to DropDownList (according to something I read). If I do that, it works perfect when I have a choice list but the drop down list won't even display with a mouse click for the db query. If I have the DropDownStyle set to DropDown Combo, the list will display from the query when I enter the field, but when I leave the field after pressing Enter to select one item, the data disappears.
    I have tried playing with different settings under Properties as well as looking at the code under the onExit and DropDownClick events for the object but am not sure.
    Here is the code under the two events which might give you some insight. I tried playing with the defaultselection and currentselection but as of yet haven't gotten it to work.
    It would be great if it worked just like it does with the Choice List.
    OnDropDownClick
    Dim oRS
    Dim strList
    Dim szSQL
    psrelcode.Clear()
    If (psrelcode.ListCount = 0) then
    if rbbus.Value = rbbus.OnValue then
    szSQL = "Select reldesc,relcode from relate where relcode = 'ADV' OR relcode = 'AKA' OR relcode = 'SUB' OR relcode = 'PAR' OR relcode = 'FKA' order by reldesc"
    Set oRS = WFDataClient.ConvertToRecordset(WFDataClient.ExecuteReturnDataSetWithConnName(szSQL,"conn _son2"))
    else
    rbindiv.Value = rbindiv.OnValue
    szSQL = "Select reldesc,relcode from relate where relcode = 'ADV' OR relcode = 'OC' OR relcode = 'PTR' OR relcode = 'PADV' OR "_
    & "relcode = 'SP' OR relcode = 'EXPW' OR relcode = 'FKA' OR relcode = 'HEIR' OR relcode = 'TRUST' OR relcode = 'COOWN' OR "_
    & "relcode = 'DIR' OR relcode = 'PRINC' OR relcode = 'CODEF' OR relcode = 'COCSL' order by reldesc"
    Set oRS = WFDataClient.ConvertToRecordset(WFDataClient.ExecuteReturnDataSetWithConnName(szSQL,"conn _son2"))
    End if
    Do Until oRS.EOF
    strList = strList & Trim(oRS(0)) & ";" & Trim(oRS(1)) & vbNewline
    oRS.MoveNext
    Loop
    psrelcode.ChoiceList = strList
    psrelcode.DefaultSelection = 0
    End if
    OnExit
    Dim oRS
    Dim strList
    Dim szSQL
    psrelcode.Clear()
    form.BusyCursor = True
    If (psrelcode.Text <> "") Then
    szSQL = "Select reldesc,relcode from relate where reldesc = '" & psrelcode.Text & "'"
    Set oRS = WFDataClient.ConvertToRecordset(WFDataClient.ExecuteReturnDataSetWithConnName(szSQL,"conn _son2"))
    If (oRS.recordCount > 0) then
    if (oRS.RecordCount = 1) then
    psrelcode.Text = Trim(oRS(0) & "")
    ReCode.Text = Trim(oRS(1) & "")
    psrelcode.DropDownStyle=1
    else
    psrelcode.Text=""
    ReCode.Text = ""
    end if
    Else
    psrelcode.Text = ""
    ReCode.Text = ""
    form.BusyCursor = False
    msgbox "No records found matching your criteria. Please try again.",vbinformation,"Relationship Lookup"
    form.GoToField(psrelcode)
    End if
    Else
    psrelcode.Text=""
    ReCode.Text = ""
    End if
    psrelcode.CurrentSelection = 0
    form.BusyCursor = False
    Thank you in advance.
    Mary

  • How to activate JMenu from other frame using accelerator key

    Hi.
    I'm developing an application for my final year project.
    i set up my application to have multiple frame open at the same time (like sunone studio in SDI mode). only one JFrame contains the JMenuBar.
    i can activate this menu bar using the accelerator key when the containing JFrame has focus. however, i donot know how to make the Menu activate when the accelerator key is pressed on other frame. press help, thanks in advance.

    does any one have some idea.
    the solution i found seem not suit my need.
    i want to be able to pull down (and get the focus transfered to) the jmenu in menubar of another frame using the menu's mnemonics. using InputMap does not seem to fit since i need to the menmonic of menu is not in the input map.

  • JTabbedPane w/ Accelerator Keys

    I need to add accelerator keys to the tabs of a JTabbedPane, much like the accelerators in a JMenuItem (i.e. under-score for Alt-F, or CTRL-X, etc...).
    Any suggestions?
    Thanks!

    It doesn't support accelerator, but it does support mnemonics. Check out the API for more information.

  • Compile for Debug accelerator key

    Hello all,
    it seems it's not possible to set an accelerator key for the "Compile for debug" command, at least I cannot find how to.
    Any ideas? If it's not possible, I would like to suggest it for a future release.
    With kind regards,
    Ronald

    It's not possible currently, you can log the request over at the exchange sqldeveloper.oracle.com
    -kris

  • Accelerator key - is this a bug in Swing?

    Hello to everyone.
    I've written this Swing app which has JMenu.
    Anyway, i have set accelerator keys on most of JMenuItems but here is what is not working:
    JMenuItem exPaperXML = new JMenuItem("Paper XML");
    exPaperXML.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F10, 0));As you can see, I tried to set F10 to be accelerator key for this JMenuItem.
    It doesn't work. It doesn't fire exPaperXML.actionPerformed(..) event, but
    instead it highlights File JMenuItem (which doesn't have accelerator key set at all).
    For example, I have set F9 as accelerator key for another JMenuItem and it works fine.
    What do you think, is this a bug in Swing?
    My JDK version is 1.4.2_05
    Thanks!

    1) Read the JMenuBar API.
    2) Click on the "JMenuBar Key Assignments" link
    3) Click on "Key Java"
    4) Note how F10 is used to select the first item.camickr thank you for quick reply.
    Is there a way to override this default action?
    Thanks.

  • Sort Key indicator

    Hi
    i am facing a problem related to sort key indicator. i am using sort key indicator 012 i.e. vendor number in TDS Gl account so that it will show the vendor number in TDS gl account line item assignment field. but the system does not show the vendor number in assignment field.
    secondly when i choose withholding tax base at the time of line item display of TDS gl account, system shows blank in that field.
    how i can get both the values in TDS gl account.
    regards
    Deepak
    Patni Computer

    You will need to create a substitution rule that will place these into your fields.  Vendor is not in the GL line. You can export the values to memory and then import them to the lines you wish. If the information you want appears in your BSEG line item you can do substitutions without exports.
    pls assign points if helpful as a way to say thanks.

  • SSL indicator disappears when page with video tag has been loaded

    I have a strange bug in Firefox, that was detected when site moved to SSL.
    There is single page site built on Backbone.
    When page with video tag loaded SSL indicator disappears.
    Firebug shows that Firefox create GET request connection to the server but it hangs.
    All site logic work correctly. And video on this page works perfect, I can click play and new connection will be created and video played but first connection still hangs.
    There is four page with video tag (four steps of wizard) and hanged connection appears randomly on this pages.
    Actually this issue exists without SSL, but detected only when we moved to SSL and lock icon began to disappear.

    The SSL indicator can disappear if there is mixed content on that page (i.e. coming via an unencrypted http connection).
    Did you click the Site Identity Button (globe/padlock) and proceeded to the Security tab in Page Info?
    *https://developer.mozilla.org/en/Security/MixedContent
    *https://developer.mozilla.org/en/Tools/Web_Console

  • RE: (forte-users) Accelerator keys under MS Windows95/98/NT

    This message is in MIME format. Since your mail reader does not understand
    this format, some or all of this message may not be legible.
    ------_=_NextPart_001_01BEF001.9C8C0B50
    Content-Type: text/plain
    Unfortunately, ALT key is not recognized as a validkey modifier on Windows
    That isn't entirely true. The ALT key is recognized. I've used it
    successfully
    under Windows 95 and NT. The only annoying side-effect is that you get the
    standard operating system beep when you perform the keypress.
    -----Original Message-----
    From: "Ajith Kallambella" [SMTP:[email protected]]
    Sent: Thursday, August 26, 1999 1:43 PM
    To: "[email protected]" [SMTP:[email protected]];
    "[email protected]" [SMTP:[email protected]]
    Subject: Re: (forte-users) Accelerator keys under MS Windows 95/98/NT
    The Window class has a method named SetAsFunctionKey
    and an event named FunctionKeyPress. When used
    in combination, the former can be used to configure
    various accelerator keys for the window widgets
    and the latter can be used to trap them.
    For more details, take a look at Forte online help.
    Unfortunately, ALT key is not recognized as a valid
    key modifier on Windows, but is only available on
    Unix and VMS - for reasons beyond my comprehension :(
    Hope this helps
    Ajith Kallambella M.
    Forte Systems Consultant.
    From: "Burns, Troy" <[email protected]>
    To: "'[email protected]'" <[email protected]>
    Subject: (forte-users) Accelerator keys under MS Windows 95/98/NT
    Date: Thu, 26 Aug 1999 13:56:07 -0400
    Let's say I have a pushbutton on a window and I've given it
    label text of "&Search". In past developer-lives, the ampersand
    is what gives the button the ability to respond to ALT-S. This
    doesn't appear to be the case in Forte. What do I need to do
    to make this work?
    Thanks in advance,
    Troy Burns
    E-mail: [email protected]
    Marriott Vacation Club International
    941-688-7700 ext. 4408
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: [email protected]
    For the archives, go to: http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: [email protected]
    ------_=_NextPart_001_01BEF001.9C8C0B50
    Content-Type: text/html
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
    <HTML>
    <HEAD>
    <DEFANGED-META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
    charset=3Dus-ascii">
    <DEFANGED-META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
    5.5.2448.0">
    <DEFANGED-TITLE>RE: (forte-users) Accelerator keys under MS Windows =
    95/98/NT</TITLE>
    </HEAD>
    <BODY>
    <P><FONT SIZE=3D2>&gt; Unfortunately, ALT key is not recognized as a =
    valid</FONT>
    <BR><FONT SIZE=3D2>key modifier on Windows</FONT>
    </P>
    <P><FONT SIZE=3D2>That isn't entirely true. The ALT key is recognized. =
    I've used it successfully</FONT>
    <BR><FONT SIZE=3D2>under Windows 95 and NT. The only annoying =
    side-effect is that you get the</FONT>
    <BR><FONT SIZE=3D2>standard operating system beep when you perform the =
    keypress.</FONT>
    </P>
    <P><FONT SIZE=3D2>-----Original Message-----</FONT>
    <BR><FONT SIZE=3D2>From: &quot;Ajith Kallambella&quot; =
    [SMTP:[email protected]] </FONT>
    <BR><FONT SIZE=3D2>Sent: Thursday, August 26, 1999 1:43 PM</FONT>
    <BR><FONT SIZE=3D2>To: &quot;[email protected]&quot; =
    [SMTP:[email protected]];</FONT>
    <BR><FONT SIZE=3D2>&quot;[email protected]&quot; =
    [SMTP:[email protected]]</FONT>
    <BR><FONT SIZE=3D2>Subject: Re: (forte-users) Accelerator keys under MS =
    Windows 95/98/NT</FONT>
    </P>
    <BR>
    <P><FONT SIZE=3D2>The Window class has a method named =
    SetAsFunctionKey</FONT>
    <BR><FONT SIZE=3D2>and an event named FunctionKeyPress. When =
    used</FONT>
    <BR><FONT SIZE=3D2>in combination, the former can be used to =
    configure</FONT>
    <BR><FONT SIZE=3D2>various accelerator keys for the window =
    widgets</FONT>
    <BR><FONT SIZE=3D2>and the latter can be used to trap them.</FONT>
    </P>
    <P><FONT SIZE=3D2>For more details, take a look at Forte online =
    help.</FONT>
    </P>
    <P><FONT SIZE=3D2>Unfortunately, ALT key is not recognized as a =
    valid</FONT>
    <BR><FONT SIZE=3D2>key modifier on Windows, but is only available =
    on</FONT>
    <BR><FONT SIZE=3D2>Unix and VMS - for reasons beyond my comprehension =
    :(</FONT>
    </P>
    <P><FONT SIZE=3D2>Hope this helps</FONT>
    </P>
    <P><FONT SIZE=3D2>Ajith Kallambella M.</FONT>
    <BR><FONT SIZE=3D2>Forte Systems Consultant.</FONT>
    </P>
    <BR>
    <P><FONT SIZE=3D2>&gt;From: &quot;Burns, Troy&quot; =
    &lt;[email protected]&gt;</FONT>
    <BR><FONT SIZE=3D2>&gt;To: &quot;'[email protected]'&quot; =
    &lt;[email protected]&gt;</FONT>
    <BR><FONT SIZE=3D2>&gt;Subject: (forte-users) Accelerator keys under MS =
    Windows 95/98/NT</FONT>
    <BR><FONT SIZE=3D2>&gt;Date: Thu, 26 Aug 1999 13:56:07 -0400</FONT>
    <BR><FONT SIZE=3D2>&gt;</FONT>
    <BR><FONT SIZE=3D2>&gt;Let's say I have a pushbutton on a window and =
    I've given it</FONT>
    <BR><FONT SIZE=3D2>&gt;label text of &quot;&amp;Search&quot;.  In =
    past developer-lives, the ampersand</FONT>
    <BR><FONT SIZE=3D2>&gt;is what gives the button the ability to respond =
    to ALT-S.  This</FONT>
    <BR><FONT SIZE=3D2>&gt;doesn't appear to be the case in Forte.  =
    What do I need to do</FONT>
    <BR><FONT SIZE=3D2>&gt;to make this work?</FONT>
    <BR><FONT SIZE=3D2>&gt;</FONT>
    <BR><FONT SIZE=3D2>&gt;Thanks in advance,</FONT>
    <BR><FONT SIZE=3D2>&gt;</FONT>
    <BR><FONT =
    SIZE=3D2>&gt;---------------------------------------------</FONT>
    <BR><FONT SIZE=3D2>&gt;Troy Burns</FONT>
    <BR><FONT SIZE=3D2>&gt;E-mail: [email protected]</FONT>
    <BR><FONT SIZE=3D2>&gt;Marriott Vacation Club International</FONT>
    <BR><FONT SIZE=3D2>&gt;941-688-7700 ext. 4408</FONT>
    <BR><FONT SIZE=3D2>&gt;</FONT>
    <BR><FONT SIZE=3D2>&gt;--</FONT>
    <BR><FONT SIZE=3D2>&gt;For the archives, go to: <A =
    HREF=3D"<a href=
    "http://lists.sageit.com/forte-users">http://lists.sageit.com/forte-users</a>" =
    TARGET=3D"_blank">http://lists.sageit.com/forte-users</A> and =
    use</FONT>
    <BR><FONT SIZE=3D2>&gt;the login: forte and the password: archive. To =
    unsubscribe, send in a new</FONT>
    <BR><FONT SIZE=3D2>&gt;email the word: 'Unsubscribe' to: =
    [email protected]</FONT>
    <BR><FONT SIZE=3D2>&gt;</FONT>
    </P>
    <BR>
    <P><FONT =
    SIZE=3D2>_______________________________________________________________=
    </FONT>
    <BR><FONT SIZE=3D2>Get Free Email and Do More On The Web. Visit <A =
    HREF=3D"<a href="http://www.msn.com">http://www.msn.com</a>" =
    TARGET=3D"_blank">http://www.msn.com</A></FONT>
    </P>
    <P><FONT SIZE=3D2>--</FONT>
    <BR><FONT SIZE=3D2>For the archives, go to: <A =
    HREF=3D"<a href=
    "http://lists.sageit.com/forte-users">http://lists.sageit.com/forte-users</a>" =
    TARGET=3D"_blank">http://lists.sageit.com/forte-users</A> and =
    use</FONT>
    <BR><FONT SIZE=3D2>the login: forte and the password: archive. To =
    unsubscribe, send in a new</FONT>
    <BR><FONT SIZE=3D2>email the word: 'Unsubscribe' to: =
    [email protected]</FONT>
    </P>
    </BODY>
    </HTML>
    ------_=_NextPart_001_01BEF001.9C8C0B50--

    Hi,Beau Leo, I am having problem installing Oracle9i Database Rel.2 on my pc.
    I read the suggestion and solution you posted for fixing Oracle 8.1.x installation
    probblem, and since my pc also hung at 48% while installing Oracle 9i software,
    I wonder if the same problem in the Oracle8 Vs.Pentium4 also exists for Oracle9i.
    I have Windows2000,256RAM, Pentium3 1Ghz, and 13.8 free diskspace. But the installation always
    hangs at 48%, my computer will just shut down and restart automatically without
    even showing an error message. I have tried installing the Enterprise edition for 3
    times already but everytime encountered the same problem. I've also tried custom installation
    by selecting not to create database, but it also hung.
    Before I started each installation, I always made sure that my registry and environment
    path are cleared and that all the partially-installed Oracle files are deleted.
    I hope that you or anyone who has a solution for this problem could be so kindly to help me out.
    Thank you in advance.
    ailee

  • Accelerator keys in MAC !!!!

    I've set accelerator keys for Refresh Action(F5) using..............
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_F5,
    0));
    thought it works on pressing F5....the accelerator is not displayed alongwith the MenuItem in the menubar. : (
    { However other accelerators for which I'm setting accelerators are working fine and showing 'Comm sign' + C........say for copy.................where i did this..........
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C,
    Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    Can Somebody suggest????....
    ALso can you tell me how can i set an accelerator for Help key in MAC..which is Command Key + '?'
    Actually I need the Key code for '?' key
    Thanks : )

    I'm sorry for editing so late...............
    The problem that accelerators not showing on the menu item is on MAC.
    THe problem is only when there;s not modifier like a Comm or Ctrl ....and the accelerator is just say F6......
    In that case the accelerator F6 is not displayed in the menuitem as it does with modifiers...and evn on Win.

  • Accelerator keys on actions

    I have a menu where i insert a lot of actions like this:
    ActionMap actions = menuBar.getActionMap();
    // fill actions with a lot of actions
    JMenu fileMenu = (JMenu) menuBar.add(new JMenu(Utils.getTextKey("menu.file")));     fileMenu.add(new JMenuItem(actions.get("action.save")));
    Each action has:
    - ACCELERATOR_KEY
    - DEFAULT
    - SMALL_ICON
    values set, and they show up in the menu with icon and a pretty shortcut with another color. But the accelerator keys doesn't work.
    So I try to make a InputMap:
    InputMap inputs = menuBar.getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW);
    for (int i = 0; i < actionList.length; i++) {
    String name = (String) actionList.getValue(Action.DEFAULT);
    actions.put(name, actionList[i]);
    inputs.put((KeyStroke) actionList[i].getValue(Action.ACCELERATOR_KEY), name);
    The accelerator keys still doesn't work!
    The MenuBar is inside a JPanel that is inside the main JPanel.
    The rest of the application is inside a lot of JPanels and JTabs and others.
    How is this supposed to work?

    Yeah, I tried that too...
    JCheckBoxMenuItem gridToggle = new JCheckBoxMenuItem(actions.get("action.grid_toggle"));
    gridToggle.setAccelerator((KeyStroke)actions.get("action.grid_toggle").getValue(Action.ACCELERATOR_KEY));
    gridMenu.add(gridToggle);
    I even tried to give the JMenuItem another KeyStroke thos way, overriding the action, and the menu had the last kaystroke, but doesn't work.
    Is there any magic that has to be initialized on the outermost frame or something to make those accelerators work?

  • Accelerator keys for a JFrame containing JTextPane

    Hi, I have written a text editing window which extends JTextPane, and is embedded in a JFrame with a menubar. I have attached accelerator key shortcuts to each JMenuItem. However, none of them work, because my extension of JTextPane implements KeyListener, and thus controls keyboard input. How do I get the accelerator keys to still work? In general they are all Ctrl-key combinations with no meaningful function in the JTextPane.

    The only way I have found around this problem is to make your JFrame a KeyListener, and add it as a KeyListener of your JTextPane. In the keyPressed method of your JFrame call the processKeyEvent method. That will route the key to the menu. I have used this for a JTable and JTree under my JFrame, but not a JTextPane. It should work the same.
    I have heard rumors that this will be fixed in 1.4. Pretty lame that it is so difficult to do.

  • Windows XP, Battery indicator disappeared

    After I performed Windows Update (Windows XP), the blue battery indicator disappeared from the task bar. Normally when the computer ran on battery, there was a battery indicator next to the clock and showed the battery level. Now, I see the battery indicator only after I uninstall the Toshiba Power Saver Utility. Obviously there is a conflict between the utility and one of the updates. Any ideas?

    If you would like to see the Blue Battery, you can go to the Control Panel/ Power Options then Advanced and check the "Always show Icon in the Task Bar" item. As far as I know you can not use MS power management and Toshiba tool at the same time. If you use MS power options the Toshiba tool will be disabled.
    Bye

  • I can't seem to find the bar with "file, edit, view, etc". I can view it if I press "alt", but when I hit any other key it disappears again. The back and forward arrow, house, refresh and "url" space is missing

    I can't seem to find the bar with "file, edit, view, etc". I can view it if I press "alt", but when I hit any other key it disappears again. The back and forward arrow, house, refresh and "url" space is missing

    * In Firefox 3.6 and later on Windows you can hide the "Menu Bar" via "View > Toolbars" or via the right-click context menu on a toolbar.
    * Press F10 or press and hold the Alt key down to bring up the "Menu Bar" temporarily.
    * Go to "View > Toolbars" or right-click the "Menu Bar" or press Alt+V T to select which toolbars to show or hide (click on an entry to toggle the state).
    See also:
    * [[Menu bar is missing]]
    * http://kb.mozillazine.org/Toolbar_customization

  • GlassComponent and accelerator keys

    Hi.
    I am using the GlassComponent class picked up from one of
    the earlier postings. It works fine except this scenario.
    I have attached acclerators to menu items. When watch cursor
    is on sometimes it is possible to specify the accelarators
    keys and initiate an action. Does the accelerator keys need
    some special blocking.
    public class GlassComponent extends JComponent implements
                                  AWTEventListener {
    Window parentWindow;
    public GlassComponent() {
         super();
         this.setCursor(Cursor.getPredefinedCursor
              (Cursor.WAIT_CURSOR));
         setOpaque(false);
         addMouseListener(new MouseAdapter() {});
    // Override setVisible to install/remove key events hook
    // that will allow us to disable key events when the
    // glass pane is visible.
    public void setVisible(boolean visible) {
         if (visible) {
         if (this.parentWindow == null)
              this.parentWindow =
              SwingUtilities.windowForComponent(this);
         Toolkit.getDefaultToolkit().addAWTEventListener
              (this, AWTEvent.KEY_EVENT_MASK);
         else {
         Toolkit.getDefaultToolkit().removeAWTEventListener
              (this);
         super.setVisible(visible);
    // Called whenever ther is an event in AWT queue. Note that
    // the current implementation
    // skips all key events, not just events for this window.
    // Logic can be enhanced to examine
    // the source of the event and it's parent window and skip
    // only those events
    // that originated from disabled window
    public void eventDispatched(AWTEvent event) {
         if (event instanceof KeyEvent && event.getSource()
         instanceof Component) {
         if (SwingUtilities.windowForComponent((Component)
                        event.getSource()) == this.parentWindow)
              // Consume events only for our window
              ((KeyEvent)event).consume();
    public class GlassComponent extends JComponent implements
                             AWTEventListener {
    Window parentWindow;
    public GlassComponent() {
         super();
         this.setCursor(Cursor.getPredefinedCursor
              (Cursor.WAIT_CURSOR));
         setOpaque(false);
         addMouseListener(new MouseAdapter() {});
    // Override setVisible to install/remove key events hook
    // that will allow us to disable key events when the
    // glass pane is visible.
    public void setVisible(boolean visible) {
         if (visible) {
         if (this.parentWindow == null)
              this.parentWindow =
              SwingUtilities.windowForComponent(this);
         Toolkit.getDefaultToolkit().addAWTEventListener
              (this, AWTEvent.KEY_EVENT_MASK);
         else {
         Toolkit.getDefaultToolkit().removeAWTEventListener
              (this);
         super.setVisible(visible);
    // Called whenever ther is an event in AWT queue. Note that
    // the current implementation
    // skips all key events, not just events for this window.
    // Logic can be enhanced to examine
    // the source of the event and it's parent window and skip
    // only those events
    // that originated from disabled window
    public void eventDispatched(AWTEvent event) {
         if (event instanceof KeyEvent && event.getSource()
         instanceof Component) {
         if (SwingUtilities.windowForComponent((Component)
                        event.getSource()) == this.parentWindow)
              // Consume events only for our window
              ((KeyEvent)event).consume();
    Thanks
    Mahesh

    I took the same thing from earlier postings. But it didn't work.
    Its taking key events. (In my case menu aceelerators are getting enabled by the user when watch cursor is on)

Maybe you are looking for

  • How can I reset my iCloud password when It's hacked?

    Someone hacked my iCloud. I tried to get the password back but i forgot one of my security questions. I thought "I'll just make a new iCloud and sign out of the old one". Well, I put the "Find my ipod" app on it and I can't sign out with out the pass

  • Default File for folder

    Hi everybody I have a KM Navigation iView which display the content of a folder. On the left I have the files in a layoutset of a Tree, and when choosing one of the files, its preview appears on the right. The problem is that by default, if you don't

  • Skype doesn't login automatically

    Hello, My skype app updated automatically to version 5.3.0.65524 a couple of days ago. I just noticed that when I start the app it ask my username and password, something that didn't happened in the past, even when I "close session" on skype.  (once

  • How to compile a Java file

    Hi All, I am extending a seeded CO and when I try to compile it in JDev , it asks for many class files the seeded CO imports. I have copied all those imported files to my local system and when I try to compile , it still throws an error that some cla

  • Problem with the artists view!

    My iTunes 11 isn't displaying an artist pic for Ke$ha anymore in the artists view! What can I do? I hope someone can help me!