Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: JTable: edit by typing directly into cell, Return doesn't commit change? (1.4.2)



On Apr 1, 2004, at 8:41 AM, Bob Gilmore wrote:

> I'm having a problem with the Return key failing to commit values in
> JTables under Java 1.4.2 on the Mac.
>
> Here's how it fails:
> - Create a JTable.
> - Click (don't double-click, just click) in a cell.
> - Start typing. You enter edit mode immediately. Type a few
> characters.
> - Hit <Return>. The value that you typed in NOT committed, and the
> selection does not move. You have to click on another cell, hit an
> arrow key, or do something else to commit the change.
>
> I expected <Return> to commit the change, and for the selection to
> mode to the next row.
>
> In contrast, if you enter cell editing mode by *double*-clicking on a
> cell, things work fine.
>
> The problem doesn't appear in Java 1.4.1 on Mac, and doesn't appear on
> Java 1.4.2 on other platforms.
>
> Any thoughts, suggestions, workarounds?

This is fixed and is coming real soon now to a Java near you.

You should be able to work around it by getting the input map of the
table and adding these mappings to it.

"ENTER", "selectNextRowCell"
"shift ENTER", "selectPreviousRowCell"

That's in theory -- I haven't done it myself, but looking at the
changes I made that should be all you need to do.

Scott

------------------
Scott Kovatch
Apple Computer
Java Runtime Classes
Cleveland Hts, OH
email@hidden

"Everybody needs money! That's why they call it money!"
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >JTable: edit by typing directly into cell, Return doesn't commit change? (1.4.2) (From: Bob Gilmore <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.