-
Bug
-
Resolution: Not an Issue
-
P3
-
7u4, 8
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8015914 | 7u40 | Petr Pchelko | P3 | Closed | Won't Fix |
FULL PRODUCT VERSION :
JDK 1.7.0_09_b05
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.8.2
EXTRA RELEVANT SYSTEM CONFIGURATION :
was started with Java Webstart
A DESCRIPTION OF THE PROBLEM :
A JTable in a Dialog is implemented with a JScrollPane.
Drag & Drop from a JTable to a JPanel causes the scroll bars to run to the end. If you try to move the scroll bars with the mouse to the start position, the scrollbar runs again to the end and cannot be stopped. the dialog must be closed to continue working.
REGRESSION. Last worked in version 6u31
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
start the mini application delivered. You will see a JFrame with one JInternalFrame (Worksheet) and a JDialog with a JTable inside and a JScrollPane.
Select a cell in the table and drag it over the right border of the table to the " Worksheet " and release the mouse. The horizontal scroll bar starts running to the right end. Then try to move the scrollbar to the left start. The scroll bar runs again to the end without stop.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no running of scrollbars and no autoscrolling and no change of selection in the table while a drag&drop is performed (as in java 1.6 on Mac and 1.7 on Windows)
ACTUAL -
running of scrollbars without stop and autoscrolling and change of selection while a drag&drop is performed.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package com.classwizard.cw;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.WindowAdapter;
import java.util.Vector;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.WindowConstants;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
public class ClassWizard extends Object
{
static TestFrame testframe = null;
public static void main(String args[]) throws Exception{
try{
testframe = new TestFrame();
testframe.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
testframe.setEnabled(false);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
GJApp.launch(testframe, " ClassWizard " ,0,0,dim.width,dim.height - 28,null);
testframe.setVisible(true);
testframe.getWorksheet().setVisible(true);
testframe.getWorksheet().setPreferredSize(new Dimension(dim.width/2-10, dim.height - 60));
Rectangle bounds2 = new Rectangle(0, 0, dim.width/2-10 -2, dim.height - 60);
testframe.getWorksheet().setBounds(bounds2);
TestDialog dialog = new TestDialog(testframe, " Test " , false);
dialog.init();
dialog.pack();
dialog.setLocationRelativeTo(testframe.getWorksheet());
dialog.setVisible(true);
Thread.sleep(100);
testframe.setEnabled(true);
}catch (Exception a){
System.out.println(a.getMessage());
a.printStackTrace();
}
}
}
class GJApp extends WindowAdapter{
public static void launch(final TestFrame f, String title, final int x, final int y, final int w, int h, String propertiesFilename){
f.setBounds(x,y,w,h);
f.setVisible(true);
}
}
class TestFrame extends JFrame{
TestFrame _testFrame = null;
protected JDesktopPane desktopPane = new JDesktopPane();
protected Page worksheet = null;
public TestFrame() throws Exception{
_testFrame = this;
JComponent contentPane = (JComponent)getContentPane();
contentPane.setDoubleBuffered(true);
contentPane.setLayout(new BorderLayout(0, 0));
try{
contentPane.add(desktopPane,BorderLayout.CENTER);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
worksheet = new Page( " Worksheet " ,true,false,true,true,this);
worksheet.setPreferredSize(new Dimension(dim.width/2-10, dim.height - 60));
desktopPane.add(worksheet);
worksheet.setVisible(false);
desktopPane.setBackground(Color.gray);
}catch(Exception any){
System.out.println( " ClassMaker:
" +any.getMessage());
any.printStackTrace();
}
}
public Page getWorksheet(){
return(worksheet);
}
}
class Page extends JInternalFrame{
protected Canvas canvas = null;
protected JScrollPane _sp = null;
protected TestFrame owner = null;
public Page(String name,boolean resizable,boolean closable, boolean maximizable,boolean iconifiable,TestFrame testFrame){
super(name,resizable,closable,maximizable,iconifiable);
owner = testFrame;
JComponent contentPane = (JComponent)this.getContentPane();
canvas = new Canvas();
canvas.setOwner(this);
Color colcol2 = new Color(220, 220, 220);
canvas.setBackground(colcol2);
_sp = new JScrollPane(canvas);
contentPane.add(_sp,BorderLayout.CENTER);
}
}
class Canvas extends JPanel implements DragGestureListener,DragSourceListener,DropTargetListener{
DragSource dragSource;
DropTarget dropTarget;
Page owner = null;
Image offscreen = null;
public Canvas(){
super();
dragSource = new DragSource();
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
dropTarget = new DropTarget(this, this);
}
@Override
public void paint(Graphics g){
try{
Rectangle r222 = g.getClipBounds();
if(offscreen == null){
int width = getSize().width;
int height = getSize().height;
offscreen = createImage(width, height);
}
Graphics og = offscreen.getGraphics();
og.setClip(r222.x, r222.y, r222.width, r222.height);
super.paint(og);
Rectangle clip = g.getClipBounds();
g.drawImage(offscreen, clip.x, clip.y,clip.x+clip.width,clip.y+clip.height,clip.x, clip.y,clip.x+clip.width,clip.y+clip.height, null);
og.dispose();
}catch (Exception ex){
System.out.println( " ClassMaker:
" +ex.getMessage());
ex.printStackTrace();
}
}
public void setOwner(Page page){
owner = page;
}
@Override
public void paintComponent(Graphics g){
super.paintComponent(g);
}
public void dragGestureRecognized(DragGestureEvent evt){
try{
Transferable t = new StringSelection( " moveLayer " );
dragSource.startDrag (evt, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR), null, new Point(0, 0),t, this);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragEnter(DropTargetDragEvent evt){
try{
evt.acceptDrag(DnDConstants.ACTION_MOVE);
owner.moveToFront();
owner.setSelected(true);
owner.repaint();
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragExit(DropTargetEvent evt){
DropTarget obj = (DropTarget)evt.getSource();
repaint();
}
public void dragOver(DropTargetDragEvent evt){
evt.acceptDrag(DnDConstants.ACTION_MOVE);
repaint();
}
public void dropActionChanged(DropTargetDragEvent arg0){}
public void dragEnter(DragSourceDragEvent arg0){}
public void dragExit(DragSourceEvent evt){
repaint();
}
public void dragOver(DragSourceDragEvent evt){}
public void dropActionChanged(DragSourceDragEvent arg0){}
public void drop(DropTargetDropEvent arg0){
repaint();
}
public void dragDropEnd(DragSourceDropEvent arg0){}
}
class TestDialog extends JDialog{
TestJTable _table = null;
TestTableModel _model = null;
boolean _controll_on = false;
boolean _shift_on = false;
public TestDialog(TestFrame owner, String title, boolean modal){
super(owner,title,modal);
}
public void init(){
try{
// create the table
_model = new TestTableModel(this);
Vector headers = new Vector();
for(int i=0; i < 100; i++){
String header = " header " + i;
headers.add(header);
}
Vector data = new Vector();
for(int i=0; i < 100; i++){
Vector localdata = new Vector();
data.add(localdata);
for(int j=0; j < 100; j++){
String value = " value " + i + j;
localdata.add(value);
}
}
_model.setData(headers, data);
_table = new TestJTable(_model,this);
//Create the scroll pane and add the table to it.
_table.setPreferredScrollableViewportSize(new Dimension(500, 70));
_table.setGridColor(Color.GRAY);
_table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
_table .getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
_table.setColumnSelectionAllowed(true);
_table.setRowSelectionAllowed(true);
JScrollPane _scrollPane = new JScrollPane(_table);
Container diacontent = this.getContentPane();
diacontent.add(_scrollPane, BorderLayout.CENTER);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
class TestJTable extends JTable implements DragGestureListener,DragSourceListener,DropTargetListener{
TestDialog _owner = null;
DragSource dragSource = null;
DropTarget dropTarget = null;
TestJTable(TableModel newModel,TestDialog owner){
super(newModel);
_owner = owner;
dragSource = new DragSource();
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
dropTarget = new DropTarget(this, this);
}
public void dragGestureRecognized(DragGestureEvent evt) {
try{
Transferable t = null;
t = new StringSelection( " place " );
dragSource.startDrag (evt, DragSource.DefaultMoveDrop, null, new Point(0, 0), t, this);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragEnter(DragSourceDragEvent evt){}
public void dragOver(DragSourceDragEvent evt){}
public void dragExit(DragSourceEvent evt){}
public void dropActionChanged(DragSourceDragEvent evt){}
public void dragDropEnd(DragSourceDropEvent evt){}
public void dragEnter(DropTargetDragEvent evt){}
public void dragOver(DropTargetDragEvent evt){}
public void dragExit(DropTargetEvent evt){}
public void dropActionChanged(DropTargetDragEvent evt){}
public void drop(DropTargetDropEvent evt){}
}
class TestTableModel extends AbstractTableModel{
Vector _columnNames = null;
Vector _data = null;
TestDialog _owner = null;
public TestTableModel(TestDialog owner){
super();
_owner = owner;
}
public void setData(Vector columnNames, Vector data){
_columnNames = columnNames;
_data = data;
}
public int getColumnCount(){
return _columnNames.size();
}
public int getRowCount(){
int size = 0;
Vector first = (Vector)_data.get(0);
if(first != null)
{
size = first.size();
}
return(size);
}
@Override
public String getColumnName(int col){
String name = (String)_columnNames.get(col);
return(name);
}
public Object getValueAt(int row, int col){
Vector line = (Vector)_data.get(col);
Object value = line.get(row);
return (value);
}
@Override
public Class getColumnClass(int c){
Class cs = String.class;
try{
Object value = getValueAt(0, c);
if(value != null){
cs = value.getClass();
}
else{
int rows = getRowCount();
for(int i = 1; i < rows; i++){
value = getValueAt(i, c);
if(value != null){
cs = value.getClass();
break;
}
}
}
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
cs = String.class;
}
return cs;
}
}
---------- END SOURCE ----------
JDK 1.7.0_09_b05
ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.8.2
EXTRA RELEVANT SYSTEM CONFIGURATION :
was started with Java Webstart
A DESCRIPTION OF THE PROBLEM :
A JTable in a Dialog is implemented with a JScrollPane.
Drag & Drop from a JTable to a JPanel causes the scroll bars to run to the end. If you try to move the scroll bars with the mouse to the start position, the scrollbar runs again to the end and cannot be stopped. the dialog must be closed to continue working.
REGRESSION. Last worked in version 6u31
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
start the mini application delivered. You will see a JFrame with one JInternalFrame (Worksheet) and a JDialog with a JTable inside and a JScrollPane.
Select a cell in the table and drag it over the right border of the table to the " Worksheet " and release the mouse. The horizontal scroll bar starts running to the right end. Then try to move the scrollbar to the left start. The scroll bar runs again to the end without stop.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
no running of scrollbars and no autoscrolling and no change of selection in the table while a drag&drop is performed (as in java 1.6 on Mac and 1.7 on Windows)
ACTUAL -
running of scrollbars without stop and autoscrolling and change of selection while a drag&drop is performed.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package com.classwizard.cw;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.Toolkit;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.awt.dnd.DnDConstants;
import java.awt.dnd.DragGestureEvent;
import java.awt.dnd.DragGestureListener;
import java.awt.dnd.DragSource;
import java.awt.dnd.DragSourceDragEvent;
import java.awt.dnd.DragSourceDropEvent;
import java.awt.dnd.DragSourceEvent;
import java.awt.dnd.DragSourceListener;
import java.awt.dnd.DropTarget;
import java.awt.dnd.DropTargetDragEvent;
import java.awt.dnd.DropTargetDropEvent;
import java.awt.dnd.DropTargetEvent;
import java.awt.dnd.DropTargetListener;
import java.awt.event.WindowAdapter;
import java.util.Vector;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.WindowConstants;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.TableModel;
public class ClassWizard extends Object
{
static TestFrame testframe = null;
public static void main(String args[]) throws Exception{
try{
testframe = new TestFrame();
testframe.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
testframe.setEnabled(false);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
GJApp.launch(testframe, " ClassWizard " ,0,0,dim.width,dim.height - 28,null);
testframe.setVisible(true);
testframe.getWorksheet().setVisible(true);
testframe.getWorksheet().setPreferredSize(new Dimension(dim.width/2-10, dim.height - 60));
Rectangle bounds2 = new Rectangle(0, 0, dim.width/2-10 -2, dim.height - 60);
testframe.getWorksheet().setBounds(bounds2);
TestDialog dialog = new TestDialog(testframe, " Test " , false);
dialog.init();
dialog.pack();
dialog.setLocationRelativeTo(testframe.getWorksheet());
dialog.setVisible(true);
Thread.sleep(100);
testframe.setEnabled(true);
}catch (Exception a){
System.out.println(a.getMessage());
a.printStackTrace();
}
}
}
class GJApp extends WindowAdapter{
public static void launch(final TestFrame f, String title, final int x, final int y, final int w, int h, String propertiesFilename){
f.setBounds(x,y,w,h);
f.setVisible(true);
}
}
class TestFrame extends JFrame{
TestFrame _testFrame = null;
protected JDesktopPane desktopPane = new JDesktopPane();
protected Page worksheet = null;
public TestFrame() throws Exception{
_testFrame = this;
JComponent contentPane = (JComponent)getContentPane();
contentPane.setDoubleBuffered(true);
contentPane.setLayout(new BorderLayout(0, 0));
try{
contentPane.add(desktopPane,BorderLayout.CENTER);
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
worksheet = new Page( " Worksheet " ,true,false,true,true,this);
worksheet.setPreferredSize(new Dimension(dim.width/2-10, dim.height - 60));
desktopPane.add(worksheet);
worksheet.setVisible(false);
desktopPane.setBackground(Color.gray);
}catch(Exception any){
System.out.println( " ClassMaker:
" +any.getMessage());
any.printStackTrace();
}
}
public Page getWorksheet(){
return(worksheet);
}
}
class Page extends JInternalFrame{
protected Canvas canvas = null;
protected JScrollPane _sp = null;
protected TestFrame owner = null;
public Page(String name,boolean resizable,boolean closable, boolean maximizable,boolean iconifiable,TestFrame testFrame){
super(name,resizable,closable,maximizable,iconifiable);
owner = testFrame;
JComponent contentPane = (JComponent)this.getContentPane();
canvas = new Canvas();
canvas.setOwner(this);
Color colcol2 = new Color(220, 220, 220);
canvas.setBackground(colcol2);
_sp = new JScrollPane(canvas);
contentPane.add(_sp,BorderLayout.CENTER);
}
}
class Canvas extends JPanel implements DragGestureListener,DragSourceListener,DropTargetListener{
DragSource dragSource;
DropTarget dropTarget;
Page owner = null;
Image offscreen = null;
public Canvas(){
super();
dragSource = new DragSource();
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
dropTarget = new DropTarget(this, this);
}
@Override
public void paint(Graphics g){
try{
Rectangle r222 = g.getClipBounds();
if(offscreen == null){
int width = getSize().width;
int height = getSize().height;
offscreen = createImage(width, height);
}
Graphics og = offscreen.getGraphics();
og.setClip(r222.x, r222.y, r222.width, r222.height);
super.paint(og);
Rectangle clip = g.getClipBounds();
g.drawImage(offscreen, clip.x, clip.y,clip.x+clip.width,clip.y+clip.height,clip.x, clip.y,clip.x+clip.width,clip.y+clip.height, null);
og.dispose();
}catch (Exception ex){
System.out.println( " ClassMaker:
" +ex.getMessage());
ex.printStackTrace();
}
}
public void setOwner(Page page){
owner = page;
}
@Override
public void paintComponent(Graphics g){
super.paintComponent(g);
}
public void dragGestureRecognized(DragGestureEvent evt){
try{
Transferable t = new StringSelection( " moveLayer " );
dragSource.startDrag (evt, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR), null, new Point(0, 0),t, this);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragEnter(DropTargetDragEvent evt){
try{
evt.acceptDrag(DnDConstants.ACTION_MOVE);
owner.moveToFront();
owner.setSelected(true);
owner.repaint();
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragExit(DropTargetEvent evt){
DropTarget obj = (DropTarget)evt.getSource();
repaint();
}
public void dragOver(DropTargetDragEvent evt){
evt.acceptDrag(DnDConstants.ACTION_MOVE);
repaint();
}
public void dropActionChanged(DropTargetDragEvent arg0){}
public void dragEnter(DragSourceDragEvent arg0){}
public void dragExit(DragSourceEvent evt){
repaint();
}
public void dragOver(DragSourceDragEvent evt){}
public void dropActionChanged(DragSourceDragEvent arg0){}
public void drop(DropTargetDropEvent arg0){
repaint();
}
public void dragDropEnd(DragSourceDropEvent arg0){}
}
class TestDialog extends JDialog{
TestJTable _table = null;
TestTableModel _model = null;
boolean _controll_on = false;
boolean _shift_on = false;
public TestDialog(TestFrame owner, String title, boolean modal){
super(owner,title,modal);
}
public void init(){
try{
// create the table
_model = new TestTableModel(this);
Vector headers = new Vector();
for(int i=0; i < 100; i++){
String header = " header " + i;
headers.add(header);
}
Vector data = new Vector();
for(int i=0; i < 100; i++){
Vector localdata = new Vector();
data.add(localdata);
for(int j=0; j < 100; j++){
String value = " value " + i + j;
localdata.add(value);
}
}
_model.setData(headers, data);
_table = new TestJTable(_model,this);
//Create the scroll pane and add the table to it.
_table.setPreferredScrollableViewportSize(new Dimension(500, 70));
_table.setGridColor(Color.GRAY);
_table.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
_table .getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
_table.setColumnSelectionAllowed(true);
_table.setRowSelectionAllowed(true);
JScrollPane _scrollPane = new JScrollPane(_table);
Container diacontent = this.getContentPane();
diacontent.add(_scrollPane, BorderLayout.CENTER);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
}
class TestJTable extends JTable implements DragGestureListener,DragSourceListener,DropTargetListener{
TestDialog _owner = null;
DragSource dragSource = null;
DropTarget dropTarget = null;
TestJTable(TableModel newModel,TestDialog owner){
super(newModel);
_owner = owner;
dragSource = new DragSource();
dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
dropTarget = new DropTarget(this, this);
}
public void dragGestureRecognized(DragGestureEvent evt) {
try{
Transferable t = null;
t = new StringSelection( " place " );
dragSource.startDrag (evt, DragSource.DefaultMoveDrop, null, new Point(0, 0), t, this);
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}
public void dragEnter(DragSourceDragEvent evt){}
public void dragOver(DragSourceDragEvent evt){}
public void dragExit(DragSourceEvent evt){}
public void dropActionChanged(DragSourceDragEvent evt){}
public void dragDropEnd(DragSourceDropEvent evt){}
public void dragEnter(DropTargetDragEvent evt){}
public void dragOver(DropTargetDragEvent evt){}
public void dragExit(DropTargetEvent evt){}
public void dropActionChanged(DropTargetDragEvent evt){}
public void drop(DropTargetDropEvent evt){}
}
class TestTableModel extends AbstractTableModel{
Vector _columnNames = null;
Vector _data = null;
TestDialog _owner = null;
public TestTableModel(TestDialog owner){
super();
_owner = owner;
}
public void setData(Vector columnNames, Vector data){
_columnNames = columnNames;
_data = data;
}
public int getColumnCount(){
return _columnNames.size();
}
public int getRowCount(){
int size = 0;
Vector first = (Vector)_data.get(0);
if(first != null)
{
size = first.size();
}
return(size);
}
@Override
public String getColumnName(int col){
String name = (String)_columnNames.get(col);
return(name);
}
public Object getValueAt(int row, int col){
Vector line = (Vector)_data.get(col);
Object value = line.get(row);
return (value);
}
@Override
public Class getColumnClass(int c){
Class cs = String.class;
try{
Object value = getValueAt(0, c);
if(value != null){
cs = value.getClass();
}
else{
int rows = getRowCount();
for(int i = 1; i < rows; i++){
value = getValueAt(i, c);
if(value != null){
cs = value.getClass();
break;
}
}
}
}catch (Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
cs = String.class;
}
return cs;
}
}
---------- END SOURCE ----------
- backported by
-
JDK-8015914 Drag&Drop from a JTable causes a scrollbar to run without stop
-
- Closed
-