Tíquete #15110

Support JTable
: 2009-02-17 11:08 Última Atualização: 2009-02-22 14:13

Relator:
Dono:
Tipo:
Estado:
Fechado
Componente:
Prioridade:
9 - Highest
Gravidade:
5 - Medium
Resolução:
Fixed
Arquivo:
1

Details

I am using JTable to display data, but I need use JTable to edit data too.

JTable is not allowing editing cells in MySaifu, I am making the cells editable overriding the method of the class javax.swing.table.DefaultTableModel.

The following code reproduce the bug.

public class TableTest extends JFrame {

	public TableTest(String title) {
		super(title);
		setSize(150, 150);
		addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent we) {
				dispose();
				System.exit(0);
			}
		});
		init();
		pack();
		setVisible(true);
	}

	private void init() {
		JTable jt = new JTable(new TestTableModel());
		JScrollPane pane = new JScrollPane(jt);
		getContentPane().add(pane);
	}
	
	public static void main(String[] argv) {
		new TableTest("JTable Example");
	}
}

public class TestTableModel extends DefaultTableModel {

	private static Object data[][] = { { "John", "Sutherland", "Student" },
			{ "George", "Davies", "Student" },
			{ "Melissa", "Anderson", "Associate" },
			{ "Stergios", "Maglaras", "Developer" }, };

	private static Object fields[] = { "Name", "Surname", "Status" };
	
	public TestTableModel() {
		super(data, fields);
	}
	
	public boolean isCellEditable(int row, int column) {
		return true;
	}
}

Be able of edit JTable cells is very important to improve usability of the user inteface in my system.

Ticket History (3/5 Histories)

2009-02-17 11:08 Updated by: palzuri
  • New Ticket "Support JTable" created
2009-02-17 23:46 Updated by: freebeans
  • Marco Update from (Nenhum) to jvm0.4.4 (fechado)
  • Dono Update from (Nenhum) to freebeans
  • Componente Update from (Nenhum) to v0.4.3
  • Resolução Update from Nenhum to Accepted
Comentário

I found a cause of this problem. Mysaifu JVM cannot handle double click. I'll fix it.

2009-02-19 00:57 Updated by: freebeans
  • Resolução Update from Accepted to Fixed
Comentário

Fixed.

2009-02-22 14:13 Updated by: freebeans
  • Estado Update from Aberto to Fechado
  • Ticket Close date is changed to 2009-02-22 14:13

Attachment File List

Editar

Please login to add comment to this ticket » Login