JTable - sequencially  jumping to non-adjacent cells

Hello Master minds: Is it possible, in a jTable, that after you edit the data in one cell, to send focus/cursor to another cell that maybe not in the same row or column as the edited cell ?? Example: I just finished editting the data in cell 1,1. Upon pressing "ENTER" in that cell, I want it to go directly to cell 1,6, so that I can either accept the data in that cell or continue on down to the next row to cell 2,1. And say the table is 5 rows by 8 colums in size.
Thanks for any help on this.

Hi Gary,
You could add a KeyboardListener either to the JTable itself or its rendering components and capture the key event you want. Knowing which row and column is currently selected will allow a choice to be made whether to go to the next cell in the same row or the first column in the next row.
Bear in mind though that users are generally used to navigating through cells or elements using the Tab key, not Enter!
Chris.

Similar Messages

  • How do I select multiple, non-adjacent, cells in Numbers?

    I have a spreadsheet that I need to select multiple non-adjacent cells for the purposes of highlighting them and I can't figure out how to do it. The Excel equivilant would be highlight a cell and then click he desired cell while pressing cmd. This does not work nor do fn, ctrl or option. Is this possible and if so how can I do it?

    K
    It's apparently one of those many things that haven't been implemented in the iCloud beta. You'll be able to make that type of multiple selection if you spring for the OSX version of Numbers.
    Jerry

  • How to paint a Custom Cell  while you are editing on adjacent Cell in JTabl

    Hi All,
    I have two Columns in my Custom Table . Both Two Columns are Custom Cell Editors/Renderers.
    I have made UI such that Column1 is Label , Column 2 is TextBox / Combo/ UI Input any
    My Custom Table View when i edit some value against Max Conn. it should display Blue
    =================================
    Column A | Column B
    ==================================
    Timeout | some_unchanged_value
    *{color:#0000ff}Session{color}* | some_unchanged_value
    Log File | some_unchanged_value
    ===================================
    My issue is when i start typing in my Custom Editor suppose i Type /invoke Edtir of Index 2, Column 2 font should become Blue.
    It becomes blue only when i debug this issue it perfectly works, without Debugger it doesnt changes the Font
    MyDefaultRenderer is my Custom renderer - I have set Foregroud Color as BLUE
    NOTE:_
    In run method if table.repaint() instead of single renderer:
    It turns Blue when i make call on table.repaint() methosd but i feel that repainting full table on every key Stroke should not be very good programming. Whats is more appropriate way?
    I want to repaint only that particular cell against which i change the Value
        private class MyDefaultEditor extends AbstractCellEditor implements TableCellEditor {
            private JTextField txtField = null;
            private int rowIndex;
            public MyDefaultEditor() {
                txtField = new JTextField();
                txtField.addKeyListener(new KeyAdapter() {
                    @Override
                    public void keyTyped(KeyEvent e) {
                        super.keyTyped(e);
                        System.out.println("########### Hello This is MyDefaultEditor");
                  SwingUtilities.invokeLater(new Runnable() {
                            public void run() {
                                  // Call Renderer adjacentt to input to turn Blue (Is this Valid Code ??)
                                MyDefaultRenderer defRen = (MyDefaultRenderer) thisTable.getCellRenderer(activeRowIndex, 0);
                                defRen.paintMe();
              // table.repaint() works for me but i dont want to call it on evey ket type, that will be Heave rite???
            public Component getTableCellEditorComponent(JTable table,
                    Object value, boolean isSelected, int row, int column) {
                rowIndex = row;
                String valStr = "";
                if (value != null && value instanceof String) {
                    valStr = value.toString();
                txtField.repaint();
                return txtField;
            public Object getCellEditorValue() {
                return txtField.getText();
        }Edited by: Shubhadeep on Jun 27, 2009 1:58 AM
    Edited by: Shubhadeep on Jun 27, 2009 2:01 AM
    Edited by: Shubhadeep on Jun 27, 2009 2:06 AM
    Edited by: Shubhadeep on Jun 27, 2009 2:12 AM

    Well, I think you need to add a custom renderer to the first column. The renderer would check if the table.isEditing(). If it is and the editing is done on the same row, then you set the font color blue, otherwise you use the default font color.
    Then the next question is how do you repaint the cell. Well you can use the table.repaint(Rectangle) method. You can get the Rectangle to repaint by using the table.getCellRect(...) method.
    Finally, you need to know when to repaint the cell. Well a PropertyChangeEvent is fired when a cell starts and stops editing. So you only need to handle these events. Don't use a KeyListener. The PropertyChangeListener you add to the table might be something like:
    public void propertyChange(PropertyChangeEvent e)
         if ("tableCellEditor".equals(e.getPropertyName()))
              if (table.isEditing())
                   processEditingStarted();
              else
                   processEditingStopped();
    }So when editing is started you need to determine the "adjacent" cell you want to repaint to the blue font is used. You would save the cell Rectangle so you can restore the font when editing is stopped.

  • Numbers, charts and adjacent cells

    I can't seem to generate a chart from non-adjacent column cells. I've tried this from the help file:
    To add a chart based on nonadjacent cells, hold down the Command key as you select cells from a table. Then click Charts in the toolbar, and choose a chart type.
    and it doesn't work. Any ideas please?
    Thanks, Rob

    The feature behaves flawlessly.
    Are you sure that you apply the described process.
    I selected A1 … B11
    then, with the cmd key pressed, I selected E1 … E11
    Yvan KOENIG (from FRANCE samedi 24 janvier 2009 12:00:04)

  • For charts, how do I choose a non-adjacent column for the labels

    How do I create a create pie chart where the labels are column A, but the actual data is non-adjacent like Column E?
    How do I do this?
    Thanks
    Graham

    In your first post, your labels were in header column A, just the way Numbers likes them. The answer that was provided fit the question that was asked.
    It appears that if you want labels from somewhere other than the header column, you have to select the label for each wedge separately.  Create the pie chart, select a wedge, from the Wedge tab in the sidebar you can select the cell you want to use for the "name" of that wedge. The names can come from anywhere, not just a single column
    An alternate solution would be to create a new table for the chart. This table will pull the labels and data from your other table, putting them into header column A and data column B, respectively.  Then create a pie chart from that table.

  • Concatenate with Commas in Non-Blank Cells

    I am concatenating last and first name cells in a pair of long columns.  I do not want to display commas in the non-blank cells when extending the formula down the sheet.  On the web I found a formula which almost works:  =C7&IF(B7="","","
    "&B7) .
    But, I need to put a comma between the last and first names.  So, instead of "Smith Hal" it would read "Smith, Hal".  Please advise.
    PS, An alternative would be to delete the commas from blank cells in the concatenated column from earlier today.  But, Excel does not see them for some reason and will not allow me to replace them with nothing.  Is there a way to do this en masse?
    Thanks.
    Doug in York PA
    Douglas R. Eckert

    I stumbled upon the solution.  Here is my note to myself for future reference.
    COMMAS in CONCATENATE BUT NOT IN BLANK CELLS – FORMULA
    To concatenate a long column of names (last, first) without leaving extra commas in the blanks cells use the following formula: 
    =C7&IF(B7="","",", "&B7) .
    Please close this question.
    Thanks.
    Doug in York PA
    Douglas R. Eckert

  • Unable to edit cells in JTable on single click of the cell.

    Hi,
    I am unable to edit a cell in JTable on single click of the cell. If I double click on the cell, I am able to edit it. Please help me.
    Thanks
    Subbu

    Thanks for all replies. Now, i am able to edit the cell on single click.

  • Join non-adjacent CD Tracks

    I am unable to import non-adjacent CD tracks using the Join CD option, which is greyed out. The tracks are in track number order and there is no problem joining adjacent tracks.
    I am using v. 10.2.2.14 on a laptop running Windows 7.
    Has anyone encountered this problem and found a solution?

    Chris CA wrote:
    Why would you want them joined together?
    They are not even next to each other on the CD
    ummm because I want to join them together.
    ummm ya that seems to be the problem, they are not next to each other so therefore iTunes cannot join them together.
    That is why I am here, seems the iTunes help needs help.
    iTunes Help wrote:
    Joining CD tracks
    When you import songs from a CD into iTunes, you can combine songs so that they always play together (even when shuffling songs).
    To join tracks:
    Insert an audio CD into your computer's CD or DVD drive.
    When the songs on the CD appear in the iTunes window, select the ones you want to join (hold down the Shift key to select multiple songs).
    Choose Advanced > Join CD Tracks.

  • I want to simply multiply 2 adjacent cells using Numbers

    I'm new to numbers. I've discovered how to add up columns, but cannot for the life of me work out how multiply 2 adjacent cells.
    All i want to do is multiply cell C33 by cell D33 and get the answer in cell E33.
    I know that the multiplication key is *
    Thanks for your help
    Darrell

    Darrell,
    Enter this in Cell E33
    =C33*D33
    Ian.

  • Cannot Autofill sequential content into adjacent cells in Numbers

    Numbers V3.2 for OSX
    Problem #1:
    I cannot Autofill sequential content into adjacent cells.  I enter Jan., Feb. into the first two cells, then try to use the little yellow ball to project Mar., Apr., etc. into the adjacent cells.  I'm new to Numbers, so maybe I'm missing something.  I've used Excel for over 25 years, and I'm now trying to convert to Numbers.
    Problem #2:
    How do you link a cell from one spreedsheet to a second spreedsheet?  I read all of the Help files and can't find a reference.
    Thanks for your help!

    HI Paul,
    "I found that one of my problems is that I abbreviated the month, i.e., Jan."
    If you include a period after Jan, Numbers will not recognize it as a shortened month name. use "Jan" (without the quotes).
    Regarding linking cells:
    If by "spreadsheets" you mean "Tables in the same document," cells in those two locations can be linked. In the simplest case (two tables on th same Sheet, or two tables, each with a name unique within the document, on separate Sheets, the Table name must be added to the cell reference.
    Example: formula in a cell on table named "This" referencing cell B2 on a table named "That" located elsewhere in the same document:
    =That::B2
    If the second table is in a different document, no. Numbers cannot reference external documents.
    If this is a significant issue, Provide Numbers Feedback, using the item of that name in the Numbers menu, to make a feature request for a future version of Numbers.
    Regards,
    Barry

  • Editing non-tree cells problem in JTreeTable

    Hello all,
    I've been playing around with the JTreeTable for quite a while and have a fairly good grip on it. However, I've run into a problem that involves the display of cell data in the non-tree cells.
    Assume I have a JTreeTable with one node below the root (and the root node is not displayed). Also assume I've edited some information in one of the other cells in a 5-celled JTreeTable. The JTreeTable behaves normally with regard to editing/setting the values of the table cells.
    Now, with the click of a separate button, I programmatically create a new node in the JTree. I update the JTree model with a call to nodeChanged() and nodeStructureChanged() (or I could call reload() - both seem to work).
    This successfully adds a node, but in the process clears the entire remainder of the table's cell values. If I call fireTableDataChanged(), then the display of the JTree gets all screwed up (basically what happens to the display if you add/remove nodes, but don't update the display in a JTree). Not only that, but the fireTableDataChanged() method still does not redisplay my cell information for the remainder of the table.
    I'm at a loss to figure out what's responsible for this. The tableCellRenderer seems to work just fine until I add node. Even then, the tableCellRenderer for the JTree still works until I call fireTableDataChanged().
    Any ideas?
    Thank you,
    Brion Swanson

    I use a JTreeTable and in looking at my code, I've
    noticed that I make use of treeTable.repaint() fairly
    frequently (as whenever I update my stuff).Did the treeTable.updateUI do funky things to your JTree? It does on mine if I do a programmatic node addition or removal (basically any change to the tree structure will cause treeTable.updateUI() to completely destroy the display of the tree). This is a separate issue, but I thought I'd ask anyway since you seem to have run into at least a few of the same problems I'm experiencing.
    I don't fully understand your problem<snip/>
    do you mean
    it drops all edits you have done?Yes, it drops all the edits except the one currently being "edited" (that is, the selected editable cell will not lose it's value).
    I had a problem about it dropping the edits I had
    done and I resolved them by adding key listeners
    and played with the TableCellEditor.Could you elaborate on what you did to the TableCellEditor and which object you had listening to the keys (the table? or the tree? or something else?).
    You help is greatly appreciated!
    Brion Swanson

  • Can't change cell's type on a non-empty cell!

    Can't change cell's type on a non-empty cell!
    I need to empty cell, then change the type, then retype the value of a cell.
    Number 3 on Maverics.
    File was created on Numbers 2.3
    Thank you.

    Alazarev,
    Can you post a screenshot showing the problem.  You can select the cell(s) then adjus the formatting as needed using the Cell format tool on the right.

  • Is there a formula I can use to link a choice from pop-up menu to a $ amount in adjacent cell?  i.e. if Item 1 is chosen, adjacent cell populates $125.  if Item 2 is chosen, adjacent cell populates $250.

    is there a formula I can use to link a choice from pop-up menu to a $ amount in adjacent cell?  i.e. if Item 1 is chosen, adjacent cell populates $125.  if Item 2 is chosen, adjacent cell populates $250. it seems like this must be possible.  Help please!

    Hi Gabe,
    You could use an IF statement in the second cell.
    Popup in column B, two items: "This", That" (without the quotes)
    Formula in same row of column C
    Format the cell in column C as currency.
    If there are more than two items in the popup menu, it's better to use a lookup table containing the same list as the popup in column A, with the corresponding values in column B:
    C5: =LOOKUP(B,List :: $A,List :: $B)
    Regards,
    Barry

  • Sharing non-adjacent clips on imovie HD 6

    Is there any way to select and share non-adjacent clips - for iweb - in imovie hd 6?

    Can't you just select them and
    share them (share selected clips only checkbox)? I
    have never tried to share non-adjacent clips, so I
    don't know first hand.
    The "share selected clips" checkbox seems to be disabled whenever the clips are nonadjacent.
    But if it doesn't work, the
    simple solution is to just move them next to each
    other, share them, then either quit without saving,
    do an UNDO, or manually move them back to where they
    were.
    Your workaround sounds like it would work, but the movie I'm selecting clips from is long and complicated and there are several clip gaps I would have to eliminate and then restore to get the clips I want. I was hoping to find an easier way.

  • Is there a way to choose non-consecutive cells when performing Instant Calculations?

    I know how to do an equation to add things up. I've discovered the convenience of the Instant Calculations feature where I select consecutive cells with values, then drag drop the resulting equation from the Sum in the lower left corner of my spreadheet. That works fine if I chose cells consecutively in a column,row, or select by dragging over an area. I haven't found a way to select non-consecutive cells to create a sum, with Instant Calculations, however.

    hold down the <command> key while clicking non-contiguous cells

Maybe you are looking for

  • Interactive report: How to display "count" column on total data set?

    Hi, I'm a relative newbie to APEX and would appreciate some help with the following: I have an interactive report that will usually contain around 8000 rows. I need to report the total number of distinct values in one of the columns - but I need to g

  • Oracle Tree Hierarchy Query

    Hi, Hoping someone can assist with this query: I am currently using this query to construct a tree hierarchy, i.e. SELECT "EMP"."MGR" as "MGR",         "EMP"."EMPNO" as "EMPNO",         "EMP"."ENAME" as "ENAME" ,         (select count(*)  from "EMP"

  • The order of execution (of PL/SQL function calls) changes...why??

    select e.EMPID empid, e.name name, aatest.SETVALUES(2) z, aatest.TEST1() b, aatest.TEST2() x, aatest.TEST3() y from emp e where e.empid = 101 order by e.name; when I execute this select statement...the order of function calls is as follows: setvalues

  • Message KI102  with BAPI_ACC_MANUAL_ALLOC_POST

    Hi all, I have a problem with the CO-BAPI BAPI_ACC_MANUAL_ALLOC_POST. IN test the BAPI an Error occures: "Control indicators for controlling area xxxx do not exist" Message ki 102 Can anybody help me with this issue? Thank you in advance. Sebs

  • BI 7.0 Stats - Is it supposed to install us the Standard Process Chain?

    Hi All, We understand that Virtual Cubes would obtain the real-time based on what is there in the basic cubes, underlying the Technical Content Multicubes. We did install all the technical content. Is it supposed to install us the Standard Process Ch