JTable starts editing when F3 is pressed - howto disable?

Hi,
I would like to add some shortcuts to my application (F3, F4, F5, ...), however when the JTable has focus and JTable's cursor is on a editable cell, it starts the editing process.
Is there a way to tell the JTable to "ignore" some keys?
Thank you in advance, Clemens

It behaves differently because it tries to pass key strokes to the editor and overrides processKeyBinding to that end. Try:
import java.awt.EventQueue;
import java.awt.event.KeyEvent;
import java.util.EventObject;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
public class TestJTable {
    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                JTable table = new JTable(new DefaultTableModel(1, 1)) {
                    @Override
                    public boolean editCellAt(int row, int column, EventObject e) {
                        if (e instanceof KeyEvent) {
                            int code = ((KeyEvent) e).getKeyCode();
                            int start = KeyEvent.VK_F1;
                            int end = KeyEvent.VK_F21;
                            if (code != KeyEvent.VK_F2
                                    && code >= start && code <= end) {
                                return false;
                        return super.editCellAt(row, column, e);
                JFrame frame = new JFrame("Test");
                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
                frame.getContentPane().add(new JScrollPane(table));
                frame.pack();
                frame.setLocationRelativeTo(null);
                frame.setVisible(true);
}Actually JTable does check if the key press triggers an action, but that means it only works if you install the key binding on the table input map with WHEN_ANCESTOR_OF_FOCUSED_COMPONENT.

Similar Messages

  • Please advise how I can register my Photoshop Starter Edition when I apply I do not receive an unlock code so I am unable to continue to use the program and all my photos are locked in, please advise, thanks John

    Please advise how I can register my Photoshop Starter Edition when I apply I do not receive an unlock code so I am unable to continue to use the program and all my photos are locked in, please advise, thanks John

    Please refer to the appropriate Forum, this one is dedicated to Photoshop proper.
    Photoshop Album Starter Edition

  • Iphoto starts up when it shouldnt - how to disable?

    Hi I am working as a photographer and I have a problem with iphoto when shooting digitally.
    I'm shooting on Compact Flash crads. Whenever one is getting full during a shoot we are beaming the pictures from the CF Card via a CF Card reader onto my Powerbook. We just want to move the pictures quickley onto the desktop to save them. Now we always have the problem that iphoto opens up as soon as we insert the Cf card and wants to import the pictures, which takes valuable time and is really crucial when you are shooting with people. It's a real obstacle whiel working. This happens with both Powerbooks we have and although I disabled it when iphoto was asking about this option on it`s first start up.
    The only solution I can think of is throwing iphoto in the trash - I wouldn`t like to do that though - maybe I could hide it somewhere on the computer?

    hi
    I loaded tiger and ilife on my powerbook g4 but when i open iphotos it comes up "caution. The iphoto library is locked, on a locked disc, or you do not have permission to make changes to it"
    I moved everything from iphoto folder to pictures folder to see if it would help having an empty iphoto folder but the message still comes up and when i click ok it immediatly shuts iphotos?

  • Photoshop Starter Edition

    Hello.  Purchased Photoshop Starter Edition when I bought computer running XP. Now have new computer running Win 8. Can I transfer and use on my new computer?

    You posted in the Photoshop forum by mistake.
    I've moved your post to the Album Starter Edition forum.
    Please see this topic:  http://feedback.photoshop.com/photoshop_family/topics/what_happened_to_adobe_photoshop_alb um_starter_edition

  • Adobe photoshop album starter edition 3.0 shutting down when importing from iphone 4

    adobe photoshop album starter edition 3.0 keeps shutting down when I try to import photos from my iphone 4 - it works fine with my wife's iphone 3!  Any suggestions?
    The follwoing messages appear:
    Adobe Photoshop Album Starter Edition 3.0 (Viewer) has encountered a problem and needs to close.  We are sorry for the inconvenience.
    AppName: componentlauncher.exe AppVer: 3.0.0.49815 ModName: ntdll.dll
    ModVer: 5.1.2600.5755 Offset: 00010a19
    Many thanks!

    Welcome to the forum.
    Unfortunately, you have posted to the Photoshop Windows forum, which deals with issues on the full Photoshop program. You want to post to the Photoshop Album Starter Edition Forum (a different software).
    Good luck,
    Hunt

  • Is it possible to save a data portion starting from when a "save" button is pressed?

    Hi,
    The below attached vi acquires data from a sensor. The sensor signal output can be reset to zero and the data saved into a file. However, the saved data comprises the data portion starting from when the vi starts running until the "stop" button is pressed. Is it possible to save the data portion starting from when the "save" button until the "stop" button are pressed?
    Best regards,
    Ninjatovitch
    Solved!
    Go to Solution.
    Attachments:
    Sensor Signal Acquisition.vi ‏52 KB

    this should be in 8.2
    Harold Timmis
    [email protected]
    Orlando,Fl
    *Kudos always welcome
    Attachments:
    RandomNumberSubVI.vi ‏8 KB
    savefilewhenselected.vi ‏11 KB
    f.txt ‏1 KB

  • How to go about using Photosmart 5520 for scanning when my OS is Win 7 Starter edition?

    After installing Photosmart 5520 driver onto my netbook whose OS is Win 7 Starter, I can perform scanning if I choose wireless connection during the driver installation. However, after I log off the netbook and then log on later, I will always get the error message prompt "The HP Photosmart 5520 series was not found" whenever I try to open the scan dialog by clicking the button on "Scan a Document or Photo" from the HP Printer Assistant page. I get the same error messsage when I start a HP scan. If I choose USB connection during driver installation stage, I will get that error message when I click the button on "Scan a Document or Photo".
    What do I do now so that I can perform scanning from my netbbok? I do not want to upgrade my OS as the notebook is already more than 2 years old, not worth upgrading its OS.

    Hello there again!
    Thanks for replying to me. After digging around some more, the issue could be your OS. I have checked out the specs and Windows 7 Starter Edition does not seem to be network compatible with the printer, so a wireless or ethernet connection is out of the question, unfortunately.
    Try connecting a USB cable and perform a Clean Boot and restart the PC, which will turn off all start up programs that could be disrupting scan functionality. Try a couple of scans to see if the error comes back.
     Let me know if you have better results, or the results in general.
    Printer Specifications for the HP Photosmart 5520 e-All-in-One and HP Deskjet Ink Advantage 5520 e-A...
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • After install Windows 7 i can't find MacOS in bootcamp menu. And when i'm pressing alt at start I have just Windows OS. How to return to MacOS?

    After install Win7 I can't find MacOS in bootcamp menu. And when i'm press alt at start I can watch just 1 OS. How to return to MacOS

    Hmm, then it seems Windows is trying to use a video driver that doesn't work with the one in your Mac.
    Try a safe mode start in Windows. Restart and boot to Windows. If you're doing that from the startup manager (holding down the Option key and choosing the Win 7 partition), select the Windows disk and immediately start pressing the F8 key. If the Mac is trying to boot to Windows right at a restart or startup, then start hitting F8 the instant the hardware chime bongs.
    Rather than the normal Win 7 splash screen (which from the sounds of things, you're not even seeing that), you will get a DOS screen of boot options. Chose Safe Mode and continue. This will force Windows to use the bare bones video driver and you should get to a desktop you can see.
    Now install the initial Boot Camp drivers.

  • My ipad is on an infinite loop.  I used ios7 for a few days and then did updates on some of my apps. that's when the infinite loop started.  I have tried pressing the power and home button at the same time, but it doesn't work. Please help!

    my ipad is on an infinite loop.  I used ios7 for a few days and then did updates on some of my apps. that's when the infinite loop started.  I have tried pressing the power and home button at the same time, but it doesn't work. Please help!
    I even tried some hints posted for ios6 (turn off Ipad, holding home button and plugging in power cord at the same time and then releasing the home button)
    I did manage to get a different screen that shows the itunes icon and a power cord, but nothing happens.

    You were on the right track. You got the connect to iTunes screen and you ended to use iTujes to restore your iPad. Try recovery mode again.
    Recovery Mode Instructions
    Disconnect the USB cable from the iPad, but leave the other end of the cable connected to your computer's USB port.
    Turn off iPad: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for iPad to turn off.
    If you cannot turn off iPad using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the iPad turns off, release the Sleep/Wake and Home buttons.
    While pressing and holding the Home button, reconnect the USB cable to iPad. When you reconnect the USB cable, iPad should power on.
    Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears you can release the Home button.
    If necessary, open iTunes. You should see the recovery mode alert that iTunes has detected an iPad in recovery mode.
    Use iTunes to restore iPad.

  • My probably 10 year old MaycBook died. It won't start. When I press the power button, it gets power, but it only lights up and a scratching noise starts like something is spinning. A file folder with a question mark periodically flashes... Help!!!

    My probably 10 year old MaycBook died. It won't start. When I press the power button, it gets power, but it only lights up and a scratching noise starts like something is spinning. A file folder with a question mark periodically flashes... Help!!!

    You don't have a Macbook if you are running OS 9 and it's 10 years old. The first Macbook is an Intel Mac that came out in 2006 running 10.4.x. You most likely have a Powerbook. Try posting in the Powerbook forum.
    A flashing question mark appears when you start your Mac

  • After registering on the album starter Edition 3.0, I am getting an error message saying that windows internet explorer cannot find the website, to make sure the path or internet address is correct.  when i click ok, it all goes away, adobe and all.  Help

    I called tech support that switched me to customer care and after over half an hour on the phone, they told me to look it up in the forums.  If you have any words of wisdom, I would love to hear them now.  I guess I have to get through this registering phase to obtain the unlock code.  I am surprised at how faulty this step is.  I expected more from Adobe.
    Please help!!!  Thanks.  Lisa

    You need to update your starter edition 3.0 to a 3.2 edition. Go to www.adobe.com, click on "Downloads" then "updates", continue to look under "Product updates" and scroll down to "Photoshop Elements". Now you need to download the Adobe Photoshop Album Starter Edition 3.2. This update will automatically remove your 3.0 edition, and your photos will be accessible in the 3.2 edition. Now you can register again. Good Luck!

  • Have a Adobe Photoshop album starter edition 3.2, when I registered it, the product was no longer so i purchased and installed Photoshop Eliment 11 and thought I had converted from the starter edition, downloaded some photo's two days ago and they were 'g

    Hi, I am trying to resolve a problem with being locked out of my old starter edition 3.2 which was upgraded to eliment 11

    Thank you for your help, Gunjan, but I have already tried to contact adobe tech support and I cannot get a code still now. I just find fixed issues where there is not shown my problem and I cannot find the way to write my question about my need of a code for Adobe Photoshop Album Starter Edition 3.2. Could you or somebody tell me the way to get the code through adobe.
    Thank you
    Mona05

  • When i dont press the button i want the value start to decrease by itself

    Dear all,
    I am controlling a numeric control value in the front panel : I am pressing increase button to increase the value, but what I want is that when i stop pressing the increment button the numeric value should decrease by itseft (automatically) Please, I need your help. 
    Kind Regards from Turkey.
    Have a nice day.

    Salander wrote:
    Firstly thank you for your reply, actually i couldnt try any of these,
    Why not?
    Salander wrote:
    I have something in my mind but I am sure it wont work.
    Then put something else in your mind! Don't spend thoughts on things that won't work.
    Salander wrote:
    I am not very good at programming, I want it to decrease Linearly to Zero.
    What have you tried so far? Nobody is good at programming until they program for a while and learn new skills.
    A car does not decrease the speed linearly to zero.
    If you are controlling a real car with real hardware, it will decrease to zero automatically due to friction and wind resistance, so why would you need to program it?
    If you are trying to simulate a car in software, create a software model that simulates a car based on parameters (current speed, mass, inertia, slope, wind resistance, drag coefficients, rolling resistance, friction, engine power, etc.).
    I would recommend to open the example finder an look at some examples. have a look at the "tank simulation.vi", and substitute tank level with speed, or look at "vibration analysis.vi". See how the rotation speed decreases slowly if the velocity is set to zero.  
    Attached is a simplified version, hopefully it can give you some ideas. If this is for school, you need to make sure that you fully understand the reason for every little detail in the program and can explain it to you teacher if needed. Try to expand the functionality by adding a brake pedal, for example.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Car Simulation.vi ‏15 KB

  • JTable & Cell editing

    Hi,
    I am using JTable and facing following problem. My UI has a JTable and JButton with mnemonic set. The button populates the date into the table. Here is the sequence
    1) Enter into editing mode by pressing F2 and enter value EE
    2) I press the mnemonic set for button
    3) ActionListener attached to button is executed. This ActionListener populates the data into the table.
    4) The cell on which editing was started remains in the editing mode and the value for edited cell does not change to the populated by ActionListener but remains EE. (This is the problem)
    What i want is whenever focus moves out of the table if the table is in editing mode then it should cancel the editing.
    I tried attaching the focus listener but problem with this is focusLost is fired even when i press F2 i.e. start editing.
    Any help will be of great use
    Thanks in advance
    Sachin

