This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Bug in scala.swing.Table?

1 reply
Stefan Ackermann
Joined: 2008-12-22,
User offline. Last seen 42 years 45 weeks ago.

This time I thought I ask the mailing list before I file a bug that is none :)
 
scala.swing.Table behaves weirdly. When I start scala.swing.test.UIDemo and go to the Table Tab and drag around a header of a column, the content of that column changes. The content of the column is always the same, even though I drag the table to another location.

 
Also, sorting within a column does not seem to work, all the content stays in place...
 
I noticed this when trying to port this to Scala:
http://fisheye.codehaus.org/browse/groovy/trunk/groovy/groovy-core/src/main/groovy/model/DefaultTableModel.java?r=12913

 
I can upload the code if anyone is interested, but its a work in progress and I am new to scala...
 

Stefan Ackermann
Joined: 2008-12-22,
User offline. Last seen 42 years 45 weeks ago.
Re: Bug in scala.swing.Table?

Yup I am pretty sure now...
The JTable converts the index:
http://kickjava.com/src/javax/swing/JTable.java.htm#1902
public void setValueAt(Object JavaDoc aValue, int row, int column) {
getModel().getValueAt(row, convertColumnIndexToModel(column));
}

while the override does not:
override def getValueAt(r: Int, c: Int) =
Table.this.apply(r,c).asInstanceOf[AnyRef]

I played a bit around, it has to be fixed in several places otherwise weird
side effects show up...

I will file it...

Stefan Ackermann-4 wrote:
>
> This time I thought I ask the mailing list before I file a bug that is
> none
> :)
>
> scala.swing.Table behaves weirdly. When I start scala.swing.test.UIDemo
> and
> go to the Table Tab and drag around a header of a column, the content of
> that column changes. The content of the column is always the same, even
> though I drag the table to another location.
>
> Also, sorting within a column does not seem to work, all the content stays
> in place...
>
> I noticed this when trying to port this to Scala:
> http://fisheye.codehaus.org/browse/groovy/trunk/groovy/groovy-core/src/m...
>
> I can upload the code if anyone is interested, but its a work in progress
> and I am new to scala...
>
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland