Can't fire cancelled editing event in a JTable

Hi,
I have a JTable and I'm listening to it's cell editor events editing canceled and editing stopped.
When editing is stopped i verify the value of the cell and if it's not valid i throw a warning message, then select I the cell and turn its editing on in order to give user a new chance.
It works fine, but, when I enter an invalid value onto a cell and press ok, then the warning pops up (as desired), i accept it and then I pres the Esc key, it just places the last value for that cell, which was the same invalid string (due to editing was stopped and I turned it on again), not even the "editing is canceled" event is called in order to place the last valid value for that cell.
Don't know what I'm doing wrong since "editing stopped" event is working fine.
Does anyone know how to fire the "editing canceled" event when Esc key is pressed?
Thanks in advance!
Edited by: raveko on Jun 5, 2008 7:05 AM

I found the following way to force cancel editing event (or just treat the event here)
Do you know a better way?
Thanks!
// Handle escape key on a JTable
Action escapeAction2 = new AbstractAction()
public void actionPerformed(ActionEvent e)
if (table.isEditing())
int row = table.getEditingRow();
int col = table.getEditingColumn();
table.getCellEditor(row, col).cancelCellEditing();
KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false);
table.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(escape, "ESCAPE");
table.getActionMap().put("ESCAPE", escapeAction2);

