<Swing Dev> [9] Review Request: JDK-8032878: Editable combos in table do not behave as expected

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Mon Mar 17 11:48:48 UTC 2014



   - It seems that the "JComboBox.isTableCellEditor" client property can 
have null value which should be treated as false
     but it does not pass the check Boolean.FALSE.equals(null).
  - I am not able to use  arrows during JComboBox editing because it 
moves the focus to another component.
    The same is for table cells which use TextComponent. May be it have 
sense to create a separate issue that it should be
     possible to use arrows in the component during editing.

   Otherwise the fix looks good for me.

   Thanks,
   Alexandr.


On 3/14/2014 3:23 PM, Alexey Ivanov wrote:
> Hello,
>
> Could you please review the fix for jdk9:
>   bug: https://bugs.openjdk.java.net/browse/JDK-8032878
>   webrev: http://cr.openjdk.java.net/~dmarkov/8032878/jdk9/webrev.00/
>
> Problem description:
> If editable JComboBox is used as cell editor in JTable, its value does 
> not change when user types keys.
>
> If JTable.setSurrendersFocusOnKeystroke(true) is in effect, then 
> JComboBox (usually) loses the first key press before it gets the input 
> focus.
>
>
> Fix:
> If JComboBox is table cell editor and is editable, it will forward 
> TextActions to its editor component. The action binding is obtained 
> from InputMap of the editor component with WHEN_FOCUSED condition, as 
> if the editor had focus.
>
>
> Thanks,
> Alexey.




More information about the swing-dev mailing list