CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Java Programming > Java Programming
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Java Programming Ask your Java programming question and help out others with theirs.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old December 6th, 1999, 12:34 PM
    davedrake1 davedrake1 is offline
    Member
     
    Join Date: Sep 1999
    Location: Johnson City, NY
    Posts: 43
    davedrake1 is an unknown quantity at this point (<10)
    How can I set the focus of a JTable cell?

    Can someone explain how to set the focus to one cell in a JTable? I have looked everywhere for this answer, and not found it yet. Please Help..

    --Dave


    Reply With Quote
      #2    
    Old December 14th, 1999, 01:37 PM
    seemapatil seemapatil is offline
    Junior Member
     
    Join Date: Dec 1999
    Location: nj USA
    Posts: 1
    seemapatil is an unknown quantity at this point (<10)
    Re: How can I set the focus of a JTable cell?

    jtable.setColumnSelectionInterval(0,0);
    jtable.setRowSelectionInterval(0,0);

    This will focus Cell(0,0)

    Reply With Quote
      #3    
    Old November 10th, 2008, 11:18 PM
    SowmyaKalkiTech SowmyaKalkiTech is offline
    Junior Member
     
    Join Date: Oct 2008
    Posts: 3
    SowmyaKalkiTech is an unknown quantity at this point (<10)
    Re: How can I set the focus of a JTable cell?

    Please help me how to focus a particular cell in a jTable. (For ex: cell(3,2) ). After validating a cell on focus out, I want to get back to the same cell.

    I have tried with the below code:
    jtable.setColumnSelectionInterval(0,0);
    jtable.setRowSelectionInterval(0,0);"
    But it dint work....

    Kindly help me in this issue.
    Reply With Quote
      #4    
    Old November 12th, 2008, 05:00 PM
    dlorde dlorde is offline
    Elite Member
    Power Poster
     
    Join Date: Aug 1999
    Location: UK
    Posts: 9,159
    dlorde is a glorious beacon of light (400+)dlorde is a glorious beacon of light (400+)dlorde is a glorious beacon of light (400+)dlorde is a glorious beacon of light (400+)dlorde is a glorious beacon of light (400+)dlorde is a glorious beacon of light (400+)
    Re: How can I set the focus of a JTable cell?

    Apologies for the delay...

    If you want only a single cell focused, make sure you have cell selection enabled, then select the required cell and give the table focus. The cell won't be focused unless the table is given focus:
    Code:
    table.setCellSelectionEnabled(true);
    ...
    table.changeSelection(row, column, false, false);
    table.requestFocus();
    The best performance improvement is the transition from the nonworking state to the working state..
    John Ousterhout
    __________________
    Please use [CODE]...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Java Programming > Java Programming


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 09:11 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009