JDK-4832979 : Cursor does not appear in JTable cell editor component when setDragEnabled(true)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0,1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt,windows_2000
  • CPU: x86
  • Submitted: 2003-03-14
  • Updated: 2005-05-06
  • Resolved: 2005-05-06
Related Reports
Duplicate :  
Description

Name: jk109818			Date: 03/14/2003


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)

A DESCRIPTION OF THE PROBLEM :
In JTable, cursor does not appear in cell editor component when drag enabled with any custom or default TransferHandler.	

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start the example
2. Try to start editing by double click on cell


EXPECTED VERSUS ACTUAL BEHAVIOR :
Editing started, JTextField gained keyboard focus

Editing started but keyboard focus isn't transfered to JTextField


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.*;

public class TestStartup extends JFrame {

	protected JPanel cp;

	public TestStartup() {
		super();
	        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		String[][] rowData = new String[][]
			{
				{"first", "second"},
				{"third", "forth"}
			};

		String[] columnNames = new String[]{"first", "second"};

		JTable table = new JTable(rowData, columnNames);
		table.setSurrendersFocusOnKeystroke(true);
		table.setTransferHandler(new TransferHandler("selectionBackground"));
		table.setDragEnabled(true);

                cp = new JPanel(new BorderLayout());
		cp.add(new JScrollPane(table), BorderLayout.NORTH);
		setContentPane(cp);
	}

	public static void main(String[] args) {
		TestStartup test = new TestStartup();
		test.pack();
		test.setVisible(true);
	}
}

---------- END SOURCE ----------
(Review ID: 182653) 
======================================================================

Comments
EVALUATION Not a regression. setDragEnabled(true) seems to have caused this behavior with JTable since the beginning. It should be investigated. ###@###.### 2003-03-17 I've fixed this issue as part of 4521075. Closing as a duplicate. ###@###.### 2005-05-06 19:18:11 GMT
17-03-2003