Submitted On 04-APR-2007
Christiaan_se
Any chance this is being fixed in the next update? We have several tables with many columns and since we like to be user friendly we have enabled D&D of the columns. This bug actually is the first thing our users notice! It also seems like a small fix to me.
Submitted On 17-APR-2007
fido7
Very frustrating. This may kill a project I'm working on, as the user is almost required to rearrange columns in a large table. Any workaround would be useful.
Submitted On 27-APR-2007
forcers
FYI: even a simple scroll via chevron click to left causes the display to jump and prohibits correct scrolling.
Submitted On 16-MAY-2007
pleonard@lehman.com
we can't upgrade to v6 because of this - any idea when a fix might happen?
Submitted On 16-MAY-2007
pleonard@lehman.com
this prevents is from updating to v6, an idea when a fix might happen?
Submitted On 29-MAY-2007
sevenM
<quote>
we can't upgrade to v6 because of this - any idea when a fix might happen?
</quote>
Same here. Same question.
Submitted On 15-JUN-2007
A serious user interface problem
Submitted On 15-JUN-2007
A serious user interface problem
Submitted On 15-JUN-2007
A serious user interface problem
Submitted On 03-JUL-2007
Kleopatra
There are several issues with the code:
- the "selectedColumn" of the header is weirdly initialized and not really kept in synch (? should it) with "selected column" in the columnModel.
- no need (AFAICS) to do the back/forth index conversion: all participants (view, ui-delegate, columnModel, mousevents) are in view coordinates
No way to hook into the selected of the header except through a dirty hack: add a mouselistener to the header, force the current column to be selected and perform the action "focusHeader" (from the table's actionMap). Something like:
[code]
public void mousePressed(MouseEvent e) {
int column = header.getColumnModel().getColumnIndexAtX(e.getPoint().x);
if (column >= 0) {
table.setColumnSelectionInterval(column, column);
focusAction.actionPerformed(new ActionEvent(table, 0, "focusHeader"));
}
}
[/code]
Jeanette
Submitted On 04-JUL-2007
mhoesch
Causes us to probably step back from migrating to Java 6 for a large swing application.
Very serious Swing Bug!
Submitted On 19-JUL-2007
Very serious table bug that renders column movement with the mouse almost unusable.
Submitted On 14-AUG-2007
We've already moved forward with a release based on Java6, and its too late to move back to Java5.... a fix for this would be nice, this is a HUGE issue!
Submitted On 14-AUG-2007
Verified that Kleopatra's hack (Submitted On 03-JUL-2007) works for us.
Submitted On 13-SEP-2007
I downloaded and tried Java Plug-in 1.6.0_02, but the problem still exists. Did I download the wrong version?
Submitted On 14-SEP-2007
This bug has been fixed, but these versions, have not yet been released. If you look at the top of the report it says which versions this bug has been fixed:
Release Fixed 7(b20), 6u4(b02)
This means that it was fixed in
JDK7 build 20 (which you will find here (https://jdk7.dev.java.net/)
JDK6 update 4, build 2
-Roger
Submitted On 19-NOV-2007
I implemented Kleopatra's fix and had to ask her how the focusAction variable is obtained. She answered and wanted me to update this bug with her answer.
The complete hack is as follows:
[code]
public void mousePressed(MouseEvent e) {
int column = header.getColumnModel().getColumnIndexAtX(e.getPoint().x);
if (column >= 0) {
table.setColumnSelectionInterval(column, column);
final Action focusAction = table.getActionMap().get("focusHeader");
focusAction.actionPerformed(new ActionEvent(table, 0, "focusHeader"));
}
}
[/code]
Submitted On 01-FEB-2008
Knarf76
The trick of Kleopatra works, and the new Java6u4 also works. But both have the same small problem.
When you drag a column that is in the middle of the JScrollPane and you want to drag it all the way to the right or left you have to:
- Move the column
- Slide the JScrollPane a little
- Move the column
- Slide the JScrollPane a little
- ...
- Until you reached the correct position
With Java6u4 sometimes the JScrollPane does autoscrolling (I think with small (width) columns) but mostly not.
Is there a way so that when you reach the edge of the JScrollPane while dragging a column that the JScrollPane starts scrolling automicly ?
Submitted On 14-AUG-2008
bhurley
In reply to Knarf76:
this is what I have found. Subclass JTable and add this code:
[code]
private MouseMotionListener mouseMotionDraggedAdaptor = new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) {
Rectangle r = new Rectangle(e.getX(), e.getY(), 1, 1);
scrollRectToVisible(r);
}
};
getTableHeader().setAutoscrolls(true);
getTableHeader().addMouseMotionListener(mouseMotionDraggedAdaptor);
[/code}
Submitted On 09-MAR-2009
Georgy_Dimitrov
Hi , I apply this solution.But I will rewrite UI later.
JTable _table = new JTable() {
public int convertColumnIndexToView(int modelColumnIndex) {
if (getTableHeader().getDraggedColumn() != null && getAutoResizeMode() == JTable.AUTO_RESIZE_OFF) {
return super.convertColumnIndexToView(getTableHeader().getDraggedColumn().getModelIndex());
}
return super.convertColumnIndexToView(modelColumnIndex);
}
};
getTableHeader().getDraggedColumn() != null only we drag column
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|