Skip to main content

AutoCompleteDecorator Key Selection problem in DropDown on OS X

2 replies [Last post]
dhiller_tmp
Offline
Joined: 2006-09-19
Points: 0

Hello again,

we are using the AutoCompleteDecorator which is working fine on Windows. On Mac OS X it is not possible to open the popup and change the selected value by using the up or down-Keys and then pressing enter.

I didn't find any ticket for it, so I posted this issue here.

Demo code follows:

package alltests.de.dbap.util.xtable;</p>
<p>import javax.swing.DefaultCellEditor;<br />
import javax.swing.JComboBox;<br />
import javax.swing.JFrame;<br />
import javax.swing.JScrollPane;<br />
import javax.swing.SwingUtilities;<br />
import javax.swing.table.DefaultTableModel;<br />
import javax.swing.table.TableCellEditor;</p>
<p>import org.jdesktop.swingx.JXTable;<br />
import org.jdesktop.swingx.autocomplete.AutoCompleteDecorator;<br />
import org.jdesktop.swingx.autocomplete.ComboBoxCellEditor;</p>
<p>/**<br />
 * Demonstrates AutoComplete error.<br />
 *<br />
 * @author dhiller (creator)<br />
 * @author $Author$ (last editor)<br />
 * @version $Revision$<br />
 * @since 27.09.2006 16:42:04<br />
 */<br />
@SuppressWarnings( { "nls" , "serial" } )<br />
public class AutoCompleteDecoratorTest {</p>
<p>  private static final String[] VALUES = new String[]{ "ONE" , "TWO" , "THREE" };</p>
<p>  /**<br />
   * Starts program.<br />
   *<br />
   * @param args whatever<br />
   */<br />
  public static void main( String[] args ) {<br />
    SwingUtilities.invokeLater( new Runnable() {<br />
      public void run() {<br />
        final JFrame frame = new JFrame();</p>
<p>        final JComboBox undecoratedBox = new JComboBox( VALUES );<br />
        undecoratedBox.setEditable( true );<br />
        final DefaultCellEditor undecoratedEditor = new DefaultCellEditor( undecoratedBox );</p>
<p>        final JComboBox decoratedBox = new JComboBox( VALUES );<br />
        AutoCompleteDecorator.decorate( decoratedBox );<br />
        final ComboBoxCellEditor decoratedEditor = new ComboBoxCellEditor( decoratedBox );</p>
<p>        final JXTable table = new JXTable() {<br />
          @Override<br />
          public TableCellEditor getCellEditor( int row , int column ) {<br />
            if ( column == 0 ) {<br />
              return undecoratedEditor;<br />
            }<br />
            return decoratedEditor;<br />
          }<br />
        };<br />
        table.setModel( new DefaultTableModel( new Object[][]{ new Object[]{ "ONE" , "ONE" } } , new Object[]{"1" , "2"} ) );</p>
<p>        frame.getContentPane().add( new JScrollPane( table ) );<br />
        frame.pack();<br />
        frame.setVisible( true );<br />
      }<br />
    } );<br />
  }</p>
<p>}<br />

TIA, Daniel

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Kleopatra

jdnc-interest@javadesktop.org wrote:
> Hello again,
>
> we are using the AutoCompleteDecorator which is working fine on Windows. On Mac OS X it is not possible to open the popup and change the selected value by using the up or down-Keys and then pressing enter.
>

sounds like bug - could you pleasse file an issue in swingx issuetracker?

Thanks
Jeanette

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

dhiller_tmp
Offline
Joined: 2006-09-19
Points: 0