Navigate JTable using Ctrl and arrow combination

By default, one way to navigate cells in a JTable is by using the arrow keys. I need to change this so that the user must hold down the Ctrl key and then navigate with the arrows. The arrow keys alone will not have any cell navigation functionality... they will only be used for editing cells that contain a JTextField (or some variant).
Can anyone help me with this? BTW...I am using jdk 1.4.1_03

To answer my own question:
Using the InputMap and ActionMap of the JTable, the keybindings can be removed or added, so for moving one column to the right by holding down CTRL and pressing the right arrow, it is as simple as:
InputMap inputMap = table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
// KeyEvent.VK_RIGHT is the right arrow key, and 2 is the CTRL key mask
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 2), "selectNextColumn");Here are some links that were of help:
http://java.sun.com/j2se/1.4.1/docs/api/javax/swing/doc-files/Key-Index.html
http://javaalmanac.com/egs/javax.swing/ListKeyBinds.html?l=rel
http://java.sun.com/products/jfc/tsc/special_report/kestrel/keybindings.html

Similar Messages

  • I have drawn some maps in pages using shapes and arrows. When I delete a shape a little grey dot appears that cannot be deleted. Any ideas?

    I am using shapes and arrows to create concept maps in Pages. After saving the document I have opened it again and tried to make changes.
    When I delete an arrow or shape a grey "Do not" sign pops up. It cannot be highlighted or deleted. My map now looks like it has grey measles.
    Any idea what is happening?

    Hi Kiku,
    Select all the objects that you want in your map.
    Menu > Arrange > Group
    Copy, then Paste into a new blank page.
    Regards,
    Ian.

  • T42p + Access IBM - my mouse fails-only use TAB and arrows? XP desktop

    Suppose to be like day one here, my Thinkpad T42p but when I press the BLUE button or the Access IBM Icon
     my mouse fails-I can only use TAB and arrows and I am NOT in the post bios, I am in the XP desktop.
    I uninstalled and reinstalled it, but no help, same with USB mouse, same with touchpad and same with the red
    pointer button mouse.I was almost SURE that the other Thinkpads, same models, would have mouse ability.
    How do I fix this mess? What happened ? Help !! Have you tried to use that tool with no mouse ? Aggggggh !

    Download a Parted Magic CD ISO-file and burn it on a CD-ROM.
    Boot from CD-ROM and run the partition tool.
    Left-click the 1st Partition, select "Manage flags" and mark "boot".
    Reboot the computer after removing the CD-ROM. 
    To remove the drivers and tools use "Start"- "Programs " - "Access IBM" - "Program for installing/removal of ThinkPad-Software" (or similar - i only know the german terms). - Later Thinkpads used the "Software Installer"
    At the beginning of this year i had set up one of my R51 with the recovery CDs and ran all Windows Updates. - Everything worked fine then.
    Just for fun and to learn the effects concerning the system stability, i installed Thinkvantage System Update and updated all drivers and Tools. Some updates didn't work.
    Result:
    - lower performance
    - wireless didn't work anymore
    - sometimes a blue screen running R&R
    After that i recoverd the R51 again and removed all Access IBM tools and drivers with the "Program for installing/removal of ThinkPad-Software". Running TVSU then lead to a better result but not very satisfying.
    The differences of the old driver and tools - versions to the newest is too big. A lot of registry entries and many files will be kept after removing the old drivers and Access IBM -  tools.
    The best result you will get using one of the following ways:
    recover from CD/R&R-partition and keep all TVT drivers and tools
    do a clean install from a Windows CD and install drivers and software after running all Windows Updates (only 1 GBit ethernet or wireless Lan- driver installed) and then use System Update or manual install
    My home-forum: http://www.thinkpad-forum.de
    Wiki: Deutsches ThinkPad-Wiki English ThinkWiki
    My ThinkPad-Collection

  • Why can't I use 'Control and Arrow' to zoom with Leopard?

    Hi guys,
    I've lost the ability to quick track zoom since installing Leopard. When I press Control and one of the four vertical or horizontal arrows, the Spaces icon shows and shoves my Logic out of the way.
    I hope that there's some way to disable this function so it will enable me to use my beloved Zoom again.
    Please help!!!

    3-D is very memory intensive.
    System requirements | Photoshop
    Mac OS
    Multicore Intel processor with 64-bit support
    Mac OS X v10.7, v10.8, or v10.9
    2 GB of RAM (8 GB recommended)
    3.2 GB of available hard-disk space for installation; additional free space required during installation (cannot install on a volume that uses a case-sensitive file system or on removable flash storage devices)
    1024x768 display (1280x800 recommended) with 16-bit color and 512 MB of VRAM (1 GB recommended)**
    OpenGL 2.0–capable system
    Internet connection and registration are necessary for required software activation, membership validation, and access to online services.*
    ** 3D features are disabled and some Mercury Graphics Engine enhanced features may not work with less than 512 MB VRAM. Read the Help article.
    Bottom line, you don't have enough VRAM
    Nancy O.

  • I can't use ctrl++ and ctrl+- (zoom in and out keys) on flash player pages.what can i do for this problem??

    i can't zoom in and out on flash player pages.

    Some gestures have been removed in Firefox 4.
    You can restore the zoom feature by changing the values of the related prefs on the <b>about:config</b> page.
    browser.gesture.pinch.in cmd_fullZoomReduce
    browser.gesture.pinch.in.shift cmd_fullZoomReset
    browser.gesture.pinch.out cmd_fullZoomEnlarge
    browser.gesture.pinch.out.shift cmd_fullZoomReset

  • Bridge cs6 . I can't select more than 1 file even when I use ctrl and select a few files. Bridge will just open them indivudually.It was working properly a week ago.

    I cannot open multiple files on Bridge cs6  on my pc. I hold down ctrl. but it just opens them individually. This function was working in the past. caps lock is off, nothing has changed....help.

    As I select a file, it will launch its application automatically. Therefore I can not select multiple files or just single files without opening the application.
    I did not have this problem before. I started having this problem after I updated my system to OS X Yosemite.
    I tried to reset Bridge preferences, installed updates, but nothing worked so far.
    Can anybody help?

  • My screen is too big. It cuts off pages. how do i fix it. I used ctrl and alt at the same time it did not fix it.

    Like if i get on facebook i can only see haft of the page. i can not see any thing to the left or right of the page

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    * http://kb.mozillazine.org/Zoom_text_of_web_pages

  • My desktop display has been magnified and everything I open is similarly magnified.When I try to zoom out using Ctrl - or the mouse nothing happens

    My MacBok Pro suddenly magnified the desktop display significanlty. All programmes and applications are similarly magnified when open. I tried zooming out using Ctrl - and I also tried holding down the Option key and scrolling down using the mouse. Nothing happens to zoom out of the desktop and on Facebook for example the columns get smaller but the text doesn't so lines of text end up overlayed each other. What can I do to remedy the situation?

    Found the Option key. Googled it. And yes your instructions worked a treat. Thanks

  • How do i use numbers for image gallery and arrows?

    Hello there,
    I'm hoping someone can advise me on the best possible way.
    I would like to use numbers to help the user navigate through the image gallery i'm creating and arrows on either side of an image (one image viewed at any one time). I have attached an image of what i'm trying to acheive. I feel like the arrows will help aid the user to navigate and the numbers will inform them on the number of images to view.
    I have so far created the site with a template (logo and nav bar) and child pages for: home/about/work/contact.
    Hope to hear from someone soon.
    Nicola

    With so many pre-built image galleries available to you, there's no reason to re-invent the wheel.
    CSS Image Viewer (view source to see the code)
    http://alt-web.com/DEMOS/CSS-Image-Viewer.shtml
    jQuery slideViewer 1.2
    http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/imageslide-plugin.html
    57 + Image Gallery, Slideshow & Lightbox solutions
    http://www.1stwebdesigner.com/css/57-free-image-gallery-slideshow-and-lightbox-solutions/
    In addition to the ones above, log-in to Adobe's Widget Exchange with your Widget Browser
    http://labs.adobe.com/technologies/widgetbrowser/
        * jQuery Cycle Widget
        * Lightbox Gallery Widget
        * Spry Content Slides
        * Spry Image Slideshow
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Can you explain when using keywords and addding them to various clips pressing ctrl and a number eg. 1 or 2 it simply closes down FCPX.  Just to the dock as would th yellow -sign. As you gather I am new to this program having only used Final Cut Express 4

    Can you explain when using keywords and addding them to various clips pressing ctrl and a number eg. 1 or 2 it simply closes down FCPX.  Just to the dock as would the yellow -sign.  I am new to this program having only used Final Cut Express 4 previously.
    iMac (early 2009) 24in 2.93GHz 4GB 1066MHz DDR3 SDRAM (To be upgraded ot 8GB in the nextfew days) os x 10.7.2 Lion
    Re: Why don't my arrows on the time line operate and allow me to move to the start and end of the timeline. Iam using the trial version 

    Check System Preferences. I think Control-1 is used by something in the OS now. Switch it off. It's a major p[ain the way the OS is taking over more and more of the keyboard, allowing less options for application use.

  • Key binding won't work with alt-up and alt-left arrow combined

    I was playing with key binding trying to create a small app where a timer is started with the press of an alt-arrow key and stopped when the key is released. The timers append Strings to a JTextArea telling which alt-arrow key is currently pressed.
    This program works, and in fact if you press a combination of any two keys, both timers will work simultaneously, that is unless you press both up arrow and left arrow together. Can anyone see a bug in the program that explains why it won't work for these two particular keys when combined? Thanks in advance, Pete
    My SSCCE,
    KeyBindingEg.java
    package javaforum2009;
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.InputEvent;
    import java.awt.event.KeyEvent;
    import javax.swing.*;
    public class KeyBindingEg {
      // parallel arrays -- sorry
      private static final int[] ARROW_KEYS = {
          KeyEvent.VK_UP, KeyEvent.VK_DOWN,
          KeyEvent.VK_LEFT, KeyEvent.VK_RIGHT };
      private static final String[] ACTION_STRINGS = {
        "Up", "Down",
        "Left", "Right" };
      private static final String PRESSED = "PRESSED";
      private static final String RELEASED = "RELEASED";
      private static final int TIMER_DELAY = 100;
      private JPanel mainPanel = new JPanel();
      private JTextArea textArea = new JTextArea(20, 30);
      public KeyBindingEg() {
        JPanel northPanel = new JPanel();
        northPanel.add(new JLabel("This JTextField has the focus: "));
        northPanel.add(new JTextField(10));
        textArea.setEditable(false);
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(northPanel, BorderLayout.NORTH);
        mainPanel.add(new JScrollPane(textArea), BorderLayout.CENTER);
        setBindings();
      private void setBindings() {
        int context = JComponent.WHEN_IN_FOCUSED_WINDOW;
        InputMap inputMap = mainPanel.getInputMap(context);
        ActionMap actionMap = mainPanel.getActionMap();
        for (int i = 0; i < ARROW_KEYS.length; i++) {
          // timer is started on key press and stopped
          // on key release.
          Timer timer = new Timer(TIMER_DELAY, new KeyTimerListener(
              ACTION_STRINGS));
    timer.setInitialDelay(0);
    // get input maps for all alt-arrow keys for both key press
    // and key release
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, false), ACTION_STRINGS[i] + PRESSED);
    inputMap.put(KeyStroke.getKeyStroke(ARROW_KEYS[i],
    InputEvent.ALT_DOWN_MASK, true), ACTION_STRINGS[i] + RELEASED);
    // set corresponding actions for the two different key presses above
    actionMap.put(ACTION_STRINGS[i] + PRESSED, new ArrowKeyAction(false, timer));
    actionMap.put(ACTION_STRINGS[i] + RELEASED, new ArrowKeyAction(true, timer));
    @SuppressWarnings("serial")
    private class ArrowKeyAction extends AbstractAction {
    private boolean onKeyRelease;
    private Timer swingTimer;
    public ArrowKeyAction(boolean onKeyRelease, Timer swingTimer) {
    this.onKeyRelease = onKeyRelease;
    this.swingTimer = swingTimer;
    public void actionPerformed(ActionEvent arg0) {
    if (onKeyRelease) {
    swingTimer.stop();
    } else {
    swingTimer.start();
    private class KeyTimerListener implements ActionListener {
    private String actionString;
    public KeyTimerListener(String actionString) {
    this.actionString = actionString;
    public void actionPerformed(ActionEvent arg0) {
    textArea.append(actionString + " pressed\n");
    public JComponent getPanel() {
    return mainPanel;
    private static void createAndShowGUI() {
    JFrame frame = new JFrame("KeyBindings Example");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(new KeyBindingEg().getPanel());
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args) {
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();

    camickr wrote:
    I noticed the problem a while ago with a similiar example and asked the same question to which nobody could give an explanation. The same observations seem to apply to your example in that using the numpad arrow keys work without a problem.
    [http://forums.sun.com/thread.jspa?threadID=5176816]
    Yes indeed. I suppose (as always) I should have searched the forum first before asking the question. Thanks for the link and info.
    /Pete

  • I have itunes directory on an external hard drive and want to direct a new installation of itunes on windows 8 to use it. I tried holding down ctrl and clicking itunes and after many tries got it to work one time. When I went back in later it had reverted

    I have itunes directory on an external hard drive and want to direct a new installation of itunes on windows 8 to use it. I tried holding down ctrl and clicking itunes and after many tries got it to work one time. When I went back in later it had reverted back to a blank version of itunes and I cant get ctrl to work again. Any other ideas?

    This is sometimes caused by a problem with the iTunesPrefs.xml file, normally found at C:\Users\<User>\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml. Try dragging this to the desktop and trying again.
    Alternatively the problem may be that you have McAfee AV and it is preventing iTunes from updating the same file and thus causing the problem. See Why does iTunes delete my itunesprefs.xml? for details.
    tt2

  • Some of the shortcut keys and directional keys on the keyboard are not working in FF 4 RC1 (i.e. Tab, Ctrl+C, arrow keys). They work fin in FF 3.6x and other applications.

    Crtl+C, Ctrl+V, Ctrl+X, Tab, and arrow keys do not work at all in FF4.0b13 and later. I am not sure about earlier versions as this is the first version I have tried.

    I found this helpful article (http://support.apple.com/kb/TS1381) and worked my way through the section "Some keys don't work as expected".
    All the following functions/settings are disabled or turned off:
    Text to speech / Speak selected text when the key is pressed
    Slow Keys
    Mouse Keys.
    The keyboard viewer just confirms my list of keys that are not working.
    Starting in safe mode makes no difference; nor does booting from the Mac OS X Install Disc and running Terminal from the Utilities menu. The same keys as before fail to work.
    This seems to confirm that it's a hardware issue. Anyone have any suggestions?

  • Hi. After I have loaded a picture into Photoshop some of the menu tools are greyed out and I cannot use the keyboard short cut, for instance I cannot use Ctrl   T to enter free transform mode. Also the toolbar is so small I cannot see the icons without ge

    Hi. After loading a picture into Photoshop some of the menu tools are greyed out and I cannot use the keyboard short cuts, for instance I cannot use Ctrl + T for free transform, how do I resolve this problem. In addition the tool Icons are so small I have to get close to the screen to see them, is there anyway the Icons can be made bigger without reducing the resolution of the screen.
    Thanks
    Derek

    Are you working on a background layer? If so, Ctrl + T will not work. Press Alt and double-click your background layer to convert to a normal layer (or right-click BG layer and select Layer from Background) and try again.
    If you're working in Photoshop CC 2014 you can go to Preferences > Experimental Features and tick "Scale UI 200% for high-density displays" to make your buttons and icons larger.

  • I'm wanting to use the "Actions" in Photoshop Elements 11.  But when I get the Actions box up, it is only showing a small list of effects to use.  And no side bar to go any further.  When I click on the little arrow at top and then click on "load actions"

    I'm wanting to use the "Actions" in Photoshop Elements 11. But when I get the actions box up, it is only showing a small list of effects to use. And no side bar. So I can't go any further.  When I click on the little arrow at top and click on "load actions", I am only getting a box with empty space saying "No items match your search".  The folder at the top does say "Actions".  How do I get more effects?  The tutorials that I've checked into all show a long list of effects in their box.  Can anyone help? 

    To use the existing actions, try the following:
    1. Open one of the Action Sets, in this example Special Effects is the Action Set, by pressing the small arrow beside the set name.
    2. Then click on the name of the Action, in this example Faded Ink is the Action name.
    3. Then press the Play button to run the action.

Maybe you are looking for

  • Robohelp X5 Problem

    When I delete files from robohelp and from the server where I publish my robohelp files too, they tend to reappear the next time that I publish.  So in essence, I am unable to remove any files...Please help...

  • Error message installing Adobe reader

    Using VISTA and when installing Adobe reader following error message appears : error when making map c:\programData\Adobe\Acrobat What to do ?

  • Thirdparty Subcontracting

    Hi gurus....... My client wants following scenario to be mapped in SAP. My client gives raw material to his subcontracter. Then subcontractor makes processes on that and make finish product and then that subcontractor directly supplied finish product

  • Help to install sound

    Hi I've just installed Archlinux now, and I have got KDE up running but no sound.  When I start up KDE I get this message: "Informational - artsmessage Sound server informatinal message: Error while initializing the sound driver: device /dev/dsp can'

  • HOw to check weather flash player is installed or not in Nokia ?

    How to check weather flash player is installed or not in Nokia ? I had created some flash file , i need to install in Nokia mobile .If there is no flash player how it will detect? if it is installed then how it will detect. Chirag