Similar Messages

  • How can I fire a change event from a JComboBox and JTextField?

    Is it possible to fire a ChangeEvent from JComboBox?
    Is it possible to fire a ChangeEvent from JTextField?
    If so how can I do that? Thanks.

    You can use an ItemStateListener with the combobox
    As for the textfield, it depends when you want to catch events (every keystroke, or when the user hits enter) but either way, you can do this too. Check keylistener and actionlistener

  • Can we fire key press event programmatically????

    hi there,
    is it possible in java to fire a key press event (of the associated component) programmatically??? like we can fire action event of a button by saying
    button.doClick();
    thanks in advance.
    anshu

    You can do so by using awt.Robot.keyPress(), just don't forget to do awt.Robot.keyRelease() afterwards!
    Note that it doesn't work for Applets unless you sign them, for security reasons (you don't want to go into a site and have the applet click ctrl+alt+del for you, right?)
    Cheers!
    Moti

  • Why iCal cancel of event edits issue is still not fixed after over 2 years?

    Why iCal "cancel of event edits" issue is still not fixed after over 2 years?
    I have been in the software engineering industry for over 14 years, but I have never seen a large corporation being so slow at addressing major issues like these.
    What would it take for Apple to start working on this issue?

    Yup. This is fully ridiculous that you can't cancel your updates once you start. I love the tool but this is on pretty significant issue.
    Sometimes I accidentally move a mtg or make some edit while viewing and you can't back you!!
    If you feel the same way, you should post a note here:
    http://www.apple.com/feedback/ical.html
    Message was edited by: SteveMc10123

  • ICal Lion is infuriating. How can I add a new event in a chosen calendar without having to create it in my default then edit it?

    iCal Lion is infuriating. How can I add a new event in a chosen calendar without having to create it in my default then edit it?

    We are all entitled to our own opinions. So I respect you there brother
    But then again, Apple has its own basis. iOS is what's selling like pancakes not Macs, so if the gazillions out there are using iOS device and have gotten used to the calendar in their iOS devices. Wouldn't you think it made sense if Lion has the same calendar look and feel?
    Everything was considered and weighthed when they developed Lion. They even mentioned it in the press, They were blown away with the success of iOS so they are extending it to OSX.
    Quite frankly, I like the old iCal but yeah I don't expect anything in SL to stay in Lion otherwise it'll be another Cat name related to Leopard
    People should start looking at this perspective and not get STUCK in the old OS.

  • Can no longer edit events in Calendar on iPod 2ndG

    We have a MP, MBP, iPhone 4S and iPod 2nd G and to be able to sync Calendar and other programs on iCloud we installed Lion. We used to sync the iiPod to the MP but after switching to Lion shifted it to the MBP and she can no longer edit events on Calendar. Is this a setting problem or is it an issue with the IOS 4 on the iPod? Do we have to get an iPod that will accept IOS 5?

    Doing an entire report in a table is such a bad idea and really unnecessary.
    Sounds like you need to update both Pages and your user tag.
    Are you actually on OSX 10.6.8 and what version of Pages are you using?
    Menu > Pages > About Pages
    Peter

  • How can I see and edit two Events?

    Hi, I am using iPhoto 11 [9.4.3] and can't find the help section for this operation. I did siccessfully get all the photos and events back by using a message from Old Toad, but I still need to move photos from one event to another. I read somewhere it was possible to view two Events in vertcai columns, is this still possible in this new version?

    For what it's worth,  you can always browse a second event or album in your iPhoto Library by browsing the library in Preview's Media Browser at the same time - only you can only browse but not edit. This can be useful, if you need to find a certain item, and are no sure which event to open next.
    For example - an iPhoto library open in iPhoto (left) and viewed in Preview (right) at the same time:

  • I can see the pictures in Events in iPhoto, but I can't open them.  When I right click on an Event it just says Edit, but won't open all the pictures in Events.  It used to open, but something is wrong.  I would appreciate any assistance.  Thank you.

    I can see the pictures in Events in iPhoto, but I can't open them.  When I right click on an Event it just says Edit, but won't open all the pictures in Events.  It used to open, but something is wrong.  I would appreciate any assistance.  Thank you.

    Hi Terence,
    I got your note and was able to complete the first part, but when I came to Finder, Go To Folder and I typed in both     /var/db/receipts/    and /private/var/db/receipts all I get is NOT FOUND message.  I tried several times, but no luck.
    Please advise.
    Thank you.
    Catherine Morgan

  • When I try to add a new event to iCal a dialog says "you can't add or change events in the Birthday Calendar". How do I cancel this?

    When I try to add a New Event to iCal a dialog box keeps saying "you can't add or change events in the Birthday Calendar". iCal is, however, receiving up-dates from my other devoces via iCloud. Can anyone help unblock this for me please?

    You can not add events to the birthday's calendar. To add birthday's to the birthday calendar you need to add the birthday to a contact in the Contacts app.
    You can set your default calendar here:
    iCal > Preferences > General  > Default Calendar and chose the calendar you want to default to.

  • How to handle editing events in a JComboBox

    I have a editable JComboBox. User can select value either using the drop-down box or by editing.
    I am able to get the drop-down selct event. However, I am not sure how should I handle the edit event on JComboBox.
    Particularly, here is the use-case I wish to handle.
    User edited the JComboBox by clicking back space key. I want to fire an event once user is done editing. How can I find if user is done editing ?

    User, please always tell us your jdev version.
    In general you use a valueChangeListener which is fired when the user tabs out of the field...
    Timo

  • I set an alarm with Siri. Can she only set one at a time, and how can I see/cancel it?

    Title. I set an alarm, then shortly after asked her to set another alarm.
    1) are both alarms in effect?
    2) where can I see/cancel them? It says it can't modify or delete them.

    Go to the Clock app and see if they are listed.  I just set two via Siri on my iPad and both are listed. I can turn them off or deleted (via edit button) the alarms.

  • A1, Can not get Camera edits to Save. Arcsoft Gallery (Trial) will not upgrade

    Sorry but I need to first start with a rant,
    <rant> I receive the pad, spend days playing and customizing, learning features.  Once I ran across the edit feature from within the camera viewer (which was very cool), I played with a picture and went to "Save".  I was presented with a message that if I want to save I would need to "Buy" the app.  First off I was not in an app, I was using the built in camera viewer software, there was no identification, no "About" tab and I did not not use an external Icon to get to this point.  Ok, I suck up and press continue to find out the software is "Arcsoft Workshop 4.6 (Trial)" and the upgrade would be $2.99.  I really think this was a low blow from Lenovo as to beat up on their customers for mere $2.99.  Ok, after having to fight with the Lenovo app store (reg + fight crashes which are detailed elsewhere) I finally get it purchased and downloaded just to be awarded with the message "Can't Install" with an big red "X").  Now things continue go down hill..... </rant>
    Ok, just before it bombed out I was given a message to "Replace an system app" which I also agreed to. That gave me the idea that the old application may be holding up the install process.  My great idea led me to uninstall  "Arcsoft workshop trial" which did not help anything and now I have no edit functions at all
    When the app first mis-behaved I was asked by the app-store to report problems which I did, the next morning I had an email from a nice lady that worked at MobiHand (apparently they service the Lenovo app store)  and an attachment with the workshop apk file.  I was able to get that file to install
    But wait, we are not done with this story...   I had Workshop back but if I clicked on ANY picture or tried to "Edit" from the camera I was presented with "Can not open image!"  Nothing I tried would work, I uninstalled, reinstalled, bla, bla.  I then returned the nice lady's email with the new problem with no response for the next 2 days.
    Meanwhile I am trying to figure out how to get back to where I was to start with and have edit functions (how be-it with no ability to save).  Since I installed the trial app and did not have a copy to reinstall it back I was stuck.  After much research (on the forums) I was able to confirm that a factory reset would bring back the old app as well as perhaps fix a few other things that are plaguing me.  During the 4 system updates previously I made I never did the reset and all my customizing stayed (which I was happy about) but now with the pending reset I knew it would be the end of all my past week of work.  Of course I backed up everything but still the re-setup would be hours.  (<rant> all this for a #$!@#$@#$ "Save" button! </rant>)
    I followed this exact procedure;
    1. Made sure all updates were completed. (v3.2.1 (build ends with 1109)
    2. Factory Reset (under setup, privacy) 
    3. Loaded Astro and backed up ALL my initial apps (including Workshop Trial)
    4. Set up Lenovo app store 
    5. Took a test picture with the camera
    6. Viewed test picture and selected "edit"
    7. Made a test edit
    8. Selected "Result" and "Save", I was presented with the "you must buy" message
    9. Completed the Arcsoft Workshop 4.6 download and install  (Hurray no problems this time!)
    But wait.... The story continues.....
    I go to edit a picture and was presented with 2 choices, Workshop and Workshop Trial.  For some reason I was not asked to overwrite the old trial version but I think to my self, this is OK and choose the new full app.
    I am presented with "Can't open Image!"    <rant> (&^#@%$^$& 
    Lets see, I have about 12 hours in this project to get a "Save" button and NaDa, no forward progress, Game further delayed, EKKKKKK! </rant>
    Workshop trial at least still works as it always has.
    <loud_rant> Now, I am po'd, nothing I did has caused this and the blooming thing just plain does not work, the words "I should have bought an Ipad" continue to beat in my head, after all the 8g iPAd2 was only $100 more, I really feel like returning this stupid thing but I suck it back up and fire an email to Arcsoft.  The next morning the reply was that Lenovo bundled the software and I should contact them (Did I tell you I spent 40 worthless minutes on the phone to them during the initial problem state?).  Now I am Livid, I told Arcsoft that it was the full version I paid $2.99 for that is malfunctioning, not the original bundled "Trial" version but of course that was ignored and the generic form letter response was issued.  I have fired off another very firm email to Arcsoft over the issue, no response to date (2 days now). </loud_rant>
    It appears that satisfaction is no matter to Lenovo or Arcsoft, and  theydo not provide what they promise.  I hope this community can help with the problem, If I can't save an edited picture then they deserve to get the blooming thing back.
    Thankx for any help someone can provide,
    Jmayes

    Thanks for the tip on the edit.  I remembered to take the film off the lens.  In almost every review I read and viewed (I researched quite a while b/4 buying) mentioned the poor quality of the camera photos compared to other 5 MP cameras on other tablets.  I just didn't expect it to be this bad.  My neighbor has a Thrive and an Iconia both of which have 5 MP cameras and there is a world of difference even after you upload them to the computer.  It wasn't the 3.2 upgrade that affected the camera.....I think it is just poor quality hardware (most reviewers agree on that).  It is not a deal breaker for me more like I feel cheated.  Having the camera lens so close to the edge is a problem too since it seems to pick up finger prints on the glass covering the lens causing the photos to look drab.
    Atleast they didn't put the earphone jack on the top causing the wire to drap across the screen if you are not careful like one of the tablets I saw.
    By a route obscure and lonely
    haunted by ill angels only.

  • Cancelled (detached) events showing on shared calendar - help!

    I can't figure out how to remove cancelled events from showing in iCal on a shared calendar. We use Zimbra for mail, etc. I subscribe to my boss' calendar and it is showing his cancelled (detached) events. They do not show in his iCal on his computer and they don't show in Zimbra. They only show in my iCal. I've looking in every preference I can find....I've tried un-subscribing to the calendar and then re-subscribing. Nothing seems to work. Any ideas??

    Consequently........it only seems to happen with recurring events we migrated from Microsoft Exchange. I cannot replicate it with a new appointment. I would still, however, like to be able to remove ones that are currently here. Since, they are recurring, they do show in the future, as well.

  • How can I determine how many events are in my calendars?

    The web version of my iCloud Calendar and subsequently also my Calendar.app did show recently various malfunctions and error messages that were inconsistant. Also, Calendar.app crashed when I was editing events. Finally, Calendar.app did complain that my iCloud account would be out of quota, and did direct me to this KB article:
    http://support.apple.com/kb/HT4489
    I did not know about these quotas before which are not really high and quite limiting for use over longer periods of time. After checking them, I think that my real data are below these limits. However, there might be one exception:
    - Total number of calendars, events, and reminders: 25,000
    25,000 sounds a lot, but when you devide by 6 events per day (which is easily reached if you combine family and buisness, and maybe repeated events also count for each repetition at least after editing), one ends up at 4200 days which is not much more than 11 years. I am using Calendar with data since the year 2000 (for some time I used Palm Desktop that took over the (very) old Mac Calendar application and imported/moved the data when iCloud Calendar became available).
    My questions:
    - how can I determine the number of events in my calendars?
    - which events do count in which way for the quota limit?
    - what about events from shared calenders - do they count if owned by another account?
    - what about repeated events which are partially edited?
    Thanks in advance for any hint!

    Hi there
    I ran into the same problem last year. The solution I used is available here:
    http://forums.macrumors.com/showthread.php?t=1693875
    Apple don't seem keen to tell you you've reached your limit and if you think that isn't helpful tough luck. I reached due to duplicate events being created. I didn't know what had happened until I eqnuired further on the above forum. Someone needs to create an event counter application. Perhaps they have. Would need to do a search.
    However I've now reached the limit again and I'm not sure why, cue more faffing around being required. That's one of the problems of using a Mac computer with an Android phone.
    As for the limit, it exists and if you dont like it you need to change the way you work not Apple. That's the impression I get. Alternatively use something else that has more generious limts. I don't know what that would be. I did consider moving my calendars to Google but it would have meant certain functionality would not work in BusyCal, the third part calendar application I use on my Mac computer.

  • I have recently got an iPad 2, I can no longer view/edit my Sony .ARW files in iPhoto, why?

    I suspect that the problem is associated with iPad 2 and my sychronisation of iPhoto events to that device.
    I can no longer a single photo such that I can edit it, what is going wrong here?
    Actually I have closed down iPhoto and reopened, strange, I can now access and edit the photos!
    Ther is a problem but I am damned if I know what is causing it.  Nowt in console as far as I can see.

    Actually I have closed down iPhoto and reopened, strange, I can now access and edit the photos!
    Looks like you no longer have a problem. 
    OT

Maybe you are looking for

  • Why won't adobe reader show text?

    I am working for my eagle scout rank and in order to do my service project, a form must be filled out on the computer as a pdf. I started the PDF on my old dell, and i downloaded Adobe reader for my mac to finish it. For preview, it takes the lines o

  • Cache - LookUp values

    Hi, Is there any possibility to cache the values when we used Lookup's in XI. So that we can not poll the database everytime in production environment. Can anybody share their valueable experiences with me. -Esha

  • Question about start up

    My HP was stuck on the blue screen when i started it. I put in the windows 7 disk and now it works. was it a virus that caused it to be frozen on the blue screen?

  • Scroll bar in Table of Contents on iPad

    The Table of Contents in my project is pretty long. However, when played on an iPad there is no scroll bar to indicate that there are more slides than what is initially seen in the Table of Contents (although you can still scrub through the Table of

  • I can not use the same ip address for three NDGs ACS.!

    Hello. Install ACS 4.2 Build 124 Patch 13, I created three NDGs, My server has the IP 192.168.1.10, adding the same three NDGs server gives me this error: An overlapping IP range 192.168.1.10 conflicts have been detected with ACS entry of 192.168.1.1