Ignoring editing in JTable

Hello,
I've got a JTable that reflects data in an xml file that is diaplaed as a JTree.
I've allowed editing of certain columns in the JTable, but want to ignore a users edits if they do not accord with the xml schema. I can ignore the changes so that the underlying model is not changed, but I cannot get the table to ignore the changes and display what was there previous to editing. Can anyone help with this.
Also, if the user double clicks in the table cell and then clicks on a different node in the tree, the table does not change to reflect the selected tree node. I've got an appropriate treeEventListener and it works fine when then user has not edited, but when they do the table does not update. Any help with thei would be great as well.
Thanks
Simon Hall

In your tablemodel isCellEditable(int row,int column) method set the cells that you don't want the user to edit to return false. Example:public boolean isCellEditable(int Row, int Column)
   if(row == 10 && column == 2)
       return false;
    return true;
}the cell at row 10 and column 2 would not allow editing on the JTable.
Hope this helps
Justin

Similar Messages

  • Edit a JTable cell, click save button, value isn't stored in JTable

    I'm editing a JTable cell, just using default editor provided by JTable
    I click a save button elsewhere in my GUI
    The value typed into the cell so far isn't stored in the TableModel yet and so doesn't get saved.
    How can I make sure the value gets stored in the JTable in the above scenario when the JButton is pressed but before saving.
    Preferably I'd like the code with the JButton not to have to know about the JTable at all.
    Cheers,
    D

    I the forums 100s of times.Many thanks. If they had a decent search on this forum I might have found it as I did try.
    Come to think of it - Sun have completely fcukd up this forum.

  • Not editable in JTable..

    I want to make not-editable cell in JTable.
    so I was searching for source code and posts in forums..
    I found perfect source code..
    but I don't know the difference between my source code and perfect code...
    could you explain me the difference two of sources
    Especially, isCellEditabel function....
    In advance thank you
    perfect code
    Test()
    JTable myTable = new JTable(data, headers)
    @Override
    public boolean isCellEditable(int row, int column)
    return false;
    add(new JScrollPane(myTable));
    my source code
    field_vc.add("Hotel Name");
    field_vc.add("City");
    field_vc.add("Maximum");
    field_vc.add("Smoking");
    field_vc.add("Price per Night");
    field_vc.add("Date");
    field_vc.add("Customer ID");
    field_vc.add("Select");
    view_jt = new JTable(data_vc , field_vc)
    @Override
    public boolean isCellEditable(int row, int column)
         return false;
    view_jsp = new JScrollPane(view_jt);
    perfect source code is not editable in JTable
    But my source code is editable in JTable
    Plz help me
    Edited by: KIMJINHO on Feb 22, 2008 8:33 AM

    But my source code is editable in JTableprove it by posting a demo program that we can copy/paste/compile/run and double click a cell to edit

  • No edit with JTable ?

    Hi All!
    How can I NOT allow user edit in JTable's cell ???
    Which method to use or the way to do that!
    Thank for you help!
    Long Ng

    In your abstract table model return false from
    public boolean isCellEditable(int row, int col) {return false;}
    rykk

  • Setting ComboBox editable/non-editable in JTable

    Hi,
    I had a problem I am having a JTable and one of the column in ComboBox.Basing on a cell value the ComboBox should be editabl.e/Non-editable.
    I used the setValueAt() method of JTable to set the comboBox and also implemented the cellChangeListener.But it did not work while loading the data intially..Plz help me....
    Regards
    Kiran

    Kiran,
    You ignore the words of a goddess at your peril: http://forum.java.sun.com/thread.jsp?forum=57&thread=556061&tstart=15&trange=15
    It sounds like some of the values in your TableModel are JComboBoxes, no? That's seems an odd thing.
    Are you confusing the data with cell editors? What is your data design?

  • Editing a JTable Feild (setValueAt)

    Hi, I have a series of tables that each pull different data from a database and then desplay the data to the user. The user has the ability to update the shown data by editing the field(s) displayed in the table. To complete the update, I want to error check their change (to make sure they didn't leave the field blank for example) and then I want to update the database before allowing the new value to be the one that's shown in the table. In other words if error checking or updating the database result in an error, an error message is displayed and the origional value is left in the "updated" field.
    What I was doing to accomplish this was adding a custom Table Model to each table with error checking code in the setValueAt method of the Table Model.
    Now, I want a standard table model that all of my tables use to reduce the number of classes I have from 1 frame, x number of table models to 1 frame, 1 table model. The problem I'm having is, by standardizing the table model, I have to remove all error checking and database updates as they are unique to each individual table. I've tryed to add TableModelListeners to my frame but I found out that the TableModelListener is executed after the setValueAt in the Table Model. This won't work for me as, while I can error check and update the newly changed data, if there is an error, I can't revert back to what was previously displayed without recalling the database.
    I guess what my questions are are: What can I do to stop setValueAt from running until after I've error checked. Also, what tells the table/table model about the end of an edit and calls setValueAt in the first place?
    Any help would be wonderful. Thanks in advance!
    --Ethan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    what I think you should do is this: extend this class (which i found on the sun site) and extend it for your needs.
    the idea is to have a model as a proxy of the real model - this model holds a different model inside it and before activiating it it can do stuff, meaning - before call the "real" setValueAt you can do error checking.
    I'm also adding the SortModel which I found to be very helpful - it allows you to sort any table with 0 code. (and it's a nice example to how to use the TableMap class.
    all the luck to you.
    btw, you will still have as many tableModels, just smaller in code.
    public class TableMap extends AbstractTableModel
    implements TableModelListener {
    protected TableModel model;
    public TableModel getModel() {
    return model;
    public void setModel(TableModel model) {
    this.model = model;
    model.addTableModelListener(this);
    // By default, implement TableModel by forwarding all messages
    // to the model.
    public Object getValueAt(int aRow, int aColumn) {
    return model.getValueAt(aRow, aColumn);
    public void setValueAt(Object aValue, int aRow, int aColumn) {
    model.setValueAt(aValue, aRow, aColumn);
    public int getRowCount() {
    return (model == null) ? 0 : model.getRowCount();
    public int getColumnCount() {
    return (model == null) ? 0 : model.getColumnCount();
    public String getColumnName(int aColumn) {
    return model.getColumnName(aColumn);
    public Class getColumnClass(int aColumn) {
    return model.getColumnClass(aColumn);
    public boolean isCellEditable(int row, int column) {
    return model.isCellEditable(row, column);
    // Implementation of the TableModelListener interface,
    // By default forward all events to all the listeners.
    public void tableChanged(TableModelEvent e) {
    fireTableChanged(e);
    * A sorter for TableModels. The sorter has a model (conforming to TableModel)
    * and itself implements TableModel. TableSorter does not store or copy
    * the data in the TableModel, instead it maintains an array of
    * integers which it keeps the same size as the number of rows in its
    * model. When the model changes it notifies the sorter that something
    * has changed eg. "rowsAdded" so that its internal array of integers
    * can be reallocated. As requests are made of the sorter (like
    * getValueAt(row, col) it redirects them to its model via the mapping
    * array. That way the TableSorter appears to hold another copy of the table
    * with the rows in a different order. The sorting algorthm used is stable
    * which means that it does not move around rows when its comparison
    * function returns 0 to denote that they are equivalent.
    * @version 1.5 12/17/97
    * @author Philip Milne
    import java.util.*;
    import javax.swing.table.TableModel;
    import javax.swing.event.TableModelEvent;
    // Imports for picking up mouse events from the JTable.
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.InputEvent;
    import javax.swing.JTable;
    import javax.swing.table.JTableHeader;
    import javax.swing.table.TableColumnModel;
    public class TableSorter extends TableMap {
    int indexes[];
    Vector sortingColumns = new Vector();
    boolean ascending = true;
    int compares;
    public TableSorter() {
    indexes = new int[0]; // for consistency
    public TableSorter(TableModel model) {
    setModel(model);
    public void setModel(TableModel model) {
    super.setModel(model);
    reallocateIndexes();
    public int compareRowsByColumn(int row1, int row2, int column) {
    Class type = model.getColumnClass(column);
    TableModel data = model;
    // Check for nulls.
    Object o1 = data.getValueAt(row1, column);
    Object o2 = data.getValueAt(row2, column);
    // If both values are null, return 0.
    if (o1 == null && o2 == null) {
    return 0;
    } else if (o1 == null) { // Define null less than everything.
    return -1;
    } else if (o2 == null) {
    return 1;
    * We copy all returned values from the getValue call in case
    * an optimised model is reusing one object to return many
    * values. The Number subclasses in the JDK are immutable and
    * so will not be used in this way but other subclasses of
    * Number might want to do this to save space and avoid
    * unnecessary heap allocation.
    if (type.getSuperclass() == java.lang.Number.class) {
    Number n1 = (Number)data.getValueAt(row1, column);
    double d1 = n1.doubleValue();
    Number n2 = (Number)data.getValueAt(row2, column);
    double d2 = n2.doubleValue();
    if (d1 < d2) {
    return -1;
    } else if (d1 > d2) {
    return 1;
    } else {
    return 0;
    } else if (type == java.util.Date.class) {
    Date d1 = (Date)data.getValueAt(row1, column);
    long n1 = d1.getTime();
    Date d2 = (Date)data.getValueAt(row2, column);
    long n2 = d2.getTime();
    if (n1 < n2) {
    return -1;
    } else if (n1 > n2) {
    return 1;
    } else {
    return 0;
    } else if (type == String.class) {
    String s1 = (String)data.getValueAt(row1, column);
    String s2 = (String)data.getValueAt(row2, column);
    int result = s1.compareTo(s2);
    if (result < 0) {
    return -1;
    } else if (result > 0) {
    return 1;
    } else {
    return 0;
    } else if (type == Boolean.class) {
    Boolean bool1 = (Boolean)data.getValueAt(row1, column);
    boolean b1 = bool1.booleanValue();
    Boolean bool2 = (Boolean)data.getValueAt(row2, column);
    boolean b2 = bool2.booleanValue();
    if (b1 == b2) {
    return 0;
    } else if (b1) { // Define false < true
    return 1;
    } else {
    return -1;
    } else {
    Object v1 = data.getValueAt(row1, column);
    String s1 = v1.toString();
    Object v2 = data.getValueAt(row2, column);
    String s2 = v2.toString();
    int result = s1.compareTo(s2);
    if (result < 0) {
    return -1;
    } else if (result > 0) {
    return 1;
    } else {
         return 0;
    public int compare(int row1, int row2) {
    compares++;
    for (int level = 0; level < sortingColumns.size(); level++) {
    Integer column = (Integer)sortingColumns.elementAt(level);
    int result = compareRowsByColumn(row1, row2, column.intValue());
    if (result != 0) {
    return ascending ? result : -result;
    return 0;
    public void reallocateIndexes() {
    int rowCount = model.getRowCount();
    // Set up a new array of indexes with the right number of elements
    // for the new data model.
    indexes = new int[rowCount];
    // Initialise with the identity mapping.
    for (int row = 0; row < rowCount; row++) {
    indexes[row] = row;
    public void tableChanged(TableModelEvent e) {
    reallocateIndexes();
    super.tableChanged(e);
    public void checkModel() {
    if (indexes.length != model.getRowCount()) {
    System.err.println("Sorter not informed of a change in model.");
    public void sort(Object sender) {
    checkModel();
    compares = 0;
    // n2sort();
    // qsort(0, indexes.length-1);
    shuttlesort((int[])indexes.clone(), indexes, 0, indexes.length);
    public void n2sort() {
    for (int i = 0; i < getRowCount(); i++) {
    for (int j = i+1; j < getRowCount(); j++) {
    if (compare(indexes, indexes[j]) == -1) {
    swap(i, j);
    // This is a home-grown implementation which we have not had time
    // to research - it may perform poorly in some circumstances. It
    // requires twice the space of an in-place algorithm and makes
    // NlogN assigments shuttling the values between the two
    // arrays. The number of compares appears to vary between N-1 and
    // NlogN depending on the initial order but the main reason for
    // using it here is that, unlike qsort, it is stable.
    public void shuttlesort(int from[], int to[], int low, int high) {
    if (high - low < 2) {
    return;
    int middle = (low + high)/2;
    shuttlesort(to, from, low, middle);
    shuttlesort(to, from, middle, high);
    int p = low;
    int q = middle;
    /* This is an optional short-cut; at each recursive call,
    check to see if the elements in this subset are already
    ordered. If so, no further comparisons are needed; the
    sub-array can just be copied. The array must be copied rather
    than assigned otherwise sister calls in the recursion might
    get out of sinc. When the number of elements is three they
    are partitioned so that the first set, [low, mid), has one
            element and and the second, [mid, high), has two. We skip the
            optimisation when the number of elements is three or less as
            the first compare in the normal merge will produce the same
            sequence of steps. This optimisation seems to be worthwhile
            for partially ordered lists but some analysis is needed to
            find out how the performance drops to Nlog(N) as the initial
            order diminishes - it may drop very quickly.  */
            if (high - low >= 4 && compare(from[middle-1], from[middle]) <= 0) {
    for (int i = low; i < high; i++) {
    to[i] = from[i];
    return;
    // A normal merge.
    for (int i = low; i < high; i++) {
    if (q >= high || (p < middle && compare(from[p], from[q]) <= 0)) {
    to[i] = from[p++];
    else {
    to[i] = from[q++];
    public void swap(int i, int j) {
    int tmp = indexes[i];
    indexes[i] = indexes[j];
    indexes[j] = tmp;
    // The mapping only affects the contents of the data rows.
    // Pass all requests to these rows through the mapping array: "indexes".
    public Object getValueAt(int aRow, int aColumn) {
    checkModel();
    return model.getValueAt(indexes[aRow], aColumn);
    public void setValueAt(Object aValue, int aRow, int aColumn) {
    checkModel();
    model.setValueAt(aValue, indexes[aRow], aColumn);
    public void sortByColumn(int column) {
    sortByColumn(column, true);
    public void sortByColumn(int column, boolean ascending) {
    this.ascending = ascending;
    sortingColumns.removeAllElements();
    sortingColumns.addElement(new Integer(column));
    sort(this);
    super.tableChanged(new TableModelEvent(this));
    // There is no-where else to put this.
    // Add a mouse listener to the Table to trigger a table sort
    // when a column heading is clicked in the JTable.
    public void addMouseListenerToHeaderInTable(JTable table) {
    final TableSorter sorter = this;
    final JTable tableView = table;
    tableView.setColumnSelectionAllowed(false);
    MouseAdapter listMouseListener = new MouseAdapter() {
    public void mouseClicked(MouseEvent e) {
    TableColumnModel columnModel = tableView.getColumnModel();
    int viewColumn = columnModel.getColumnIndexAtX(e.getX());
    int column = tableView.convertColumnIndexToModel(viewColumn);
    if (e.getClickCount() == 1 && column != -1) {
    int shiftPressed = e.getModifiers()&InputEvent.SHIFT_MASK;
    boolean ascending = (shiftPressed == 0);
    sorter.sortByColumn(column, ascending);
    JTableHeader th = tableView.getTableHeader();
    th.addMouseListener(listMouseListener);
    Glazberg.

  • Returning index of selected comp... jComboBox that is editing a jTable cell

    so, i'm using an array to populate the choices of a combobox
        public String[] progCodes = new String[]{"Standard","Restricted","Combined","Special"};which i'm using to edit a cell in a jtable
    baseCatTable.getColumnModel().getColumn(4).setCellEditor(new DefaultCellEditor(new JComboBox(progCodes)));and when i get the value
    System.out.println(baseCatTable.getValueAt(0, 4))i'd like to return the index of the selected item in the combo box instead of the text:
    Standard
    any suggestions?
    Edited by: hansbig on Jan 24, 2008 5:04 PM

    sorry, but i'm using an IDE and it generates a lot of fluffy code.
    * ProblemView.java
    package problem;
    import org.jdesktop.application.Action;
    import org.jdesktop.application.ResourceMap;
    import org.jdesktop.application.SingleFrameApplication;
    import org.jdesktop.application.FrameView;
    import org.jdesktop.application.TaskMonitor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.DefaultCellEditor;
    import javax.swing.Timer;
    import javax.swing.Icon;
    import javax.swing.JComboBox;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    * The application's main frame.
    public class ProblemView extends FrameView {
        public ProblemView(SingleFrameApplication app) {
            super(app);
            initComponents();
            edit = new JComboBox(words);
            // status bar initialization - message timeout, idle icon and busy animation, etc
            ResourceMap resourceMap = getResourceMap();
            int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
            messageTimer = new Timer(messageTimeout, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    statusMessageLabel.setText("");
            messageTimer.setRepeats(false);
            int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
            for (int i = 0; i < busyIcons.length; i++) {
                busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
            busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
                    statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
            idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
            statusAnimationLabel.setIcon(idleIcon);
            progressBar.setVisible(false);
            // connecting action tasks to status bar via TaskMonitor
            TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
            taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
                public void propertyChange(java.beans.PropertyChangeEvent evt) {
                    String propertyName = evt.getPropertyName();
                    if ("started".equals(propertyName)) {
                        if (!busyIconTimer.isRunning()) {
                            statusAnimationLabel.setIcon(busyIcons[0]);
                            busyIconIndex = 0;
                            busyIconTimer.start();
                        progressBar.setVisible(true);
                        progressBar.setIndeterminate(true);
                    } else if ("done".equals(propertyName)) {
                        busyIconTimer.stop();
                        statusAnimationLabel.setIcon(idleIcon);
                        progressBar.setVisible(false);
                        progressBar.setValue(0);
                    } else if ("message".equals(propertyName)) {
                        String text = (String)(evt.getNewValue());
                        statusMessageLabel.setText((text == null) ? "" : text);
                        messageTimer.restart();
                    } else if ("progress".equals(propertyName)) {
                        int value = (Integer)(evt.getNewValue());
                        progressBar.setVisible(true);
                        progressBar.setIndeterminate(false);
                        progressBar.setValue(value);
        @Action
        public void showAboutBox() {
            if (aboutBox == null) {
                JFrame mainFrame = ProblemApp.getApplication().getMainFrame();
                aboutBox = new ProblemAboutBox(mainFrame);
                aboutBox.setLocationRelativeTo(mainFrame);
            ProblemApp.getApplication().show(aboutBox);
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            mainPanel = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTable1 = new javax.swing.JTable();
            jButton1 = new javax.swing.JButton();
            menuBar = new javax.swing.JMenuBar();
            javax.swing.JMenu fileMenu = new javax.swing.JMenu();
            javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
            javax.swing.JMenu helpMenu = new javax.swing.JMenu();
            javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
            statusPanel = new javax.swing.JPanel();
            javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
            statusMessageLabel = new javax.swing.JLabel();
            statusAnimationLabel = new javax.swing.JLabel();
            progressBar = new javax.swing.JProgressBar();
            mainPanel.setName("mainPanel"); // NOI18N
            jScrollPane1.setName("jScrollPane1"); // NOI18N
            jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null}
                new String [] {
                    "Title 1"
            jTable1.setColumnSelectionAllowed(true);
            jTable1.setName("jTable1"); // NOI18N
            jScrollPane1.setViewportView(jTable1);
            jTable1.getColumnModel().getSelectionModel().setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
            jTable1.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(edit));
            org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(problem.ProblemApp.class).getContext().getResourceMap(ProblemView.class);
            jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
            jButton1.setName("jButton1"); // NOI18N
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
            mainPanel.setLayout(mainPanelLayout);
            mainPanelLayout.setHorizontalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mainPanelLayout.createSequentialGroup()
                    .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(mainPanelLayout.createSequentialGroup()
                            .addGap(46, 46, 46)
                            .addComponent(jButton1)))
                    .addContainerGap(12, Short.MAX_VALUE))
            mainPanelLayout.setVerticalGroup(
                mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(mainPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jButton1)
                    .addContainerGap(18, Short.MAX_VALUE))
            menuBar.setName("menuBar"); // NOI18N
            fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
            fileMenu.setName("fileMenu"); // NOI18N
            javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(problem.ProblemApp.class).getContext().getActionMap(ProblemView.class, this);
            exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
            exitMenuItem.setName("exitMenuItem"); // NOI18N
            fileMenu.add(exitMenuItem);
            menuBar.add(fileMenu);
            helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
            helpMenu.setName("helpMenu"); // NOI18N
            aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
            aboutMenuItem.setName("aboutMenuItem"); // NOI18N
            helpMenu.add(aboutMenuItem);
            menuBar.add(helpMenu);
            statusPanel.setName("statusPanel"); // NOI18N
            statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N
            statusMessageLabel.setName("statusMessageLabel"); // NOI18N
            statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
            statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N
            progressBar.setName("progressBar"); // NOI18N
            javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
            statusPanel.setLayout(statusPanelLayout);
            statusPanelLayout.setHorizontalGroup(
                statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                .addGroup(statusPanelLayout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(statusMessageLabel)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                    .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusAnimationLabel)
                    .addContainerGap())
            statusPanelLayout.setVerticalGroup(
                statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(statusPanelLayout.createSequentialGroup()
                    .addComponent(statusPanelSeparator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(statusMessageLabel)
                        .addComponent(statusAnimationLabel)
                        .addComponent(progressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3))
            setComponent(mainPanel);
            setMenuBar(menuBar);
            setStatusBar(statusPanel);
        }// </editor-fold>
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
            System.out.println(jTable1.getValueAt(0, 0));
            System.out.println(edit.getSelectedIndex());
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTable jTable1;
        private javax.swing.JPanel mainPanel;
        private javax.swing.JMenuBar menuBar;
        private javax.swing.JProgressBar progressBar;
        private javax.swing.JLabel statusAnimationLabel;
        private javax.swing.JLabel statusMessageLabel;
        private javax.swing.JPanel statusPanel;
        // End of variables declaration
        public String[] words = new String[]{"one","two"};
        public JComboBox edit;
        private final Timer messageTimer;
        private final Timer busyIconTimer;
        private final Icon idleIcon;
        private final Icon[] busyIcons = new Icon[15];
        private int busyIconIndex = 0;
        private JDialog aboutBox;
    * ProblemApp.java
    package problem;
    import org.jdesktop.application.Application;
    import org.jdesktop.application.SingleFrameApplication;
    * The main class of the application.
    public class ProblemApp extends SingleFrameApplication {
         * At startup create and show the main frame of the application.
        @Override protected void startup() {
            show(new ProblemView(this));
         * This method is to initialize the specified window by injecting resources.
         * Windows shown in our application come fully initialized from the GUI
         * builder, so this additional configuration is not needed.
        @Override protected void configureWindow(java.awt.Window root) {
         * A convenient static getter for the application instance.
         * @return the instance of ProblemApp
        public static ProblemApp getApplication() {
            return Application.getInstance(ProblemApp.class);
         * Main method launching the application.
        public static void main(String[] args) {
            launch(ProblemApp.class, args);
    }i'm getting:
    init:
    deps-jar:
    Compiling 1 source file to C:\Documents and Settings\1\My Documents\NetBeansProjects\problem\build\classes
    compile:
    run:
    Jan 24, 2008 7:58:36 PM org.jdesktop.application.Application$1 run
    SEVERE: Application class problem.ProblemApp failed to launch
    java.lang.NullPointerException
    at javax.swing.DefaultCellEditor.<init>(DefaultCellEditor.java:117)
    at problem.ProblemView.initComponents(ProblemView.java:136)
    at problem.ProblemView.<init>(ProblemView.java:29)
    at problem.ProblemApp.startup(ProblemApp.java:19)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class problem.ProblemApp failed to launch
    at org.jdesktop.application.Application$1.run(Application.java:177)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.lang.NullPointerException
    at javax.swing.DefaultCellEditor.<init>(DefaultCellEditor.java:117)
    at problem.ProblemView.initComponents(ProblemView.java:136)
    at problem.ProblemView.<init>(ProblemView.java:29)
    at problem.ProblemApp.startup(ProblemApp.java:19)
    at org.jdesktop.application.Application$1.run(Application.java:171)
    ... 8 more
    BUILD SUCCESSFUL (total time: 2 seconds)
    also, I made a zip file of the project and put it up here:
    http://www.geocities.com/hansbigtree/problem.zip
    thanks.

  • How to catch cancel of editing in JTable?

    Hi.
    I have JTable and I'd like to do something (like to show some warning) when user cancel editing in table cell by pressing Esc key. I suppose, that this can be done with CellEditorListener and it's method cancelEditing(). But when I use this, after pressing Esc, cancelEditing is not called.
    Should I use some other listener, or am I doing something wrong with CellEditorListener?
    Thanks for reply.
    The code I'm trying to use
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.event.CellEditorListener;
    import javax.swing.event.ChangeEvent;
    import javax.swing.table.TableCellEditor;
    public class TableTest extends JFrame implements CellEditorListener {
         private JTable table = null;
         public TableTest() {
              String[] headers = {"h1","h2"};
              String [][] data = {{"x","y"}, {"y", "z"}};
              table = new JTable(data, headers);
             TableCellEditor cellEditor = new DefaultCellEditor(new JTextField());
             cellEditor.addCellEditorListener(this);
             table.getColumnModel().getColumn(0).setCellEditor(cellEditor);
              this.setContentPane(table);
         public static void main(String[] args) {
              TableTest frame = new TableTest();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
         public void editingCanceled(ChangeEvent arg0) {
              System.out.println("Canceled");
         public void editingStopped(ChangeEvent arg0) {
              System.out.println("Stopped");
    }

    by default cancel of editing got catched by tab key, if u need the same with Esc key add the KeyListerner to u'r textfield u will find the solution. so i modified u'r code slightly, to get a solution.import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import javax.swing.DefaultCellEditor;
    import javax.swing.JFrame;
    import javax.swing.JTable;
    import javax.swing.JTextField;
    import javax.swing.event.CellEditorListener;
    import javax.swing.event.ChangeEvent;
    import javax.swing.table.TableCellEditor;
    public class TableTest extends JFrame implements CellEditorListener {
         private JTable table = null;
         public TableTest() {
              String[] headers = {"h1","h2"};
              String [][] data = {{"x","y"}, {"y", "z"}};
              table = new JTable(data, headers);
              JTextField txtName = new JTextField();
              txtName.addKeyListener(new KeyAdapter(){
                   public void keyPressed(KeyEvent e){
                        if(e.getKeyCode() == KeyEvent.VK_ESCAPE){
                             System.out.println("Warning or error msg");
             TableCellEditor cellEditor = new DefaultCellEditor(txtName);
             cellEditor.addCellEditorListener(this);
             table.getColumnModel().getColumn(0).setCellEditor(cellEditor);
              this.setContentPane(table);
         public static void main(String[] args) {
              TableTest frame = new TableTest();
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.pack();
              frame.setVisible(true);
         public void editingCanceled(ChangeEvent arg0) {
              System.out.println("Canceled");
         public void editingStopped(ChangeEvent arg0) {
              System.out.println("Stopped : ");
    }

  • Disable editing in JTable

    Hello,
    While building an application i found myself needed to make a doubleclick event.
    This is working however, not 100%.
    this is becouse the defoult doubleclick action (editing the table) isn't set off.
    i looked over the internet but found nothing that helped
    yes i even tried:
    import javax.swing.table.DefaultTableModel;
    class MyTableModel extends DefaultTableModel {
    // Insert the instantiator methods I use here
    public boolean isCellEditable(int row, int column) {
    return false; // Super returns true.
    }but it doesn't work.
    any and all help would be appriciated.
    thanx in advance,
    reefclaw
    p.s. for those that are interested in my doubleclick function:
    TA_Results.addMouseListener(new MouseAdapter()
         public void mouseClicked(MouseEvent e)
    //         if (e.getClickCount() == 2)
              if(clickedCount == 0)
                  Date now = new Date();
                  startTijd = now.getTime();
              if(clickedCount == 1)
                  Date now = new Date();
                  eindTijd = now.getTime();
              clickedCount ++;
              if(clickedCount == 2 )
                  clickedCount = 0;
                  if(startTijd - eindTijd < 250)
                      JTable target = (JTable) e.getSource();
                      int row = target.getSelectedRow();
                      int column = target.getSelectedColumn();
                      bekijken();
      });

    this you can run:
    MAINGUI:
    import java.awt.*;
    import java.awt.color.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.print.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.plaf.*;
    import javax.swing.table.*;
    import javax.swing.border.TitledBorder;
    import java.util.*;
    import java.text.SimpleDateFormat;
    public class MAINGUI extends JFrame {
        public static void main(String[] args)
            LookAndFeel lf = UIManager.getLookAndFeel();
            try
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            catch(InstantiationException e)
            catch(ClassNotFoundException e)
            catch(UnsupportedLookAndFeelException e)
            catch(IllegalAccessException e)
            Toolkit tk = Toolkit.getDefaultToolkit();
            Dimension screenSize = tk.getScreenSize();
            int screenHeight = screenSize.height;
            int screenWidth = screenSize.width;
            MAINGUI mainframe = new MAINGUI();
            mainframe.setSize(800, 600);
            mainframe.setLocation( (screenWidth - 480) / 2, (screenHeight - 700) / 2);
            mainframe.setTitle("Huurcontracten - main");
            mainframe.setVisible(true);
        public MAINGUI() {
            try {
                jbInit();
            } catch (Exception ex) {
                ex.printStackTrace();
        private void jbInit() throws Exception {
            this.getContentPane().setLayout(null);
            this.setBounds(0, 0, 800, 600);
            TA_Results.setEnabled(false);
            TA_Results.setAutoscrolls(false);
            TA_Results.setBorder(BorderFactory.createLoweredBevelBorder());
            TA_Results.setBounds(new Rectangle(20, 44, 760, 472));
            TA_Results.getModel().addTableModelListener(TA_Results);
            TA_Results.removeEditor();
            this.getContentPane().add(TA_Results);
            kolommen[0] = "ContractNummer";
            kolommen[1] = "FilliaalNummer";
            kolommen[2] = "LandNaam";
            kolommen[3] = "Plaats";
            kolommen[4] = "StraatNaam";
            kolommen[5] = "IngangsDatum";
            kolommen[6] = "EindDatum";
            kolommen[7] = "OpzegDatum";
            comboBox[7] = "Alles";
            comboBox[1] = "LandNaam";
            comboBox[2] = "ContractNummer";
            comboBox[3] = "IngangsDatum";
            comboBox[4] = "EindDatum";
            comboBox[5] = "Plaats";
            comboBox[6] = "FilliaalNummer";
            comboBox[0] = "Maanden voor afloop";
            S_C_Order[1] = "LandNaam";
            S_C_Order[0] = "ContractNummer";
            S_C_Order[2] = "IngangsDatum";
            S_C_Order[3] = "EindDatum";
            S_C_Order[4] = "Plaats";
            S_C_Order[5] = "FilliaalNummer";
            S_C_Order[6] = "Apple";
            S_C_Order[7] = "Tomaat";
            zoeken();
    TA_Results.addMouseListener(new MouseAdapter()
         public void mouseClicked(MouseEvent e)
              if(clickedCount == 0)
                  Date now = new Date();
                  startTijd = now.getTime();
              if(clickedCount == 1)
                  Date now = new Date();
                  eindTijd = now.getTime();
              clickedCount ++;
              if(clickedCount == 2 )
                  clickedCount = 0;
                  if(startTijd - eindTijd < 400)
                      JTable target = (JTable) e.getSource();
                      int row = target.getSelectedRow();
                      int column = target.getSelectedColumn();
                      System.out.println("Dubbleclicked");
        JTable TA_Results = new JTable(new MyTableModel());
        String[] kolommen = new String[8];
        String[] comboBox = new String[8];
        String[] S_C_Order = new String[8];
        int clickedCount = 0;
        long startTijd;
        long eindTijd;
        private void zoeken()
            String[] results = new String[kolommen.length];
            Object[] kolomshit = kolommen;
            Object[] comboBox2 = comboBox;
            Object[] row3 = S_C_Order;
                Object[][] rowData = new Object[3][kolommen.length];
                rowData[0] = kolomshit;
                rowData[1] = comboBox2;
                rowData[2] = row3;
                remakeTable(rowData, kolommen);
        private void remakeTable(Object[][] rowData, Object[] columnNames)
            this.getContentPane().remove(TA_Results);
            TA_Results = new JTable(rowData, columnNames);
            TA_Results.setBorder(BorderFactory.createLoweredBevelBorder());
            TA_Results.setBounds(new Rectangle(20, 44, 760, 472));
            this.getContentPane().add(TA_Results);
            TA_Results.revalidate();
    }MyTableModel:
    import javax.swing.table.DefaultTableModel;
    class MyTableModel extends DefaultTableModel {
    // Insert the instantiator methods I use here
    public boolean isCellEditable(int row, int column) {
    return false; // Super returns true.
    }

  • How to edit the JTable columns

    Hi all,
    please help me on this..
    I created one Jtable with 0-9 columns(10 columns)and
    I put only the 9th(last column) column is editable.
    the problem is if I enter any text message in 9th column
    and press another column then immediatly dissapears the
    9th column text...
    please tell me how to solve this problem .. because I want to take the
    9th column text to another Object....
    please send the solution anyone knows..
    public boolean isCellEditable(int row, int col){
    if(col == 9){
    return true;
    }else{
    return false;
    }

    If things go wrong while trying to edit table cells there is a good chance that you hit one of the many well known or even a new bug. These bugs are highly version dependent. So in any question please include the jdk version you are using and a very exact description of what you are seeing.
    Here I assume that by "press another column" you mean "click the mouse in the header region"?
    If so that's one of the well known, long-standing and not yet solved problems: jTable does cancel any edit on any notification from the columnModel - and due to suboptimal implementation of the tableHeaderUI even a single click does fire such a notification.
    There is some debate about how to handle the situation but no easy or totally satisfying approach - your best bet is to search the bug parade (and google) for partial solutions and their pros and cons.
    Greetings
    Jeanette

  • Allowing user to modify/edit a JTable

    i'm new to java and i'm creating a JTable that allows a user to modify the data and the data will be stored in the database that i have created here is my code:
    import javax.swing.JTable;
    import javax.swing.JScrollPane;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.*;
    import java.awt.event.*;
    import java.sql.*;
    import java.util.*;
    import javax.swing.event.*;
    import javax.swing.table.TableModel;
    public class SelectContacts extends JFrame implements TableModelListener {
    private boolean DEBUG = true;
    DataBase db = new DataBase();
    Connection connection = db.getConnection();
    public SelectContacts() {
    super("SelectContacts");
    DataBase db = new DataBase();
    Connection connection = db.getConnection();
    ArrayList contactsList =new ArrayList();
    String[] columnNames = {"Name",
    "Address",
    "Gender",
    "Email",
    "Contact",
    "Age"};
    String query;
    Statement statement;
    ResultSet rs;
    String personName="";
    String address="";
    String gender="";
    String email="";
    String contact="";
    String age="";
    Contacts s1;
    int i=0;
    query = "SELECT * FROM Contacts";
    try{
    statement = connection.createStatement();
    rs = statement.executeQuery(query);
    while (rs.next()){
         personName = rs.getString("Name");
    address = rs.getString("Address");
    gender = rs.getString("Gender");
    email = rs.getString("Email");
    contact = rs.getString("Contact");
    age = rs.getString("Age");
    s1= new Contacts(personName,address,gender,email,contact,age);
    contactsList.add(s1);
    i++;      
    statement.close();
    catch ( SQLException sqlex ) {
    sqlex.printStackTrace();
    Object[][] data = new Object[6];
    int count=0;
    while (count<i){
         s1 = (Contacts) contactsList.get(count);
         System.out.println("Name:" + s1.getName());
         System.out.println("Address:" + s1.getAddress());
         System.out.println("Gender:" + s1.getGender());
         System.out.println("Email:" + s1.getEmail());
         System.out.println("Contact No.:" + s1.getContact());
         System.out.println("Age:" + s1.getAge());
         data[count][0] = s1.getName();
         data[count][1] = s1.getAddress();
         data[count][2] = s1.getGender();
         data[count][3] = s1.getEmail();
                   data[count][4] = s1.getContact();
                   data[count][5] = s1.getAge();
    count++;
    final JTable table = new JTable(data, columnNames);
    table.setPreferredScrollableViewportSize(new Dimension(500, 70));
    table.getModel().addTableModelListener(this);
    //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);
    highlighed
    public void tableChanged(TableModelEvent e) {
    int row = e.getFirstRow();
    int column = e.getColumn();
    TableModel model = (TableModel)e.getSource();
    String columnName = model.getColumnName(column);
    Object data = model.getValueAt(row, column);
    Statement statement;
    ResultSet rs;
         String insertString= "Insert into Contacts (Name, Address, Gender, Email, Contact, Age ) "+
              " VALUES ( '"+ data +"')";
              // Do something with the data...
    try{
    statement = connection.createStatement();
    statement.executeUpdate(insertString);
    statement.close();
    catch ( SQLException sqlex ) {
    sqlex.printStackTrace();
         System.out.println("You sucessfully modified! :)");          
    highlighted
    public static void main(String[] args) {
    SelectContacts frame = new SelectContacts();
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    //Whenever window gets the focus, let the
    //TextFieldDemo set the initial focus.
    public void windowActivated(WindowEvent e) {
    // demo.setFocus();
    frame.pack();
    frame.setVisible(true);
    i recieved error when i tried to edit 1 of the data "java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Number of query values and destination fields are not the same. i think the problem lies in the highlighted part. pls guide me thanks

    i think the problem lies in the highlighted part. pls guide me thanks What highlighted part? When you post code use the [code ]...[code ] tags. Read the "Formatting Help" link when you post a question for more information.
    I find it easier to use a PreparedStatement as it delimits a the parameters in your SQL statement for you. Here's a simple example, read the API for more information:
            private static void addData(Connection connection)
                throws Exception
                String sql =
                    "INSERT INTO Page " +
                         "(Name," +
                         "Title) " +
                     "VALUES " +
                PreparedStatement stmt = connection.prepareStatement(sql);
                stmt.setString( 1, "Name1" );
                stmt.setString( 2, "Title1" );
                stmt.executeUpdate();
                stmt.setString( 1, "Name2" );
                stmt.setString( 2, "Title2" );
                stmt.executeUpdate();
                stmt.close();

  • Want to edit a JTable cell programatically

    I am making use of JTable in my application. I want to start editing a cell at 5th column, prompt user to enter value, as soon as he checks the JCheckbox in the first Column. I have tried in various ways but failed to solve it. Can any one provide a solution for this.

    Try something like this.
    Note this is untested.
    You mak not need the invokeLater.
    JCheckBox xb = new JCheckBox("Check Box");
    xb.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent ae) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run(){
            table.changeSelection(lastJTable.getSelectedRow(), 5, true, true);
            table.editCellAt(lastJTable.getSelectedRow(), 5);
            Component tec = table.getEditorComponent();
            if (tec!=null){tec.requestFocus();}
            // force filed to be selected
            try {((JTextComponent)tec).selectAll();}
            catch (Exception notTextEx) {}
    });rykk

  • Edit a JTable cell by clicking at it once - is it possible?

    If I want to edit a cell in a JTable, I have to doubleclick on it. Is it possible to set the JTable cells to be in edit mode by just clicking at the cells once?

    Did you search the forums?? How about something like "jtable-edit-single-click".

  • Tab key selects cell for edit in JTable

    Hello,
    I've seen extensive posts on this forum for this problem, but no solution yet.
    I have a Jtable, with custom cellRenders and cellEditors. Some columns are editable, some are not.
    What I want to do, is when someone tabs to an editable cell, that cell immediately goes into edit mode. This means, it acts as if someone double clicked on it, or tabbed then clicked on it. Basically, I want it to ACTUALLY go into edit mode.
    Please do not respond by telling me how to make it look editable (highlighting, etc) and do not respond with mouseEvent solutions. Please do not respond by telling me to do table.editCellAt(row,col) because that does not kick in my custom editor, it uses the defaultCellEditor.
    So basic question:
    How to kick in editing when someone tabs to an editable cell?
    If you need code examples, please request and I will post.

    nmstaat,
    In JTable:
    Look into the processKeyBinding method. It takes a keyevent and matchs it with an InputMap, and the InputMap invokes an Action in the corresponding ActionMap.
    You will have to call yourJTable.getActionMap(), then alter the action that corresponds to the 'tab' key.
    For Further information, check the JTable API, its all there.
    Good Luck,
    Alex
    Here's the current map for the Metal look and feel:
    JTable (Java L&F)
    Navigate out forward | Tab
    Navigate out forward | Ctrl+Tab
    Navigate out backward | Shift+Tab
    Navigate out backward | Ctrl+Shift+Tab
    Move to next cell | Tab
    Move to next cell | Right Arrow
    Move to previous cell | Shift+Tab
    Move to previous cell | Left Arrow
    Wrap to next row | Tab
    Wrap to next row | Right Arrow
    Wrap to previous row | Shift+Tab or Left
    Wrap to previous row | Shift+Tab or Left
    Block move vertical | PgUp, PgDn
    Block move left | Ctrl+PgUp
    Block move right | Ctrl+PgDn
    Block extend vertical | Shift+PgUp/PgDn
    Block extend left | Ctrl+Shift+PgUp
    Block extend right | Ctrl+Shift+PgDn
    Move to first cell in row | Home
    Move to last cell in row | End
    Move to first cell in table | Ctrl+Home
    Move to last cell in table | Ctrl+End
    Select all cells | Ctrl+A
    Deselect current selection | Up/Down Arrow
    Deselect current selection | Ctrl+Up/Down Arrow
    Deselect current selection | Pgup/Pgdn
    Deselect current selection | Ctrl+Pgup/Pgdn
    Deselect current selection | Home/End
    Deselect current selection | Ctrl+Home/End
    Extend selection one row | Shift+Up/Down
    Extend selection one column | Shift+Left/Right
    Extend selection to beginning/end of row | Shift+Home/End
    Extend selection to beginning/end of column | Ctrl+Shift+Home/End
    Edit cell without overriding current contents | F2
    Reset cell content prior to editing | Esc

  • F2 Edit in JTable -- standard for all look and feel ?

    hi,
    I use a robot to simulate a F2 when a column is in focus in a JTABLE so that user can just type without having to type the <F2> key.
    My question is:
    Is F2 (to get a column in edit mode) for JTABLE standard for all look and feel (metal, X-windows ..) ?
    Thanks.
    Tony

    Read the JTable API. There is a link the gives the
    standard key assignments for the standard LAF's.thanks. got it.

Maybe you are looking for

  • Generating a PDF from a OTF (imported from CLOSE_FORM) and send it by mail.

    Hello! I have a problem. I'll try to explain it toy you. I have a SapScript that the user has the option to send it to the printer or have a Print Preview. I need to send it by mail in PDF format. If the user select PRINT, a spool id is created, I ca

  • Oracel BPm Question: Unable to start BPM Process Web Service

    Hello, I was trying to create a new webservice interface for a BPM proces. However When I try to access the WSDL I ran into this issue: The WSDL is supposed to be located at: http://localhost:7001/albpmServices/albpmengine/ws/NewUserServiceListener?w

  • CO Extractors

    I am working on a custom report that works with CO and SD Data.  I am currently trying to get revenue data, the spec that was created by R/3 states that this information is pulled from COSP as well as getting COS (Cost of Sale) from COSB. Does anyone

  • Eyedropper tool - Makes color RGB from CMYK image.

    I made an image CMYK in photostop, and then placed it in an indesign file. When I used the eyedropper tool to grab a color from that graphic, the eyedropper tool made that color RGB. Our printer only accepts CMYK. So, I am a bit confused. How can I f

  • UnixODBC connects, but won't select - 64bit Linux and client 10.2.0.1.0

    ODBC connects, but won't select - 64bit Linux and 64 bit Oracle instant client 10.2.0.1.0, full install (all files but basiclite). ODBC can connect to an Oracle database, but cannot describe or select. sqlplus can connect and select. Also, ODBC can c