JTable cell being edited after model changed.

I have a fairly simple JTable, with a implementation of AbstractTableModel supplying the data. The cells are edited by using a JComboBox. I wrap these into a DefaultCellEditor. I have a KeyListener attached to the JTable listening for VK_DELETE, and when it finds one, instructs the model to delete the row represented by the selected row in the table.
Everything works fine until I want to delete a row from the table. My scenario is:
- I click in a cell, and the editor opens.
- I select an entry in the list. The editor closes, the result is rendered, and the wee yellow box around the cell is shown
- I hit the delete key.
- My key listener picks up the event, and informs the model to delete the row. I remove the row from the model and invoke fireTableDataChanged().
The result is that the row is deleted, but the table ends up with the cell editor deployed on the cell of the row below (which is now at the same row as the one I just deleted).
My tracing shows that the isCellEditable is called on the model after the delete. I don't know why.
Can anyone explain how to prevent this or what might be causing the table to think that the cell needs editing?
Thanks, Andrew

It will do whatever is the default. I wrap the JComboBox in a DefaultCellEditor. I can't see how the editor is involved at this point, or why the editor becomes involved after the row has been deleted.
Remember, at the time that I hit the delete key, there is no editor rendered or visible. I have the JTable displayed, a row selected, and the yellow box around one of the (editable but not currently being edited) cells. This has been achieved by editing a cell (displaying the cell editor - a combo box) and selecting an entry. The editor is removed, and the cell displayed with the (default) cell renderer for the table.
The delete action is caught by the listener on the table, the model is instructed to delete a row from its underlying data, which fires a fireTableDataChanged event.
That is all I do. After that it is all swing. The table model starts getting asked about cells being editable after I have finished deleting the row. I'll post the relevant code below if that helps.
The datamodel is of class ConstraintTableModel (see below) and the column model is of class DefaultTableColumnModel
JTable table = new JTable( dataModel, columnModel );The column model is defined liike so:
columnModel = new DefaultTableColumnModel();
TableColumn labelColumn = new TableColumn(ConstraintTableModel.LABEL_COLUMN);
labelColumn.setHeaderValue( dataModel.getColumnName(ConstraintTableModel.LABEL_COLUMN));
labelColumn.setPreferredWidth( 5 );
labelColumn.setMaxWidth( 5 );
labelColumn.setResizable( false );
TableColumn taskColumn = new TableColumn(ConstraintTableModel.TASK_COLUMN);
taskColumn.setHeaderValue( dataModel.getColumnName(ConstraintTableModel.TASK_COLUMN));
TableColumn typeColumn = new TableColumn(ConstraintTableModel.TYPE_COLUMN);
typeColumn.setHeaderValue( dataModel.getColumnName(ConstraintTableModel.TYPE_COLUMN));
columnModel.addColumn( labelColumn );
columnModel.addColumn( taskColumn );
columnModel.addColumn( typeColumn );I add the key listener like so:
table.addKeyListener( new KeyAdapter()
    public void keyPressed( KeyEvent e )
      if( e.getKeyCode() == KeyEvent.VK_DELETE )
        log.debug("Delete pressed in listener attached to table ");
        JTable t = (JTable) e.getSource();
        int selectedRow = t.getSelectedRow();
        if( selectedRow >= 0 )
          log.debug("  Removing row " + selectedRow);
          ((ConstraintTableModel)t.getModel()).removeRow(selectedRow);
        log.debug("Finished with key press");
  } );The cell editor is created like this:
