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.

Similar Messages

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

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

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

  • 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

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

  • Accelerator keys temporarily unavailable after changin JMenuBar objects

    We have an application that needs to toggle between two different JMenuBar objects depending on what the user is doing. So our primary window constructs the two menus, stores both, and switches which one it is using with setJMenuBar.
    The problem is that, on Windows, the first time we switch menus, all the accelerator keys stop working until the user takes a mouse action in the frame somewhere. If the user operates any widget (like a menu item or button), or even opens a menu but doesn't click anything, all the accelerators suddenly become available.
    Actions that DO cause the accelerators to become available:
    - A mouse click on a widget inside this frame (as long as the click is not entirely consumed by an internal element)
    - Resizing the window
    - Minimizing / restoring the window
    - Switching to another application and back
    - Simulating any such mouse click with a Robot
    Actions that DON'T cause the accelerators to become available:
    - Mouse Moves
    - Clicks on internal widgets that implement MouseListener
    - Programmatically operating widgets with doClick(), even if clicking on that widget would re-enable the accelerators
    NOTE: this seems to only affect Windows. I haven't tried it on Linux yet, but the bug does not affect Mac OS X, so it doesn't look like I'm doing anything explicitly wrong when I switch menu bars.
    Has anyone else seen this, or can you suggest a fix or workaround? My current workaround is to simulate a click on the menu bar with a Robot after the first time we switch menu bars. But that's terribly kludgy and I'd like to find a better solution.
    Thanks,
    Evan
    Edited by: IdahoEv on Jun 21, 2009 4:15 PM
    Edited by: IdahoEv on Jun 21, 2009 4:16 PM

    Has anyone else seen this,No.
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Using accelerator keys for loading a appliaction made with J2ME

    Hi
    Is there any methods to use accelerator keys to load a application made with J2ME for mobile telephones. The application is not running and i must find a way to load the application using keys codes.
    How can i accomplish this? can i use the application manager and the jad file? i know that i can use PushRegistry for incomming connections to load the application automaticaly. But i need a way to accomplish this by using the key events on a mobile phone when the application is closed.
    Best Regard
    jan Fredrik Fallsen

    Hi
    Is there any methods to use accelerator keys to load a application made with J2ME for mobile telephones. The application is not running and i must find a way to load the application using keys codes.
    How can i accomplish this? can i use the application manager and the jad file? i know that i can use PushRegistry for incomming connections to load the application automaticaly. But i need a way to accomplish this by using the key events on a mobile phone when the application is closed.
    Best Regard
    jan Fredrik Fallsen

  • Unresponsive accelerator keys

    I have a JMenuBar with a bunch of standard menus--File, Edit, and so forth. I've defined accelerator keys for a bunch of the menu items. I find when I start the app, the first accelerator key I use works, and thereafter they mostly don't. I wouldn't be super concerned--I can still get the function to work via menu selection with the mouse--but I'm also having trouble receiving keystrokes in other components (Behaviors triggering on a KeyEvent in a Java 3D window.)
    It's easy to debug when things happen and they happen wrong. I'm finding it difficult to debug this because nothing is happening at all.
    If this is obvious to anyone let me know. If anyone has any debugging tips let me know.
    Here's a sample from my MenuBar:
    public class MenuBar extends JMenuBar {
        private ArrayList<JMenuItem> editModeAvailableItems;
        public MenuBar() {
            editModeAvailableItems = new ArrayList<JMenuItem>();
            int keymask = 0;
            if(Util.isMac()){
                keymask = ActionEvent.META_MASK;
            }else if (Util.isWindows()){
                keymask = ActionEvent.CTRL_MASK;
            final JMenu fileMenu = new JMenu("File");
            JMenuItem newMenuItem = new JMenuItem("New");
            newMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                    keymask));
            newMenuItem.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    InstrumentManager manager= InstrumentManager.getInstance();
                    if(manager != null){
                        if (manager.getInstrumentContainer().isUpdated()){
                            int answer = JOptionPane.showConfirmDialog(fileMenu,
                                            "current file has been modified.",
                                            "Warning",
                                            JOptionPane.OK_CANCEL_OPTION,
                                            JOptionPane.WARNING_MESSAGE);
                            if(answer==JOptionPane.OK_OPTION){
                               manager.newPantsFile();
                        }else{
                            manager.newPantsFile();
            fileMenu.add(newMenuItem);
            JMenuItem openMenuItem = new JMenuItem("Open");
            openMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,
                    keymask));
            openMenuItem.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    InstrumentManager manager= InstrumentManager.getInstance();
                    if(manager != null){
                        if (manager.getInstrumentContainer().isUpdated()){
                            int answer = JOptionPane.showConfirmDialog(fileMenu,
                                            "current file has been modified.",
                                            "Warning",
                                            JOptionPane.OK_CANCEL_OPTION,
                                            JOptionPane.WARNING_MESSAGE);
                            if(answer==JOptionPane.OK_OPTION){
                               manager.openPantsFile();
                        }else{
                            manager.openPantsFile();
            fileMenu.add(openMenuItem);
            JMenuItem saveMenuItem = new JMenuItem("Save");
            saveMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
                    keymask));
            saveMenuItem.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    InstrumentManager manager= InstrumentManager.getInstance();
                    if(manager != null){
                        manager.savePantsFile();
            fileMenu.add(saveMenuItem);

    jstoner wrote:
    If anyone has any debugging tips let me know.For checking the focused window, we could do something like this:
    FocusManager.getCurrentKeyboardFocusManager()
            .addPropertyChangeListener(new PropertyChangeListener() {
        public void propertyChange(final PropertyChangeEvent evt) {
            if (evt != null && evt.getPropertyName().equals("focusedWindow")) {
                Window window = (Window) evt.getNewValue();
                if (window != null) {
                    // when the focused window is not the frame containing the
                    // accelerators, they will not work
                    System.out.println(window);
    });

  • Accelerator keys for push buttons

    Hi,
    Does anyone know how can I define accelerator keys for push buttons. with ALT+underlined char. can I directly execute the button? If yes, how can we do that?
    Regards,
    Panneer

    Hi,
    As I know, GUI XT could be used to change the screen style. The pushbutton command could be used to add pushbutton.
    But after checking the material, I found it could only use SAP predefined accelerator keys which is in the PF-STATUS.
    FYI:
    Pushbutton
    Purpose With Pushbutton you can create your own pushbuttons within an R/3 screen or within the toolbar. You can make both the menu functions and the navigation to other transactions directly accessible with your own pushbuttons.
    Example
    Pushbutton (10,50) "Split Screen Editor" "SCMP"
    You create a pushbutton at row 10, column 50 with text Split Screen Editor. Clicking on the button invokes the internal code SCMP which then starts the Split Screen Editor.
    Internal codes How do I find the internal codes?
    Choose the desired function in the transaction menu and press F1 while the mouse cursor points to this function. Now the R/3 system displays the internal function code in a pop-up window
    Format Pushbutton (row,column) "Pushbutton text" "FCode" Process="..." 
    Adds a pushbutton on position (row,column). The pushbutton invokes the internal code FCode. This can be a code from the menu, e.g. SCMP, or a transaction code like /NFB01 or /OMM02.
    Process="..."  relates to the InputScript file. You can omit the "fcode" parameter if only "Enter" is needed in order to continue with the transaction.
    Pushbutton (Toolbar) "Pushbutton text" "FCode"
    Adds a pushbutton in the application toolbar. A free function key is assigned automatically and displayed in the quickinfo.
    *Pushbutton (Toolbar) "Pushbutton text" "FCode" "Fkey"*
    *Optionally you can specify a function key of your choice as an additional parameter Fkey using the format F1,..F12, ShiftF1,...,ShiftF12, CtrlF1,...,CtrlF12, ShiftCtrlF1,...,ShiftCtrlF12. If this function key is already in use the system chooses the next available number.*
    *example: Shift+F5  ->  F17, F3 -> F3* 
    Cheers

  • Javafx accelerator keys

    I have found information about how to setup accelerator keys, but they seem to be attached to the scene instead of the control.  This would work fine, but it seems that even when the control has been removed, replaced or even disabled the control the accelerator key still wants to fire.  Is there another way to do this, for example have the action event of a button fire when you press "CTRL-S", but only when the button is active and visible.
    Thank you

    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.

Maybe you are looking for

  • Printer is in use message, and unable to print!

    Good Afternoon- I work with a copier sales/service company, and I've been dealing with a driver installation issue that I'm hoping SOMEONE can help me with. When installing a copier on a customer network, I use the manufacturer's installer file, and

  • I can't remember my administrator password for iMac

    I can't remember my administrator password for my mac. Any suggestions?

  • HELP! Capital One not reporting correctly

    Hello everyone,I filed my case BK 7 on 05/15/2015, had my 341 meeting, and am now patiently awaiting my discharge to arrive in the mail.  I've been monitoring my credit report via CreditKarma and have been noticing most of my accounts being updated a

  • Network Adapter for G41-Z77A?

    Hey, so one day my internet stopped working after my friend moved my computer, and judging from the fact that I can't find the network adapter in the hardware when looking at the system specs  (that thing that usually says what drivers you have insta

  • Having trouble converting photos to crisp web images

    I am using CS2 on Mac OSX 10.4.11. I've been trying to figure the best way to do this for a few years now. I am an invitation designer and I photograph my products to be used as images on my web site. I'm starting with a 3008x2000 pixel image at 300