JDK-4109871 : JComboBox is not fully accessible in JTable.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.accessibility
  • Affected Version: 4_fcs,1.1.7,1.2.0,5.0
  • Priority: P5
  • Status: Open
  • Resolution: Unresolved
  • OS:
    solaris_2.5,solaris_2.6,solaris_8,windows_nt solaris_2.5,solaris_2.6,solaris_8,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-02-05
  • Updated: 2022-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Swing-pre-1.0, jdk1.1.5, Solaris.

When using a JComboBox as a JTable cell editor, keyboard navigation doesn't work properly. Alt+Down arrow doesn't post menu of the JComboBox. 



Name: krT82822			Date: 07/11/99


Steps to reproduce:
1. Select the table (Note that on my system the table was
not visible until I actually clicked on it. This may be another bug.)
2. Use the arrow keys to select a cell in the first column
3. Type a letter

Note that the editor appears, but no changes can be made to the cell
If the combo box arrow is selected with the mouse, then changes can be
made with the keyboard.

import javax.swing.*;
import java.util.*;
import javax.swing.table.*;

public class JTableTest
{
	public static void main(String [] args)
	{
		//allow changing of look and feel from command line
		UIManager.LookAndFeelInfo[] lfi=UIManager.getInstalledLookAndFeels();
		try
		{
			if(args.length >0)
			{
				int i=new Integer(args[0]).intValue();
				if(i<lfi.length)
					UIManager.setLookAndFeel(lfi[i].getClassName());
			}
		}
		catch(Exception e)
		{
			//System.out.println(e);
		}
		//set up a frame
		JFrame jf=new JFrame();
		jf.setVisible(true);
		jf.setSize(640,480);
		Vector columnNames=new Vector(5,5);
		//set up some data
		for(int i=0;i<5;i++)
		{
			columnNames.addElement("Column "+i);
		}

		Vector data=new Vector(5,5);
		Vector d=new Vector(5,5);
		for(int i=0; i<5; i++)
		{
			Vector p=new Vector(5,5);
			p.addElement("A");
			for(int j=1; j<5; j++)
			{
				p.addElement("Cell "+i+", "+j);
			}
			data.addElement(p);
		}
		DefaultTableModel dt=new DefaultTableModel(data,columnNames);		
		//create a table
		JTable jt=new JTable(dt);
		jt.setSize(640,480);
		jt.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
		//create a cell editor
		Vector letters=new Vector(5,1);
		letters.addElement("A");
		letters.addElement("B");
		letters.addElement("C");
		letters.addElement("D");
		letters.addElement("E");
		JComboBox jb=new JComboBox(letters);
		jb.setLightWeightPopupEnabled(true);
		jb.setEnabled(true);
		jb.setEditable(true);
		DefaultCellEditor dce=new DefaultCellEditor(jb);
		//set the cell editor for the column
		TableColumn tc = jt.getColumn(jt.getColumnName(0));
		tc.setCellEditor(dce);
		
		jf.getContentPane().add(jt);
	}
}
(Review ID: 41128)
======================================================================</TEXTAREA>
		      </td>
                    </tr>
                    <TR>
                      <TD colspan="2" bgcolor="#BFBFBF"> </td>
                    </tr>

<a name="comments"></a>
                    <!-- COMMENTS -->
                    <TR>
                      <TD bgcolor="#BFBFBF" align="left" valign="bottom" height="24"> 
		        <img src="/bugz/images/dot.gif" width="10">Comments
		      </td>
                      <TD bgcolor="#BFBFBF" align="left" valign="bottom" height="24"> 
			<!-- BEGIN:TBR Mohan
 			<A href="javascript:doDateStampSubmit(document.editbug_general, 'comments');"><font size="-1">[ Date Stamp ]</font></A> 
			<img src="/bugz/images/dot.gif" width="18">
			END:TBR -->
			<A href="javascript:doFullPageSubmit(document.editbug_general, 'comments');"><font size="-1">[ Full Page ]</font></a>
		        <img src="/bugz/images/dot.gif" width="22">
		        <FONT size="-1" color="darkblue">---  Enter SUN Proprietary data here  ---</font>
	              </td>
                    </tr>

                    <TR>
                      <TD bgcolor="#BFBFBF" colspan="2" nowrap align="left">
			<img src="/bugz/images/dot.gif" width="5">
                        <TEXTAREA rows="6" cols="95" wrap="virtual" name="comments" align="left" bgcolor="white">
###@###.### 2003-09-09

Comments
Defer request approved by Peter Korn.
23-09-2013

EVALUATION Contribution-Forum:https://jdk-collaboration.dev.java.net/servlets/ProjectForumMessageView?messageID=12159&forumID=1463
21-03-2006

EVALUATION Yes, there is currently no equivalent of mousePressed which is availible from the keyboard.
24-09-2004

WORK AROUND Name: krT82822 Date: 07/11/99 Possible solutions: Write custom cell editor Process events manually (Review ID: 41128) ====================================================================== Custom cell editor developed as workaround is attached. ###@###.### 2001-10-15
15-10-2001