Trapping KeyEvents anywhere in a JFrame for a status bar

Hi all,
There are a few examples of how to implement a status bar in the archives, but I haven't seen anything that tells you how to trap KeyEvents (e.g. pertaining to CapsLock etc.) which occur anywhere in a JFrame: once you start adding focusable components (particularly but not exclusively JTextComponents) to a JFrame the JFrame itself is often not sent the KeyEvents, so a rudimentary addKeyListener() is not the answer.
Could this involve the use of KeyboardFocusManager or sthg? NB to experts: I have read the tutorial on the focus subsystem to no avail. The key seems to be to trap the event thread in some way, perhaps??
All help greatly appreciated...
Mike

Add a AWTEventListener on Toolkit.getDefaultToolkit() with appropriate mask. See javadocs of addAWTEventListener method.

Similar Messages

  • Jframe on the Status Bar

    I want that JFrame which is currently opened should not appear on the WindowXP task bar.Can any one of u help me.

    To clarify the post above, the JLabel is typically added to the south part of the window. Lowered BevelBorder gives the status bar look familiar to most users.
    Good luck.

  • Will a wifi widget be released for the status bar or is there already one that I don't know about??

    I'm a new iphone user. I have an iphone 4. Maybe there is one as it is a common feature on smartphones. I probably just haven't found it but can someone steer me in the right direction please

    crap I meant to select the answer from as most helpful and best .... Meg St._Clair. sorry accidentally selected my own . silly comp stalled at wrong time.

  • JFrames withous status bar with "Java Applet Window" ?

    Hello.
    I call a JFrame from JApplet. All my JFrames with a status bar where string "Java Applet Window" is showing. How can I creat JFrames without that status bar?
    Thank you in advance.

    This shows as a security measure because your applet isn't "signed". Your applet must be signed in order for this to not show.
    Refer to the following for a how-to:
    http://java.sun.com/developer/qow/archive/167/index.jsp

  • Can't create a status bar for my window

    I'm trying to add a status bar to a window I've created. I've tried to get this to work by doing this:
    frame = new JFrame();
    canvas = new CanvasPane();
    frame.setContentPane(canvas);
    frame.setTitle(title);
    canvas.setPreferredSize(new Dimension(width, height));
    backgroundColour = bgColour;
    Container contentPane = frame.getContentPane();
    JLabel statusLabel = new JLabel("This is the status bar");
    contentPane.add(statusLabel, BorderLayout.SOUTH);
    Everything works except for the status bar. What am I doing wrong?

    in the above example, the poster is taking it for granted that you class extends the JFrame class. In case not then you have do as follows:
    myFrameName.getContentPane()."What ever else";Also before starting to put thing using the border layout do as follows:

  • Keypress listener anywhere in a JFrame

    Hello!
    I want to listen for a keypress (F12) from anywhere in my JFrame window, exactly like if I added a menubar with an accelerator.
    I can't just register a KeyListener on the JFrame because I have serveral panels on it.
    Any ideas?
    //John

    Thanks! works great now, here is the code if anybody is intrerested:
          private void addKeyBindings() {
               Action finishAction = new AbstractAction() {
                    private static final long serialVersionUID = 1L;
                    public void actionPerformed(ActionEvent e) {
                         onButtonFinishClick( e ); //Forward
               //Set input actions
               InputMap im = _bFinish.getInputMap( WHEN_IN_FOCUSED_WINDOW );
               ActionMap am = _bFinish.getActionMap();
               KeyStroke ks = KeyStroke.getKeyStroke( "F12" );
               im.put( ks, "onf12" );
               am.put( "onf12", finishAction );
          }

  • HT4539 I sign up for the racing post app each month but didnt print past invoices off and now cant find them anywhere and need them for my books how do i find them

    I sign up for the racing post app each month but didnt print past invoices off and now cant find them anywhere and need them for my books how do i find them

    If you wish to submit comments to Apple, the best way is to use their feedback pages.
    http://www.apple.com/feedback/itunesapp.html
    It's not likely that anyone from Apple will see your comments here among the thousands of other posts.
    Regards.

  • Is there anywhere a technical manual for the NB100 ?

    Is there anywhere a technical manual for the NB100 ?
    I want to replace my internal harddisk with a bigger one and don´t want to destroy anything so a manual for the best way to open the NB100 would be a good thing :-)
    cola

    The upgrade is not that hard. There is no need to completely disassemble the unit. Remove the screws from the underside, then remove the cover at the top of the keyboard (the cover with the on/off switch on). Remove the screws from under the cover and then remove the keyboard, gently unclipping the ribbon. unclip the ribbon for the touchpad and the wireless aerials (x2). At this stage the HDD is accessible on the left side, remove the screws and gently pull the HDD out.
    Once the new drive is fitted, reverse the procedure. I had no option but to replace mine, as I was on an overseas trip when the Toshiba HDD failed (the system was saying I had no HDD fitted) and as I had only taken the NB100 with me I had no choice if I wanted a working laptop for the trip, I stripped my external HDD and fitted it into the NB100, I now have a NB100 with a 250 GB HDD and it's perfect.

  • HT203167 I downloaded two movies from itunes at the same time (both free digital copies from a dvd) and when they finished downloading... they disappeared. I've not been able to re-download them or find them.. anywhere. Any suggestions for tracking them d

    I downloaded two movies from itunes at the same time (both free digital copies from a dvd) and when they finished downloading... they disappeared. I've not been able to re-download them or find them.. anywhere. Any suggestions for tracking them down?

    If you downloaded them on your computer's iTunes then they should have gone into the Movies part of your iTunes library, if on a device (iPad, iPhone or iPod Touch) then into the Videos app - they haven't appeared there ?
    If you downloaded on your PC and they don't show in the Movies section then you could try searching for them by name (or part of their name) via windows explorer and see if that finds them. Or if you downloaded them on a device and they aren't in the Videos app then have you got a film age rating set in Settings > General > Restrictions that is hiding them, and if not can you find them via the device's spotlight search screen (swipe your first homescreen to the right) ?

  • Is there a drop down calendar for the tool bar

    can anyone tell me, is there a drop down calendar for the tool bar?

    have that already.  thank you for the info.  was looking for a calendar like what i had with windows, where you clicked on it, it showed the month without going anywhere else

  • Report for PO status

    Hello Experts ,
    Can you tell me the standard report for the status of PO as in GR qty , value , in voiced qty & value etc & open qty & value ??
    Regards

    hi,
    There is no direct report, but for a single material you can check the PO history from ME2N etc reports...
    After executing the report there is the PO history tab...in it can see it individually...
    But from the table you can see collectively...
    Hope it helps..
    Regards
    Priyanka.P

  • What is table field name for order status report  of rate per unit and  bal

    hi  i want to make FS for order status report i almost get all table and field but i don't get only two field  rate per unit and balance value  table field didn't get please help me searching in field and table
      i want to develop my status report

    Hi,
    Check tables VBAK and VBAP wherein you will get all header and item details.
    VBUK and VBUP for header and line item statuses.
    KONV would give you rates/pricing details for each condition type determines in the sales order.
    VBAK-KNUMV = KONV-KNUMV is how you relate both of them.
    Hope that helps.
    Regards,
    Amit

  • Coding for PFS status button in ALV report.

    Hi,
    Can anyone please tell me how to write code for PFS status buttons which we enable in ALV report to make them work according to required functionality.

    Hi,
         In the ALV, Pass the user command form name in the parameter i_callback_user_command .
    then create a sub routine like below and do the coding,
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program       = g_repid
          i_callback_pf_status_set = 'PF_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
            TABLES
          t_outtab                 = gt_output
        EXCEPTIONS
          program_error            = 0
          OTHERS                   = 0.
    FORM user_command USING pa_ucomm TYPE syucomm
                            pa_selfield TYPE slis_selfield.    
    CASE pa_ucomm.
       WHEN 'BACK'.
              <<UR CODE>>
    ENDCASE.
    ENDFORM.
    reward points if usefull
    Regards,
    Niyaz

  • HT201343 My MacBook Pro is a 15 inch Early 2011 Model i was using airplay for a while and now suddenlly i dont see it on my status bar?

    My MacBook Pro is a 15 inch Early 2011 Model i was using airplay for a long time and i could always turn it on from my status bar and now recently i cant seem to find it on my status bar and it says Apple TV is not connected

    Hi LoganXDasz,
    If you are having issues with AirPlay availability, you may find the following article helpful:
    Apple Support: Troubleshooting AirPlay and AirPlay Mirroring
    http://support.apple.com/kb/ts4215
    Cheers,
    - Brenden

  • HT1386 i got a refurbished phone to replace broken; synced with icloud no problem.  But when syncing with itunes, it finds the apps and any other items that still need to be synched but i have had the phone plugged in for over 5 hours and the status bar s

    The status bar says: waiting for items to copy.    But it shouldn't take this long should it????

    PinguXeF wrote:
    , while I have taken a backup of the iTunes Library,
    this means nothing if it was not done correctly...
    To have  EVERYTHING on a New Computer...
    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751

Maybe you are looking for

  • Record store size?

    are there any limitations to which a record store can expand? or to maximum number of record store a application can create? thanks

  • Flash CS4 presentation slideshow. help!

    Hello everyone! I need help creating a presentation slideshow in Flash CS4 for an online course with many slides. The outlook is that it would look and work very much like power point except that it will be done through Flash CS4 and uploaded online.

  • WMV Convert

    Hello, I am making a dvd in iDVD. I shot the footage from it with my semi-new digital video camera, but I downloaded the footage on my PC last year so it downloaded as WMV. Now that it is on my mac I am trying to convert that file to mpg or something

  • Since latest Lion upgrade it keeps asking me to sync contacts

    Ever since the latest Lion upgrade, I regularly get a popup window asking me to sync contacts. I haven't synced contacts (or calendars) through MobleMe in years. All I do is make sure my computer/iPhone uses my Google contacts. First I turned off syn

  • Weekdays and dates

    hi all, i have the following two requirements. Please let me know if there are any function modules for the same. 1) I have a From-Date and a To-Date. Within this interval i want to find all the nth days of week. for example for n = 2, i want the dat