How to use Ctrl + -- or Ctrl + -- key to act as Tab or Tab + Shift

In JDK 1.4, I try to use Ctrl + --> key to act as Tab key, and use Ctrl
+ <-- key to act as Tab + Shift key, I would like to find a solution
for whole application instead of adding key listener for each individual
component, how to implement it easily? Any suggustions? Thanks!

Not sure if this will help, but you can listen for all AWT Events by adding a AWT Listener to you class. Here is an example that listens for MouseEvents:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class TestEventQueue extends JFrame
     public TestEventQueue()
          Toolkit.getDefaultToolkit().addAWTEventListener( new AWTEventListener()
               public void eventDispatched(AWTEvent e)
                    System.out.println(e);
          }, AWTEvent.MOUSE_MOTION_EVENT_MASK + AWTEvent.MOUSE_EVENT_MASK  );
     public static void main(String[] args)
          JFrame frame = new TestEventQueue();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.setSize(200, 200);
          frame.setVisible(true);
}

Similar Messages

  • HT201612 how to use ctrl+alt+delete to restart with boot camp

    how to use (ctrl+alt+delete) to restart?

    You press all the keys (ctrl+alt+delete) at once
    Some information
    In a personal computer with the Windows operating system, Ctrl-Alt-Delete is the combination of keyboard keys that the computer user can press at the same time to terminate an application task or to reboot the operating system (have it shut down and restart itself). In Windows 95 or any later systems, Ctrl-Alt-Delete brings up a window that allows a user to see the status of all currently running programs and to terminate any of them, and also offers the options of shutting down, restarting, and so on (the specific options vary slightly with the particular version of windows). In Windows 95 or 98, if Ctrl-Alt-Delete is pressed a second time or twice in a row quickly, the operating system closes all programs that are running and then restarts.
    When the operating system seems to hang suspended while waiting for an application program to continue, a user is also left without a way to regain control of the system. The Ctrl-Alt-Delete key combination allows the user to terminate the "hung" application and, if that doesn't work, to reboot the system. The system can also be restarted using the mouse to select Start-->Turn Off the System-->Restart. However, Ctrl-Alt-Delete sometimes works when the menu option doesn't.

  • Short cut for Radio buttons (using Ctrl+ key)

    How can I select deselect Radio buttons using Ctrl + keys. I know that setMnemonic can be used to access using Alt + key. But I want to use Ctrl also. Please suggest the solution. How can I select using only single key?

    Read the API for a meaning of each of the arguments. Here is a simple example showing how to assign an "Action" to the Ctrl+1 and Ctrl+2 keys:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class KeyboardAction extends JFrame
        public KeyboardAction()
            JPanel panel = new JPanel();
            setContentPane( panel );
            JTextField textField1 = new JTextField("Ctrl+1 or Ctrl+2", 10);
            panel.add( textField1 );
            JTextField textField2 = new JTextField("Ctrl+2", 10);
            panel.add( textField2 );
            //  Change the input map of the text field,
            //  therefore, Ctrl+1 only works for the first text field
            Action action1 = new SimpleAction("1");
            Object key1 = action1.getValue(Action.NAME);
            KeyStroke ks1 = KeyStroke.getKeyStroke(KeyEvent.VK_1, KeyEvent.CTRL_MASK);
            textField1.getInputMap().put(ks1, key1);
            textField1.getActionMap().put(key1, action1);
            //  Change the input map of the panel
            //  therefore, Ctrl+2 works for both text fields added to the panel
            Action action2 = new SimpleAction("2");
            Object key2 = action2.getValue(Action.NAME);
            KeyStroke ks2 = KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK);
            panel.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(ks2, key2);
            panel.getActionMap().put(key2, action2);
        class SimpleAction extends AbstractAction
            public SimpleAction(String name)
                putValue( Action.NAME, "Action " + name );
            public void actionPerformed(ActionEvent e)
                System.out.println( getValue( Action.NAME ) );
        public static void main(String[] args)
            KeyboardAction frame = new KeyboardAction();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setVisible(true);
    }Also, if you search the forum using the keyword "getActionMap", I'm sure you'll find other example.

  • How to setting Ctrl Key: PM02 not become auto generate PR ?

    Hi Gurus,
    While using Ctrl Key: PM02 (For External) for creating Maintenance Order, Purchase Requisition (PR) will generated automatically.
    Can we make it not automatically, so then person responsible to create PR will create PR base on Maintenance Order. This requirement base on our client environment while person who create Maintenance Order is from different department and Maintenance Order person must not create PR.
    I am waiting for your knowledge sharing in this issue.
    Regards,

    Hi,
    Generation of PR can not be controlled through control key , however generation of PR can be controlled for a order type through
    Maintenance and service order->Functions and settings for order type->define change docs.collective PR indicator
    Hope that it helps.
    With regards,
    Mrinal

  • Selection of multiple rows w.o using ctrl key

    Hi,
    I have to select multiple rows of ALV w/o using ctrl key.
    is it possible ????
    Iam displaying ALV using set_table_for_first_display.
    Thanks in advance,
    Regards
    Anagha Deshmukh

    hi
    check this thread
    Re: Selecting multiple rows in ALV grid display
    hope it helps you.
    thanks
    Sachin

  • How to use Ctrl+X

    Hello friends
    I want to trap Ctrl+x to achieve some short key, I have written this code but it is not working. In this code if we change isControlDown() to isAltDown() or isShiftDown() then it is working for Alt and Shift key but not for Control Key.
    addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent KEv) {
    if(KEv.isControlDown() && KEv.getKeyCode() == KeyEvent.VK_X) {
                             System.out.println("Ctrl+X");
    Please help me, how to use Control Key?

    hello... I am not sure if this solve your problem but... it is not this
    if(KEv.isControlDown() && KEv.getKeyCode() == KeyEvent.VK_X)
    it this
    if(KEv.isControlDown() && (KEv.getKeyCode() == KeyEvent.VK_X))
    if not, please post the message.

  • OpenScript : How to simulate ctrl key down?

    Hi,
    How do I simulate ctrl key down action in OpenScript?
    Couldnt get much info from oracle.oats.scripting.modules.functionalTest.api.FunctionalTestService.typeKeys() documentation about the keys value to be used.
    Or is there any better way?
    Thanks,
    Deepak

    I wanted to select multiple elements so I wrote the code like below,
    Robot robot = new Robot();
    robot.delay(1000);
    robot.keyPress(KeyEvent.VK_C);
    web.element(xpath).click();
    web.element(xpath1).click();
    web.element(xpath2).click();
    robot.keyRelease(KeyEvent.VK_C);
    Didnt work, so I tried keypress before each element click, but still that also didnt help.
    Same case with
    web.element("/web:window[@index='0']/web:document[@index='0']")
    .keyPress("<CTRL-SHIFT-F5>")
    My requirement is, I need to click multiple elements with Control key down.
    Please suggest me a solution.
    Thanks,

  • Any one know how to use "custom" option present under the data access tab in XLS file format of Data Services

    Hi Experts,
            Any one know how to use or what is the purpose of "custom" option present under the data access tab in Excel workbook file format of Data Services
    Thanks in Advance,
    Rajesh.

    Rajesh, what is the Custom Protocol you are trying to use? It should be  something like PSFTP, etc.,
    Cheers
    Ganesh Sampath

  • How to use a non cumulative key figure in a multi planning area

    Hi
    I'm new to bps, my problem is
    I need to read the last stock quantity and value at plant and material level to do further calculations in a fox formula, so i made a planning area for the cube 0rt_c36 and another for my tc cube where the results should go, then i combine these areas in a multiplanning area.
    problems arise when selecting the key figure in the ratios tab of the multi area, the ratios 0CPTOTSTOBU (last stock) and 0CPTOTSTOPV (last stock purchase value) are not available, only the inflow and outflow ratios are 0CPTOTREBU and 0CPTOTREPV.
    I know when reporting, the actual value for stock is calculated by  bex, namely, there is no data store at database level, so the question is:
    How to obtain last stock for using in bps??
    thank you for any help
    regards
    A. Garduñ

    Hi Azael,
        In the How to Papers, you will find a Guide on how to take a Sanpshot view of the Stocks(How To Handle Inventory Management Scenarios in BW). Basically if you implement the Guide, you will have another cube called ICSNAP1, which will contain stock quantities /values at the end of each month. You will therefore have to take stock at the end of the last month from that cube and add up the relevant receipts and issues to arrive at the current Stock or Stock as on a particular date.
    Hope this helps!
    Regards
    Sriram

  • How to use Restricted or Calculated Key figure with Characteristics?

    Hi,
    Query has characteristics 'Indicator' which has values  'X' and 'Y' depending this value, the Key figure Quantity(which is always +ve) has to be shown on the report either as -ve or +ve.
    Do I use Restricted Key figure if so, how? Or can I manage with a Calculated Key figure?
    Thanks,
    Kamala

    Hi Kamala,
    You can create 2 RFKs each in which you are restricting the KF with char value X and Y. For the one that needs to be -ve, create a CKF with this RKF and multiply it by -1 in the formula. Then you can create a new CKF that will add this CKF and the other RKF.
    Hope this helps...

  • I need help figuring out how to use my print screen key

    I have an HP Pavilion Entertainment PC dv7-1245. The key is above the num lock key  - it has "home" which works when I press it but under that it has "prt sc" but I don't know what to hit along with it to make it work. I tried the shift key, the alt key, the fn key and nothing works. I even looked in the manual and those keys above the num lock key are not even referenced.

    to capture active windows the key combo is ctrl+alt+fn+print sc
    Although I am an HP employee, I am speaking for myself and not for HP.
    Make it easier for other people to find solutions, by marking my answer with 'Accept as Solution', if it solves your problem.
    Click on the BLUE KUDOS button on the left to say "Thanks"

  • How to use comboBox as the key to display multiple textInput fields?

    All,
        I am new in Flex and need to help!
    I have selected rows from database and need to display on one comboBox with several textInput fields. The function need to
    1) After the page complete load, the comboBox display the ID (unique key of the row).
        and all fields should fill by the columns with the ID. ( I did it with only one textInput)
    2) When it selects an ID from comboBox, all fields with the ID should change accordingly.
    See attached file.
    Please help.
    Thank you in advance!

    Hi,
    there is an example. All you need to receive your data and
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:XML id="tstData" xmlns="">
    <yueventlists>
    <yueventlist event_id="EMB09">
      <event_id>EMB09</event_id>
      <stvcoll_desc>Albert Einstein College of Med</stvcoll_desc>
      <LOCATION_NAME>Bronx comm center</LOCATION_NAME>
      <LOCATION_ROOM>101</LOCATION_ROOM>
      <LOCATION_CONTACT />
      <PHONE />
      <FAX />
      <STREET />
      <CITY_PROVINCE>New York</CITY_PROVINCE>
      <STATE>NY</STATE>
      <ZIP>10471</ZIP>
      <COUNTRY />
      </yueventlist>
    <yueventlist event_id="EMB10">
      <event_id>EMB10</event_id>
      <stvcoll_desc>Albert Einstein College of Med</stvcoll_desc>
      <LOCATION_NAME>Bronx Red Lobster</LOCATION_NAME>
      <LOCATION_ROOM>102</LOCATION_ROOM>
      <LOCATION_CONTACT />
      <PHONE />
      <FAX />
      <STREET />
      <CITY_PROVINCE>New York</CITY_PROVINCE>
      <STATE>NY</STATE>
      <ZIP>10463</ZIP>
      <COUNTRY />
      </yueventlist>
    <yueventlist event_id="YUD09">
      <event_id>YUD09</event_id>
      <stvcoll_desc>Yeshiva University</stvcoll_desc>
      <LOCATION_NAME>Chelsea Piers Pier Sixty</LOCATION_NAME>
      <LOCATION_ROOM>103</LOCATION_ROOM>
      <LOCATION_CONTACT>0</LOCATION_CONTACT>
      <PHONE>0</PHONE>
      <FAX>0</FAX>
      <STREET>0</STREET>
      <CITY_PROVINCE>New York</CITY_PROVINCE>
      <STATE>NY</STATE>
      <ZIP>10033</ZIP>
      <COUNTRY>0</COUNTRY>
      </yueventlist>
      </yueventlists>
    </mx:XML>
    <mx:Form x="126" y="57">
    <mx:ComboBox id="cmbID" dataProvider="{tstData.*}" labelField="@event_id"></mx:ComboBox>
    <mx:FormItem label="School Name">
    <mx:TextInput id="schoolName" text="{cmbID.selectedItem.stvcoll_desc}"/>
    </mx:FormItem>
    <mx:FormItem label="Location Name">
    <mx:TextInput id="locName" text="{cmbID.selectedItem.LOCATION_NAME}"/>
    </mx:FormItem>
    </mx:Form>
    <!-- and so on... -->
    </mx:Application>

  • Enter key to act like tab key in JTable

    I have programmed a JTable application. I want that if I press 'Enter' key in the JTable cell, the cell at right side may be selected after validating input. Similarly, when I press 'Enter' in the right most cell, the first cell of the next row may be selected after validating input.
    In other words, I like 'Enter' key to behave as forward navigational key in JTable cells like 'Tab' key, however, after validating input.
    The following is the piece of code which is not working for me. Though, it changes selection border to the next cell on pressing enter, but the focus is not shifted and editing remains in the current cell.
    //voucherTable is a JTable object with three columns.
    Action moveForward = new AbstractAction() {
    public void actionPerformed(ActionEvent e) {
    int r=voucherTable.getSelectedRow();
    int c=voucherTable.getSelectedColumn();
    if(c==2){
    c=-1;
    r+=1;
    voucherTable.changeSelection(r,c+1,false,false);
    voucherTable.getInputMap().put(KeyStroke.getKeyStroke
    (KeyEvent.VK_ENTER,0),"moveForward");
    voucherTable.getActionMap().put("moveForward",
    moveForward);
    Kindly advise me to solve the problem.
    Thanks.
    Mujjahid

    KeyStroke tab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0);
    KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
    InputMap im = table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    im.put(enter, im.get(tab));

  • How to use the validation work in Both TAB and Mouse keys in Forms6i

    Hi,
    I have a validation script once it's validated it should execute the query.But using When-Validate-Item i can't use execute_query.I am able to use the validation in Key-Next-Item trigger but if the user moves the cursor using mouse then it's not working.
    How to use the validation script working in Both Scenarios(Tab and Mouse keys).
    Can anyone please give inputs to rectify the above issue?.

    So you have multiple fields, but on at least one of them if it's valid you immediately want to execute the query?
    You could create a hidden field in a control block Query_Now default 'N'. In a WHEN-VALIDATE-ITEM on your item, if it's determined to be valid, then set Query_Now to 'Y'.
    In a WHEN-NEW-ITEM-INSTANCE at block level, check if Query_Now is 'Y'. If it is then execute the query (and set it back to 'N').

  • How to di-activate CR 'Enter Key' HTML Code?  How to increase the the font of DW Help Explanations

    Hi,
    1.  How to di-activate <CR> 'Enter Key' HTML Code?
    2. How to increase the the font of DW Help Explanations?

    1.  How to di-activate <CR> 'Enter Key' HTML Code?
    Enter = paragraph <p>
    Shift + Enter = line break <br>
    To adjust browser default line spacing between paragraphs and headings, use CSS.
    p {
         text-indent: 4em;
         margin-top: 0;
         margin-bottom: 0;
         line-height: 1.2em;
    Does this help?
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics |  Print | Media Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    HTML Validator - http://validator.w3.org
    CSS Validator - http://jigsaw.w3.org/css-validator/
    Tutorials  - http://w3schools.com/

Maybe you are looking for

  • Cannot permanently delete folder from trash

    I had a folder called blah. I must have messed up some terminal command, and I inadvertantly created a seemingly infinite (i.e. very very large) number of nested subfolders within blah, each named blah. So, inside blah, was a folder named blah, and i

  • Error While doing KO88

    Hi All While doing KO88 (internal order settlement from AUC to Asset ) getting the error saying, Even though all the GL are maintained Account 'Acc.dep. accnt.for ordinary depreciation' could not be found for area 01 Message no. AU133 Diagnosis When

  • Oracle Forms Builder - Errors

    Hi to all! I'm beginner in Oracle Forms and Reports. The OS is Windows and the software is Oracle Forms and Reports Developer 10g with Database Server 10g. I have started with customers.fmb and orders.fmb. When I try start customers.fmb, I get the er

  • Switching, quick question, google calendar

    ive been using google cal, now im getting my macbook and will porbably want to use ical for synching with my cell. will i have to manually input everything into ical or can i import from google cal. or at least vice versa? any help is appreciated, th

  • Installing BusinessObjects Edge Series 3.1 ERROR CMS: STW00226

    Hi, I'm installing BO Edge Series on an Oracle Database but in one of the steps in the installation where it says choose the database, I choose Oracle, there are three fields, 1 host, 2 username, 3 password. In the first choose the instance of oracle