Clear cell when edit

How can i clear all the data in a cell of a JTable when i select this cell? By default, when i edit a cell and type the new data is add to the previus data, but i want have only the new data.

You should be able to extend DefaultCellEditor (or similar) to clear the text in the text field when editing starts.
Either look at the source for the default table cell editor or the Swing tutorial for more information on table cell editors.
Hope this helps.

Similar Messages

  • Select text cell when edit

    How can i select the data in a cell of a JTable when i edit this cell?

    Hi
    I u can highlight it when you select the row and try to edit it. You just have to add an editor to it. And try like setting the background when you add a editor. I think you can do it.

  • How do I get Integer in JTable cell to be selected when edit using keyboard

    I have some cells in a JTable, when I double-click on the cell to edit it the current value (if any) is selected and is replaced by any value I enter, which is the behaviour I want. But when I use the keyboard to navigate to the cell and start editing, new values are added to the end of the current value which is not what I want.
    I have created my own IntegerCellEditor (see below) and added a focus event or the textfield used when editing to select all the current text but it has no effect, any ideas please ?
    public class IntegerCellEditor extends DefaultCellEditor
        public IntegerCellEditor( JTextField textfield )
            super( textfield );    
            //Ensure old value is always selected, when start editing
            ((JTextField)getComponent()).addFocusListener(new FocusAdapter()
                    public void focusGained(FocusEvent fe){
                        ((JTextField)getComponent()).selectAll();
            ((JTextField)getComponent()).setHorizontalAlignment(JTextField.RIGHT);
         * Return as Integer (because delegate converts values to Strings).
        public Object getCellEditorValue()
            return Integer.valueOf((String)delegate.getCellEditorValue());
    }

    But when I use the keyboard to navigate to the cell and start editing,
    new values are added to the end of the current value which is not what I want.How does the use know that typing will replace the text and not append? Usually if text is to be deleted, it is highlighted to give the user a visual cue.
    Here is a renderer that does this, in case your interested:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=752727

  • HD video not clear when editing

    Hello all.
    I have completed a few projects shooting with my HD camera, and all have been imported nice and clear. Now, I am editing and the video is not clear. It is smaller and not filling the entire screen. I must have switched a setting somewhere, but I have no idea what I had it set at.
    When editing, the video has a widescreen look to it, and the lines are jagged and blurred. HELP!

    Item properties say 29.97 fps, 1440 by 1080 frame size, 3.2 MB/sec, and I am in Final Cut Pro version 7.
    I tried RE capturing the SAME clip into an old project, where it came in clear. Then I recaptured into this problem project and it was pixelated. I captured the same way both times. Do I have to recapture the entire thing? I know I am probably not giving as clear responses as you need to help me, but I am new to dealing with HD editing.
    It is just this project that is not converting the video to the right size. Usually it will prompt asking if I'd like to match the settings, but this time it didn't and I'm not sure how to do so manually.

  • JTable - active cell not highlited when editable

    Hello,
    I'm using JDK 1.4.2_05, and I'm seeing some behavior that seems a bit strange.
    In my JTables, some cells are editable, and others are not. When the user moves the active cell around (with the arrow keys, or TAB and RETURN) the non-editable cells show up with a nice blue color. If a cell is editable, it doesn't change at all, so the user has no idea where the "cursor" (meaning the active cell) is.
    These cells don't have any special renderer or anything. My JTable has these set:
    setRowSelectionAllowed(false);
    setColumnSelectionAllowed(false);
    setCellSelectionEnabled(true);Thanks for any advice!
    --- Eric

    Okay, yeah, I overrode the default renderer, and had it check whether the cell was selected or not, setting the background color appropriately. Duh. --- Eric

  • Since upgrading to Snow Leopard Problems when editing picture in Photoshop CS4 - not switching to dedicated space

    Hi,
    I'd appreciate your help on this, maybe I just chose a stupid set-up to begin with.
    I use spaces and have allocated Space 1 to Lightroom and Space 2 to Photoshop to always have a clear backdrop when switching to Photoshop.
    Since upgrading to Snow Leopard, when I choose 'Edit photo in Photoshop', Photoshop (the frame) opens fine in it's correct space, but the picture does not show. When I click on Window and on the respective picture window the picture shows but all reverts to Space 1 and I have the Lightroom window in the background so that I need to extend the Photoshop window to create a less distracting background.
    Any idea why this happens or any suggestions for a better set up?
    Thanks heaps
    Claudia

    Claudia
    I am running PS CS4 as an external editor for my Lightroom 2.5 installation on a MacBook Pro running Snow Leopard 10.6.1 and I have exactly the same 'Spaces' setup as you (i.e. LR and PS each are in their own space) but I am not experiencing the behaviour you are experiencing.
    If it's of any help, you might try fiddling with the window behaviour in PS to see if it changes anything? In the "Window" menu I have selected the "Application Bar" rather than the "Application Frame".
    Raf

  • Image Bands/Corruption in Photoshop CS5 When Editing from Aperture

    I'm having some problems when editing Aperture images in Photoshop. When I choose an image I want to edit, it opens in PS CS5 with bands of corruption in the image. Now, I hate to use the term corruption, because when I zoom the image to 100%, the bands disappear, so the image isn't truly corrupted. You can see what's going on with the images here: http://gallery.me.com/drewje#100004
    I'm using Aperture 3.1.1 with RAW image formats and using an Aperture-managed library, not referenced. I've tried opening in Photoshop with both TIFF and PSD 16-bit formats with identical results. I'm using the high performance energy saver setting, to enable my NVIDIA GeForce 9600m video card in my first gen unibody MacBook Pro. I'm using version 12.0.2 of Photoshop CS5.
    I'm getting no help on the Adobe boards, so was hoping someone over here had some ideas or thoughts on how to fix this. Anyone?

    I'm just getting back to check on this thread now, but this does appear to fix the problem. I hate to call this "solved" because it's clearly a bug that exists, but it's nice that there's a workaround. I was just about to look at moving to Lightroom. I should be able to live with this.

  • MVM_*.tmp files locking portable drive(s) when editing gifs

    I have a bunch of random files named *MVM_*.tmp randomly split between my second internal drive and a portable drive (or more if another external drive is connected) when editing or opening a .GIF file in PS CS5.
    These files make it impossible to remove the portable drive without first saving my work and closing PS (once I had to reboot in order to remove the drive). Also, often as not, some of the files remain on the portable drive.
    No 3rd party plugins, just vanilla PS. I saw another thread but that was about PNG files (this happens too), not GIFs.
    Also happens when Liquify tool is used. Really bugging me.

    I get those MVM_tmp's at the root of all non-system drives whenever I save a PNG (they usually clear when I quit PS, but not always).
    But anyway, even without them I still can't release external drives with Photoshop open, I always have to close it first, as long as PS has had its fingers on any of the files on the drive. However, this is nothing special with Photoshop, Outlook does it too just to name one.

  • InDesign becomes unresponsive when editing text off the network. Techs are flummoxed!

    Recently my InDesign (CS6 running on Windows 7 Pro 64 bit, 8gb ram) has become almost totally unresponsive when I go to open and edit a file off the company network. Our techs have no idea what is going on and are considering having to re-build my profile as a last resort as we have tried everything else.
    A bit more of a descriptoin of the problem: When I go to edit an InDesign file off the server it first takes longer than normal to load but eventually does. You can scroll up and down the pages, move and resize boxes, place new pictures but as soon as you try to do anything text based (edit new text or make a new text box) the whole program freezes to the point you have to task manager out and kill it. It is not a corupt file because if I copy the file directory with all links over on to my computers local hard disk the file works totally fine it is only when editing over the network and when edouble clicking to edit text.
    What we have done to try and fix the problem:
    Reinstal InDesign - No effect
    Cleared the preferences (shift + ctrl + alt + windows key on InDesign startup) - No effect
    Our techs have tried editing my profile registry to no avail and we are all compleatly at a loss to what is going on. There are several other instances of the program across the company (mainly versions 5.5 and one other 6) and they all work fine editing files straight off the network.
    Anyone have any idea what it could be, such a specific problem being only when it is editing text based areas? The techs dont want to have to re-build my profile as it is a lot of back end work to do to be able to re-instate it straight away.
    Many thanks in advance for any insights into the issue

    So we have finally fixed the issue and are currently cracking out the bubbly!
    It turned out to be the network path shotcut I was using to access the shared drive where I was editing the files from. I work for a restaurant so we have a shared drive where each site can access their files, this is where the food menu files reside and I had created a shortcut that, although accessed the correct area did it using a path which had a double backslash in it.
    The true path for the shared drive is  \\hm\mydocs\restaurant\menufile.indd and this is the shortcut I was using to open the file up from. For all other files like Word, Excel, even other Adobe programs like PSE10, and Lightroom it seems to work fine. For some reason InDesign does not like this path with the double backslash in. As soon as I changed the shortcut path to just m:\ (the letter of the shared drive on the network) everything was working again and we can all sleep, it was driving us mental. Re-installed windows, InDesign created a new network user profile the works.
    I hope this may help someone else in a similar situation in the future

  • Protect the cell from editing (MS Project)

    is it possible to protect the cell from editing (Gantt Chart view)? 
    I try to do it through the event Application_ProjectBeforeTaskChange and setting Cancel to true 
    which method is called when the edit cell and press the ESC?

    Hi,
    Thanks for posting in MSDN forum.
    This forum is for developers discussing issues about
    apps for Office. Since the issue is more relative to Project developing, I would like to move it to
    Project Customization and Programming forum to get more effective response.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Focus stays on cell when I select column in JTable

    Hi,
    I am using a JTable and I have defined a function key cntrl-D to perform a function on a selected column. This works fine if I have not yet edited one of the cells in the column, but if I edit any cell and then click the column header and hit cntrl-D, then the column is deselected, the top cell enters edit mode, and my function is called with only one cell selected (always the top cell) instead of the whole column.
    When I debug this, I find that my function is called first, and processKeyEvent in the cell editor is called later. The editor doesn't handle it and calls super().
    I think that somehow the cell is keeping the focus even though I try to deselect it when the column is selected in my column header listener. Any suggestions welcome.
    Here is the code I use to select the column in the column header listener. I have verified that it is called when I click the header:
    public void mouseClicked(MouseEvent e)
    table.requestFocusInWindow();
    Point thePoint = e.getPoint();
    int theColumnIndex = table.columnAtPoint(thePoint);
    int theLastRowIndex = table.getRowCount() - 1;
    if (theLastRowIndex > 0 && theColumnIndex > 0 && theColumnIndex < table.getColumnCount() )
    if ( e.isShiftDown() && table.getSelectedRowCount() == table.getRowCount() )
    table.editingStopped(null);
    if ( table.isEditing() )
    return;
    if ( theColumnIndex <= mColumnStart )
    table.setColumnSelectionInterval( theColumnIndex, mColumnStart);
    else if ( theColumnIndex >= mColumnStart )
    table.setColumnSelectionInterval( mColumnStart, theColumnIndex );
    else if ( e.isControlDown() && table.getSelectedRowCount() == table.getRowCount() )
    table.editingStopped(null);
    if ( table.isEditing() )
    return;
    if (table.isColumnSelected(theColumnIndex))
    table.removeColumnSelectionInterval(theColumnIndex, theColumnIndex);
    else
    table.addColumnSelectionInterval(theColumnIndex, theColumnIndex);
    else
    table.editingStopped(null);
    if ( table.isEditing() )
    return;
    table.clearSelection();
    table.setEditingRow(-1);
    table.setEditingColumn(-1);
    table.setRowSelectionInterval(0, theLastRowIndex);
    table.setColumnSelectionInterval(theColumnIndex, theColumnIndex);
    mColumnStart = theColumnIndex;
    SampleManager.getInstance().setupMenus();

    I found the answer. This is a feature that worked in 1.3.1 but broke in 1.4.1. It turns out that there is a new feature in JTable that jumps into edit mode when a key event is detected, and that causes the column selection to be canceled. To inactivate this feature I put the following line into the constructor of my JTable subclass:
    putClientProperty("JTable.autoStartsEdit", Boolean.FALSE);

  • Urgent: "Clear Cell Text" utility under Admin menu cleared data

    I selected Forecast scenario, version, year, months, idesc(accounts) in "Clear Cell Details" utility under Admin menu. I selected members of all dimensions. However, instead of deleting that intersection of data, it deleted Forecast and Actuals data.
    Does "clear cell details" work? Are there any known bugs with it?
    Has anyone else experienced this problem?
    Edited by: Essbase Fan on Jun 10, 2010 8:04 PM
    Edited by: Essbase Fan on Jun 10, 2010 9:15 PM

    Hello John,
    Have you used that "Clear Cell Details" utility successfully? It wiped out other scenarios even though I specified only one.
    At the end of the run, I think it asked me if I wanted to know what to do with data it cleared - and I said to fill it with #missing.

  • 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" );

  • How can iPhone videos sent to another iPhone be made clear like they were recorded even though it sent as a text. with iMessage it's clear but when it's not available the quality *****, how can I make a received vid clear again??? help

    how can iPhone videos sent to another iPhone be made clear like they were recorded even though it sent as a text. with iMessage it's clear but when it's not available the quality *****, how can I make a received vid clear again??? help

    This is determined by your carrier. SMS/MMS is a poor man's email and by that I mean SMS/MMS has major restrictions and limitations compared to email but is a cash cow for cell phone carriers.
    Upload the video to YouTube when connected via wifi and send the YouTube link via text.

  • JTable cannot make cell non-editable

    I have create a JTable using the DefaultTablemodel. I want to make the cells non editable. I have overwritten the method isCellEditable with that shown below but when I double click any cell it still let me edit the cell. Someone please show me what is wrong.
    public boolean isCellEditable(int cellrow, int cellcol)
    return(false);
    // if (cellcol == 0)
    // return(false);
    // else
    // return(true);
    Regards
    pslloo

    Look at the tutorial! This sample works.
    Hope this help.
    import javax.swing.JTable;
    import javax.swing.table.AbstractTableModel;
    import javax.swing.JScrollPane;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.JOptionPane;
    import java.awt.*;
    import java.awt.event.*;
    public class TableDemo extends JFrame {
        private boolean DEBUG = true;
        public TableDemo() {
            super("TableDemo");
            MyTableModel myModel = new MyTableModel();
            JTable table = new JTable(myModel);
            table.setPreferredScrollableViewportSize(new Dimension(500, 70));
            //Create the scroll pane and add the table to it.
            JScrollPane scrollPane = new JScrollPane(table);
            //Add the scroll pane to this window.
            getContentPane().add(scrollPane, BorderLayout.CENTER);
            addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
        class MyTableModel extends AbstractTableModel {
            final String[] columnNames = {"First Name",
                                          "Last Name",
                                          "Sport",
                                          "# of Years",
                                          "Vegetarian",
                                          "essai"};
            final Object[][] data = {
                {"Mary", "Campione",
                 "Snowboarding", new Integer(5), new Boolean(false), new Integer(3)},
                {"Alison", "Huml",
                 "Rowing", new Integer(3), new Boolean(true), new Integer(3)},
                {"Kathy", "Walrath",
                 "Chasing toddlers", new Integer(2), new Boolean(false), new Integer(3)},
                {"Sharon", "Zakhour",
                 "Speed reading", new Integer(20), new Boolean(true), new Integer(3)},
                {"Angela", "Lih",
                 "Teaching high school", new Integer(4), new Boolean(false), new Integer(3)}
            public int getColumnCount() {
                return columnNames.length;
            public int getRowCount() {
                return data.length;
            public String getColumnName(int col) {
                return columnNames[col];
            public Object getValueAt(int row, int col) {
                return data[row][col];
             * JTable uses this method to determine the default renderer/
             * editor for each cell.  If we didn't implement this method,
             * then the last column would contain text ("true"/"false"),
             * rather than a check box.
            public Class getColumnClass(int c) {
                return getValueAt(0, c).getClass();
             * Don't need to implement this method unless your table's
             * editable.
            public boolean isCellEditable(int row, int col) {
                //Note that the data/cell address is constant,
                //no matter where the cell appears onscreen.
                if (col < 2) {
                    return false;
                } else {
                    return true;
             * Don't need to implement this method unless your table's
             * data can change.
            public void setValueAt(Object value, int row, int col) {
                if (DEBUG) {
                    System.out.println("Setting value at " + row + "," + col
                                       + " to " + value
                                       + " (an instance of "
                                       + value.getClass() + ")");
                if (data[0][col] instanceof Integer                       
                        && !(value instanceof Integer)) {                 
                    //With JFC/Swing 1.1 and JDK 1.2, we need to create   
                    //an Integer from the value; otherwise, the column    
                    //switches to contain Strings.  Starting with v 1.3,  
                    //the table automatically converts value to an Integer,
                    //so you only need the code in the 'else' part of this
                    //'if' block.                                         
                    //XXX: See TableEditDemo.java for a better solution!!!
                    try {
                        data[row][col] = new Integer(value.toString());
                        fireTableCellUpdated(row, col);
                    } catch (NumberFormatException e) {
                        JOptionPane.showMessageDialog(TableDemo.this,
                            "The \"" + getColumnName(col)
                            + "\" column accepts only integer values.");
                } else {
                    data[row][col] = value;
                    fireTableCellUpdated(row, col);
                if (DEBUG) {
                    System.out.println("New value of data:");
                    printDebugData();
            private void printDebugData() {
                int numRows = getRowCount();
                int numCols = getColumnCount();
                for (int i=0; i < numRows; i++) {
                    System.out.print("    row " + i + ":");
                    for (int j=0; j < numCols; j++) {
                        System.out.print("  " + data[i][j]);
                    System.out.println();
                System.out.println("--------------------------");
        public static void main(String[] args) {
            TableDemo frame = new TableDemo();
            frame.pack();
            frame.setVisible(true);
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Maybe you are looking for

  • READ_LINKS_OF_BINRELS instead of SREL_GET_NEXT_RELATIONS

    I am updating a report from 4.7 to 5.0, and I learned that function module SREL_GET_NEXT_RELATIONS will not work for me in 5.0. I am trying to use cl_binary_relation=>read_links_of_binrels instead, and then call FM SO_OBJECT_READ. In code for 4.7 I u

  • Inspiration Browser update error

    I have been trying to download the Inspriation Browser, followed directionns, took out old one restated computer, even update the air program--still gettig erro message when I try nto download??

  • EF6 Code first inheritance from relationship

    I need to create a TPH inheritance on an existing database using EF6 and Code first Table Person PersonId (Key) PersonName PersonTypeId (FK) Table PersonType: PersonTypeId (Key) Description Category The field PersonTypeId is the discriminator for the

  • OJ 6500 709a installation on Windows 7

    Laptop = ASUS Zenbook UX31E The laptop was running Windows 8.1, and the HP printer software was OK. Because the laptop was filled with malware I restored the original Windows 7. I intend to stay with Windows 7. The printer used to be Ethernet cabled

  • There is still no update for 5530 pc 0589027

    Why there is still no update for my Nokia 5530 with product number 0589027. The v10 firmware makes me sick and after 3 and half month there is still no update? are you working on it or do i have to throw my phone trough closed window...