JComboBox taskEditorComponent = new JComboBox( tasksModel );
taskEditorComponent.setFont( GanttChart.tableFont );
taskEditorComponent.setBackground( Color.WHITE );
DefaultCellEditor taskEditor = new DefaultCellEditor(taskEditorComponent);
taskEditor.setClickCountToStart( 1 );
table.setDefaultEditor( GanttTask.class, taskEditor );The model is coded like so:
class ConstraintTableModel extends AbstractTableModel
    // Constants
    public static final int LABEL_COLUMN = 0;
    public static final int TASK_COLUMN = 1;
    public static final int TYPE_COLUMN = 2;
    private Vector          columnNames;
    private ArrayList       dataRows;
    public ConstraintTableModel()
        super();
        this.buildDataVector();
        this.addPrimerRow();
     * Every row in the table is a GanttConstraint. Therefore when deciding what to
     * display in any particular column of the table, we need to determine what the
     * column is, and then use the informatino in the GanttConstraint to go out to the
     * lookup and get the relevant object, and value to display.
    public Object getValueAt( int row, int col )
        Object          returnObject = "";
        GanttConstraint aConstraint = (GanttConstraint) this.getDataRows().get( row );
        // We're rendering the task column. If there's no task id (partially filled in row)
        // return blank otherwise return the master task
        else if( col == ConstraintTableModel.TASK_COLUMN )
            if( aConstraint.getMasterId() != null )
                GanttTask masterTask = (GanttTask) real.getLookup().get( aConstraint.getMasterId() );
                returnObject = masterTask;
        // We're rendering the type column. If there's no type (partially filled in row)
        // return blank otherwise return the constraint type
        else if( col == ConstraintTableModel.TYPE_COLUMN )
            if( aConstraint.getType() != null )
                GanttConstraintType constraintType = (GanttConstraintType) GanttConstraintType.getConstraintTypes()
                                                                                                 .get( aConstraint.getType()
                                                                                                                  .intValue() );
                returnObject = constraintType;
        return returnObject;
     * When we receive this message, we are handed an object of the type specified in
     * getColumnClass. We need to take this object and place the relevant information into
     * the GanttConstraint row in the table model.
     * Depending on whether the row being modified is an existing row or a new row, set
     * the state of the constraint appropriately.
     * @see javax.swing.table.TableModel#setValueAt(java.lang.Object, int, int)
    public void setValueAt( Object value, int row, int col )
        log.debug( "+setValueAt (row/col) " + row + "/" + col );
        if ( value == null )
            log.debug( "  handed a null value. Returning" );
            return;
        GanttConstraint aConstraint = (GanttConstraint) this.getDataRows().get( row );
        // If we are modifying the primer row, add another primer row.
        if( row == ( this.getRowCount() - 1 ) ) // Last row is always the primer
            log.debug( "  adding a primer row" );
            this.addPrimerRow();
        // We're modifying the Task data. Get the GanttTask handed to us and place it
        // into the master slot in the constraint.
        if( col == ConstraintTableModel.TASK_COLUMN ) // Task
            log.debug( "  updating the master task" );
            GanttTask selectedTask = (GanttTask) value;
            aConstraint.setMaster( selectedTask );
        // We're modifying the Type data. Get the GanttConstraintType handed to us and place it
        // into the type slot in the constraint.
        if( col == ConstraintTableModel.TYPE_COLUMN ) // Constraint type
            log.debug( "  updating the constraint type" );
            GanttConstraintType selectedConstraintType = (GanttConstraintType) value;
            aConstraint.setType( selectedConstraintType.getType() );
        log.debug( "-setValueAt" );
    public Class getColumnClass( int col )
        Class columnClass = super.getColumnClass( col );
        if( col == ConstraintTableModel.LABEL_COLUMN )
            columnClass = String.class;
        if( col == ConstraintTableModel.TASK_COLUMN )
            columnClass = GanttTask.class;
        if( col == ConstraintTableModel.TYPE_COLUMN )
            columnClass = GanttConstraintType.class;
        return columnClass;
    // We are handing the data storage
    public void setDataRows( ArrayList dataRows )
        this.dataRows = dataRows;
    public boolean isCellEditable( int row, int col )
        log.debug( "+isCellEditable (row/col) " + row + "/" + col );
        if( !real.canEdit() )
            return false;
        if( ( col == ConstraintTableModel.TASK_COLUMN ) ||
                ( col == ConstraintTableModel.TYPE_COLUMN ) )
            return true;
        else
            return false;
    // We are handing the data storage
    public ArrayList getDataRows()
        return this.dataRows;
    public String getColumnName( int column )
        return (String) this.getColumnNames().get( column );
     * Clean up rows that do not have both the master task and type set. Not interested in them
    public void removeDirtyRows()
        log.debug( "+removeDirtyRows" );
        Iterator dataIterator = this.getDataRows().iterator();
        while( dataIterator.hasNext() )
            GanttConstraint element = (GanttConstraint) dataIterator.next();
            if( ( element.getMasterId() == null ) || ( element.getType() == null ) )
                element.setTransient();
                dataIterator.remove();
        fireTableDataChanged();
        log.debug( "-removeDirtyRows" );
    public void removeRow( int row )
        log.debug( "+removeRow(" + row + ")" );
        if( row < this.getDataRows().size() )
            GanttConstraint aConstraint = (GanttConstraint) this.getDataRows().get( row );
            this.getDataRows().remove( row );
            if( aConstraint.isClone() )
                aConstraint.setDeleted();
            else
                aConstraint.setTransient();
                getClone().removeConstraint( aConstraint );
            fireTableDataChanged();
        if( this.getRowCount() == 0 )
            this.addPrimerRow();
        log.debug( "-removeRow" );
    public void clearRow( int row )
        log.debug( "+clearRow(" + row + ")" );
        if( row < this.getDataRows().size() )
            GanttConstraint aConstraint = (GanttConstraint) this.getDataRows().get( row );
            aConstraint.setMasterId( null );
            aConstraint.setType( null );
            fireTableRowsUpdated( row, row );
        log.debug( "-clearRow" );
    public int getColumnCount()
        return getColumnNames().size();
    public int getRowCount()
        return dataRows.size();
     * The table will be filled with constraints relevant to 'clone'.
    private void buildDataVector()
        ArrayList  data = new ArrayList( 1 );
        Collection allConstraints = getClone().getStartConstraints();
        allConstraints.addAll( getClone().getEndConstraints() );
        Iterator constraintIter = allConstraints.iterator();
        while( constraintIter.hasNext() )
            GanttConstraint element = (GanttConstraint) constraintIter.next();
            if( element.getType().equals( GanttConstraint.START_SPECIFIED ) ||
                    element.getType().equals( GanttConstraint.FINISH_FROM_DURATION ) )
                continue;
            else
                data.add( element );
        this.setDataRows( data );
    private Vector getColumnNames()
        if( columnNames == null )
            columnNames = new Vector( 3 );
            columnNames.add( " " ); // Needs space otherwise all the headers disappear
            columnNames.add( "Task" );
            columnNames.add( "Constraint" );
        return columnNames;
    private void addPrimerRow()
        log.debug( "+addPrimerRow" );
        // Create a constraint for the 'clone' task. Set it as transient until validation
        // where we will deal with it if necessary.
        GanttConstraint primer = new GanttConstraint( real.getLookup() );
        primer.setObjectId( chart.getNextUniqueId() );
        primer.setTransient();
        primer.setSlave( getClone() );
        primer.setProject( getClone().getProject() );
        getClone().addConstraint( primer );
        this.getDataRows().add( primer );
        int lastRow = this.getRowCount() - 1;
        fireTableRowsInserted( lastRow, lastRow );
        log.debug( "-addPrimerRow" );