    Hi,
    It works in normal scenaios. I faced problem in following
    1) My cell editor has a verifier attached. if i show a dialog box from verify method and then return false from method focus remains in cell only, this is fine.
    2) If i show the dialog and return true from verify method, table remains in editing mode and focus gets transferred to the field. This time i am navigating through mouse.
    3) In the same scenario (2) if i tab out of the field cell does not come out of edit mode i have to press tab to come out of the field.
    Any idea??
    Sachin

  • How to find out that user starts editing data ?

    Hi all,
    I need to do something like changing icon to indicate editing session when the user starts editing cell in JTable, what event should I listen to ?
    Thanks in advance
    Setya

    Hi,
    add a PropertyChangeListener to your JTable and listen to the property "tableCellEditor". When it its null, editing is stopped, if it is non-null, editing was started.
    Thus you can determine when an editing session was initiated.
    Michael

Maybe you are looking for

  • How to SQL to create a new field reset by new value

    Table only got 1 field eg. company_name DELL DELL DELL HP HP IBM IBM IBM How create a SQL to create a running number field that reset for a value? Thanks. It should look something like this : SNO company_name 1 DELL 2 DELL 3 DELL 1 HP 2 HP 1 IBM 2 IB

  • Need some info on how to keep the computer arm in place.

    The flat panel will not stay in an upright postion, it keeps drooping down towards the keyboard. The guys at the apple store in our town said that since this product is no longer available I would have to purchase a new arm for the computer. Any help

  • Problrn when downloas from ALV to excel

    Hi All. I am trying to download data from ALV to excel file, but only last pages are downloaded and not from frist pages? Can anyone tell me wht it is happening and what is the solution? Thanks.

  • Urgent Regarding round off values in script

    Hi Gurus, I want to display round off values in total amount . Order conformation i wrote one suroutine but it is not working , it is going for dump. Eg:- total amount = 10004.49 it should display in 10004.          total amount                 = 100

  • HT4847 why can I not buy storage online?

    Is it really possible that there is no way to manage/purchase iCloud storage via web browser?  I used to be able to do this with the .ME service.