CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2000
    Posts
    32

    How can I set focus to a particular table's cell

    How can I set focus to a particular table's cell?

    Thanks



  2. #2
    Join Date
    May 1999
    Posts
    7

    Re: How can I set focus to a particular table's cell

    Hello,

    you can select a cell in a table, and you can edit that cell. If you edit that cell, the celleditor of it get the focus and the table lost the focus. If you just select the cell, the table has the focus but the cell is selected.

    You can select cells with the following methods:

    setColumnselectionInterval(int, int)
    setRowSelectionInterval(int, int)



    and you can edit a cell by the following method:

    editCellAt(int iColumn, int iRow)




    Greetings
    Ting.


  3. #3
    Join Date
    Jan 2000
    Posts
    32

    Re: How can I set focus to a particular table's cell

    Thanks for your reply! It works.

    How can I cancel the focus of a particular cell?
    Suppose that when user click a particular cell, I will show
    a dialog.
    After that, I want to cancel the focus of this cell.
    How can I achieve it?




  4. #4
    Join Date
    May 1999
    Posts
    7

    Re: How can I set focus to a particular table's cell

    Hello,

    to cancel the selection, use the methode

    JTable.clearSelection();




    To cancel the editing, use the methode

    JTable.getCellEditor().stopCellEditing();




    Greetings.
    Ting.


  5. #5
    Join Date
    Jan 2000
    Posts
    32

    Re: How can I set focus to a particular table's cell

    Thanks a lot!
    It works


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured