This patch breaks JTables where cell selection is allowed.  Attached to
this email is a test case, running it on the JDK shows that selecting
cells is allowed, and running it on ours selects only entire rows.

Reverting the patch solves this problem, so something is either wrong in
this patch or wrong elsewhere and needs to be fixed along with this
patch.

--Tony

On Mon, 2005-10-17 at 15:18 +0000, Roman Kennke wrote:
> This fixes painting of selected cells/rows.
> 
> 2005-10-17  Roman Kennke  <[EMAIL PROTECTED]>
> 
>         * javax/swing/DefaultTableCellRenderer.java
>         (getTableCellRendererComponent): Setup colors (more) correctly.
>         * javax/swing/DefaultListSelectionModel.java
>         (isSelectedIndex): Check for an illegal index argument.
> 
> 
> /Roman
> _______________________________________________
> Classpath-patches mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/classpath-patches
import javax.swing.*;

class TestCase
{
  public static void main(String args[])
  {
    JFrame jf = new JFrame();
    JPanel topPanel;
    JTable table;
    JScrollPane scrollPane;

    // Create a panel to hold all other components
    topPanel = new JPanel();
    jf.getContentPane().add( topPanel );
    
    // Create columns names
    String columnNames[] = { "Column 1", "Column 2", "Column 3" };
    
    // Create some data
    String dataValues[][] =
      {
        { "12", "234", "67" },
        { "-123", "43", "853" },
        { "93", "89.2", "109" },
        { "279", "9033", "3092" }
      };
    
    // Create a new table instance
    table = new JTable( dataValues, columnNames );

    table.setColumnSelectionAllowed(true);
    table.setRowSelectionAllowed(true);

    // Add the table to a scrolling pane
    scrollPane = new JScrollPane( table );
    topPanel.add( scrollPane);

    jf.pack();
    jf.show();
  }
}
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to