bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug swing/25770] New: JTable cell editor does not start after double cl


From: audriusa at bluewin dot ch
Subject: [Bug swing/25770] New: JTable cell editor does not start after double clicking on the cell.
Date: 12 Jan 2006 18:07:36 -0000

Despite JTable with model is displayed correctly, the cell editor that should
start after double clicking on the cell does not start. In the following test
case below, it is possible to edit the cell content in Sun's jre, but it is not
possible to edit the cell content with the recent CVS version of GNU Classpath.
I set the major severity, because inability to edit cells makes the table
unusable in some applications.

package main;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.table.AbstractTableModel;

public class TableTest extends JFrame
{
  JTable table = new JTable();

  TModel model = new TModel();

  String[][] values;

  public TableTest()
  {
    try
      {
        jbInit();

        values = new String[3][];
        for (int i = 0; i < values.length; i++)
          {
            values[i] = new String[] { "a" + i, "b" + i, "c" + i };
          }
        table.setModel(model);
      }
    catch (Exception e)
      {
        e.printStackTrace();
      }
  }

  private void jbInit() throws Exception
  {
    this.getContentPane().add(table, BorderLayout.CENTER);
  }

  class TModel extends AbstractTableModel
  {

    public boolean isCellEditable(int parm1, int parm2)
    {
      return true;
    }

    public int getRowCount()
    {
      return 3;
    }

    public int getColumnCount()
    {
      return 3;
    }

    public void setValueAt(Object parm1, int parm2, int parm3)
    {
      values[parm2][parm3] = "" + parm1;
    }

    public Object getValueAt(int parm1, int parm2)
    {
      return values[parm1][parm2];
    }

    public String getColumnName(int parm1)
    {
      return "Header for " + parm1;
    }

  }

  public static void main(String[] args)
  {
    TableTest frame = new TableTest();
    frame.setSize(new Dimension(640, 100));
    frame.validate();
    frame.setVisible(true);
  }
}


-- 
           Summary: JTable cell editor does not start after double clicking
                    on the cell.
           Product: classpath
           Version: 0.20
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: swing
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: audriusa at bluewin dot ch


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25770





reply via email to

[Prev in Thread] Current Thread [Next in Thread]