Similar Messages

  • Must double click JTable cell to edit - Why?

    Hi there,
    I have a custom JTable model, which overrides the isCellEditable method and returns true for the first column. All nice, only that column now gets editable - but why do I have to double click in the cell to be able to edit in it? I've seen swing gui's where the cell gets editable on single click/focus...
    Very thankful for any help in resolving this!
    Best regard,
    AC

    Add a mouselistener to your table and in the mousePressed() method set the editing cell:
    table.editCellAt(row, column);
    table.setEditingRow(row);
    table.setEditingColumn(column);
    table.repaint();

  • How to get the row & col of the cell being edited?

    I have a reference to a editable JTable, and I want to know at any point in time, what cell the user is editing (specifically the row & col).
    You'd think you could just go:
    int col = table.getActiveCellColumn();
    int row = table.getActiveCellRow();
    Where the active cell is the one the user is typing in.
    I tried getting the rectangle of the permenant focus owner and using that to get a Point object, then testing the table using columnAtPoint and rowAtPoint, but sometimes the cell is returned as the foucs owner and sometimes the whole table is returned (which does not help). Any ideas?

    You'd think you could just go:
    int col = table.getActiveCellColumn();
    int row = table.getActiveCellRow();Or maybe:
    table.getEditingRow();
    table.getEditingColumn();

  • Jpeg-Header is being edited after files are moved

    My problem which I have already posted in another forum, is that after I moved jpeg-files from one folder to another on the same partition (my photo collection) these files have been edited and gain size approx. between 2 KB and 5 KB. The conclusion from answers in the other forum was that Photoshop (or another Adobe program) is putting this line: "http://ns.adobe.com/xap/1.0/" into the jpeg-header. I wonder why this is happening as I do not mean to edit the photo through whatever program while just moving it.
    Michael

    How are you moving the files? With photoshop? Windows Explorer? Bridge? another program as there are way too many to list program?
    If you are using an image editor such as photoshop to are open and then saving which can alter the header, however a file viewer such as Bridge or windows explorer will not alter the file unless tou do something to cause it to. In this case I am thinking of Bridge which will let you alter the meta data. Windows explorer to my knowledge no longer alters the meta data, but I may have not run across that issue yet, so take that with a grain of salt.

  • JTree in JScrollPane not resizing after model change.

    I have a JTree in a JScrollPane that's put in a JPanel using the JGoodies FormLayout as it's layout manager. The column definition defines the column to grow so the JScrollPane should have enough space. The tree is empty when I create it and put it in the JScrollPane.
    After adding some nodes to the tree the JScrollPane does not resize automatically, it only resizes when a forced repaint occurs (moving or resizing the window , etc).
    I've tried calling invalidate(), repaint(),revalidate() on both the JTree and the JScrollPane. I also do a reload() on the TreeModel after adding the nodes (which is probably unnecessary as I use insertNodeInto(node,parent,position) from the DefaultTreeModel to add the new nodes).
    Anybody knows what I'm missing here?
    Thanks a lot in advance !

    Update:
    The card is running now. I had another Arch system (arch2) on the same network (to compare with), and after I shut that down and rebooted the first one (arch1) the network interfaces show up, both lo and eth0.
    However, the startup routine hangs about 2-3 minutes on the network daemon (with blinking router lights and hdd activity), so it's still not perfect. Another thing is that I can't get the right gateway from the router's dhcp. Here's an overview of the setup:
    Home: 192.168.2.x
    arch1 .2.102-------|
    |
    arch2 .2.101-------| old SMC router: .2.1
    |
    fritzbox .2.2 -----|
    router/modem
    |
    |
    ~~~~~
    internet
    The gateway is supposed to be the fritzbox with ip 192.168.2.2. The old SMC router serves addresses in the range .2.101-110. I set it up this way because I need the 8 ports on the SMC (and I like watching the lights).
    Here's my /etc/rc.conf for both systems:
    arch1 (starts slow):
    eth0="dhcp"
    ROUTES=(!gateway)
    arch2 (working):
    eth0="eth0 192.168.2.101 netmask 255.255.255.0 broadcast 192.168.2.255"
    gateway="default gw 192.168.2.2"
    ROUTES=(gateway)
    arch1 gets the SMC as gateway, arch2 gets the fritzbox.
    Ideally all computers on the network should get their IPs from the SMC dhcp, which also gives them the fritzbox as gateway. But that just doesn't work for the arch1. arch2 and the windows PCs get online just fine.
    I had also tried setting arch1 the same as arch2 except for the ip=2.102. Then the network starts faster, but the gateway is still stuck at the SMC router -> no internet.
    Rather complicated, but what are networks for? Anyone see daylight in this mess?
    Last edited by bitpal (2009-08-13 21:24:02)

  • How to write an element in a  JTable Cell

    Probably it's a stupid question but I have this problem:
    I have a the necessity to build a JTable in which, when I edit a cell and I push a keyboard button, a new Frame opens to edit the content of the cell.
    But the problem is how to write something in the JTable cell, before setting its model. Because, I know, setCellAT() method of JTree inserts the value in the model and not in the table view. And repainting doesn't function!
    What to do??
    Thanks

    Hi there
    Depending on your table model you should normally change the "cell value" of the tablemodel.
    This could look like:
    JTable table = new JTable();
    TableModel model = table.getModel();
    int rowIndex = 0, columnIndex = 0;
    model.setValueAt("This is a test", rowIndex, columnIndex);
    The tablemodel should then fire an event to the view (i.e. JTable) and the table should be updated.
    Hope this helps you

  • Problem w/ MouseMotionListener on JTable cell

    Hey everyone,
    I am using a MouseMotionListener on a JTable, and in most cases it works fine. The case where it does NOT work as I would expect is when you are editing a cell. In that case, events do not register when the mouse is moving over the cell being edited. I'm assuming that for some reason the cell editor maybe is receiving the events... but I'm not sure that is the case, and if it is, not sure how to deal with it. Here's a very basic example:
    ***************** begin code example ************************************
    public class Main extends JFrame {
    /** Creates a new instance of Main */
    public Main() {
    this.setLayout(new BorderLayout());
    JPanel panel = new JPanel();
    JTable theTable = new JTable(1,1);
    theTable.addMouseMotionListener(new MouseMotionListener() {
                   public void mouseDragged(MouseEvent e) {
                        // TODO Auto-generated method stub
                   public void mouseMoved(MouseEvent e) {
                        System.out.println("Mouse Moved");
    panel.add(theTable);
    this.add(panel,BorderLayout.NORTH);
    this.setSize(100,100);
    setVisible(true);
    * @param args the command line arguments
    public static void main(String[] args) {
    Main main = new Main();
    ***************** end code example **************************************
    Now, what I want to do is be able to have a listener not only on the table, but also on the cells (even when they are being edited). It is worth noting that the listener still functions around the borders of the cell... just not when mousing over the cell itself. What is going on with this? What is the best way for me to achieve my desired results?
    Thanks in advance,
    Jared

    Thanks for the tip on code formatting tags camickr. I'm (obviously) new to the forums.
    I am using "balloon tool tips" (can be seen here: https://balloontip.dev.java.net) to display information about the columns. The way I am currently doing it is that I have a MouseMotionListener on the entire JTable, and I attach the balloon tool tip to the header directly above the center of the column that the mouse is over. The way I am able to always know where to attach the balloon tool tip at the top is by using the events from the MouseMotionListener, as well as the X coordinate provided by the event. It works wonderfully... until one of the cells is being edited. At that point it works wonderfully on every part of the JTable except that one cell.
    Does that answer your question?
    Thanks again,
    Jared

  • How to automatically highlight / bold words in a JTable cell?

    how do i do it?
    i have an Object called Data (where toString() is the same as getDataName()).
    and i want the JTable to either highlight or bold specific words (using the bold HTML tags) that are present in a SortedSet.
    i do not want the dataName to be changed by directly manipulating the Object because the Data Objects were taken from the DB and i need the Objects and the records to be synchronised, and because the words in the SortedSet itself are subject to changes (add/edit/remove).
    thanks.

    Edit: removed
    db
    Cross posted
    http://www.java-forums.org/awt-swing/47138-how-automatically-highlight-bold-words-jtable-cell.html
    Edited by: Darryl Burke

  • After I make minor changes to my collections, the following message appears :Sorry, this page is currently being edited. Please try again later. It sometimes takes hours for me to be able to edit site again.

    After I make minor changes to my collections, the following message appears :Sorry, this page is currently being edited. Please try again later. It sometimes takes hours for me to be able to edit site again even if the only thing I'm changing is a description.

    Greetings;
         Take a look at this related discussion.  Others have been experiencing the same issue.  I hope that this discussion will help you resolve your issue.  All the best...
         https://discussions.apple.com/message/17781516#17781516
    Syd Rodocker
    iTunes U Administrator
    Tennessee State Department of Education
    Tennessee's Electronic Learning Center

  • Data changes in JTable cell.

    Hi all,
    On editing a cell in a Jtable ,necessary changes must get enforced in the corresponding cells of the same JTable.For example,I have fields called Quantity ,SalePrice and TotalAmount in a Jtable,where the Quantity field is editable.When i edit the Quantity value,a calculation (Changed Quantity *SalePrice)=TotalPrice must happen .Hence the Total Amount field must get Updated now.This must occur when I edit the Quantity and press Tab.No Button action is involved.Please tell me how to do this.the JTable does not use any TableModel.Thanks in advance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    As I said in your other post, your table does have a model.
    What you seem to be saying is that your table has some calculated columns. If so then you should create an explicit table model so that when a cell is update the setValueAt() method performs any calculations based on this change and updates the rest of the model.
    Remember to fire the appropriate events after the change.

  • Way to listen for change in JTable cell?

    I am having troubles trying to catch a key event while the user is entering text inside a given JTable cell (x/y location). The JTable only seems to manage String objects in it's cells so I can't place a JTextField in there with a KeyListener on it.
    Currently, I can only get control of the application once the user has left the cell they are editing.
    Does anyone have an example of a JTable 'cell KeyListener' scenario? At this point I want to see if I can print 'hello world' each time I type a character within a cell. Then I'll go from there....

    If you want to know when the contents of a cell have been updated you should use a TableModelListener.
    If you want to know when a character is added/removed from the cell editor then you need to first understand how this works with a simple text field.
    Typically you would use a DocumentListener to receive notifies of a change to the text field. However, within the DocumentEvent you wouldn't be able to change the text field as this notification comes after the text field has already been updated.
    If you need to ability to intercept changes to the text field before they happen, then you would need to use a DocumentFilter. An example of using a DocumentFilter is given in the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter]Text Component Features.
    Once you get your regular text field working the way you want, the next step to create a DefaultCellEditor using this JTextField and use this editor in your JTable. The above tutorial also has a section on using editors in a table.

  • ABAP WD: Editable Table - Identifying changed cells

    Hi,
    I have a requirement to create editable table. I have been successful in doing so. However, I have the following requirement.
    1) In case the user changes a particular column in a particular row, how will I get to know only that particular row/column  is changed?
    For ex:If the table has 20 rows, user changes the second column in 18th row without selecting that row, then how can I identify that only second column of row no 18 has been changed. Without this being accomplished, everytime user makes changes I have to delete these 20 rows and re-insert these 20 rows into the database.
    I checked that ALV provides classes for identifying changed rows but I want to use table because I need to use pop-in.

    Hi Maksim Rashchynski,
    Thanks for the reply.
    1) I wanted a way to know the changed columns/rows by a user in an editable table.
    For ex: In ALV, event ON_DATA_CHECK is triggered when data that has been changed is checked in an editable ALV output and T_MODIFIED_CELLS gives Position and values of cells after the change has been made. DO we have something like that in editable table?
    2) onLeadSelect is fired only when the lead selection happen.
    For ex: When you show editable table with say 20 rows, the first row is selected by default. Now user can change say 2nd column in 2nd row without changing the lead selection. In such a case, onLeadSelect would not be of help.
    Regards,
    Srini.

  • Start or stop edit jtable cell editing

    Hello,
    I got a problem with the jtable DefaultModel isCellEditable.
    If I set the IsCellEditable to false, I would not be able to enable the cell selection as and when I want it.
    What I have in mind is the add a mouselister so that if the user select a row using fast left mouse click like the procedure shown below
    private class MouseClickHandler extends MouseAdapter {
    public void mouseClicked(MouseEvent event) {
    int no_mouseclick = 0;
    no_mouseclick = event.getClickCount();
    if (no_mouseclick >= 2) {
    int cur_row = 0;
    cur_row = table.getSelectedRow();
    // table.setColumnSelectionAllowed(true);
    // table.setRowSelectionAllowed(true);
    for (int i=0;i<table.getColumnCount();i++){
    table.editCellAt(cur_row,i);
    System.out.println("mouse row--->" + cur_row);
    I could overwrite the IsCellEditable to true to enable that particular or cell contains in that row to be able to accept input and overwrite any data which in my case obtained from the Sql database a sort of like input module using tabulation . I am also thinking of using text component or combobox to display the value for user selection , but I do not know how to enable a particular cell for editing if the Jtable created is using a non-editable DefaultModel. If I set the IsCellEditable to true, every single cell would be enable for editing , and this defeat the purpose of enable user input only upon double mouseclicks.
    By the way , I am interested to know how to track the data changes in the cell within the jtable so that only those have been modified are notify from the Table model and updated into the Sql table
    Could anyone of you out there provide some hints please
    Thanks

    Hello,
    Tablemodellistener could detect the changes in the data, how about the backend database updating and transactional activity that must be associated with the data changes?
    What is on my mind is that , the moment there is changes in the data detected by the TableModellistener, whatever records associated with or brougt up by Jtable would be all deleted from the database and then follow by the new set of new records to be inserted into the database. The disadvantage of this method is that everytime the backend database connection and activity need to be executed the moment there is a change in the data in the jtable cell. For example the user may be just amendment to only one cell , but all the records associated need to be deleted and then inserted again.
    Perhaps there are better solution to deal with Jtable and JDBC backend connection where in this case, I am using JDO to undertake the database activity like the observable modelling .
    Could someone provide the hint please
    Thank

  • Non-editable JTable cells?

    Is there any way to make all the cells in a JTable non-editable? In the API I see the isEditable method, but no setEditable method. Any suggestions?

    You have to set it in the TableModel.
    TableModel model = new AbstractTableModel()
    public int getRowCount()
    return 10;
    public int getColumnCount()
    return 5;
    public Object getValueAt(int row, int column)
    return "( "+row+","+column+" )";
    public boolean isCellEditable(int row,int column)
    return false;
    The one given above is a sample to show you how to set a cell non-editable on the cell. You have to customize it for your table model.
    Thanks,
    Kalyan

  • [svn:osmf:] 15527: Fix bug FM-696: Capability change events being dispatched after the trait to which they refer has been modified .

    Revision: 15527
    Revision: 15527
    Author:   [email protected]
    Date:     2010-04-16 17:21:06 -0700 (Fri, 16 Apr 2010)
    Log Message:
    Fix bug FM-696: Capability change events being dispatched after the trait to which they refer has been modified.  Updated unit tests.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-696
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/media/MediaPlayer.as
        osmf/trunk/framework/OSMFTest/org/osmf/media/TestMediaPlayer.as

    Major Update: The G-Keys can now be edited without recompiling by editing shell scripts at "/usr/share/g15daemon/macros/"
    Each button has it's own script file named by it's label (e.g. to edit the functionality of G1, open the script named G1.) The button will try to execute the scripts as programs, so make sure they are executable (chmod +x) and as long as the name remains the same, if you want to replace the files with something different, know that the arguments currently given to the files ($1 and $2) are ($1)on/off and ($2)0-2  (where 0 is M1 and 2 is M3)
    To download the updated sources, go here (only the g15daemon source/patch was updated). This thread's OP has been updated.
    Last edited by rabcor (2015-02-12 04:46:48)

Maybe you are looking for