Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By camickr

Thread: how to select a whole row instead of a single cell?

  1. #1
    mangesh.gho is offline Member
    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0

    Question how to select a whole row instead of a single cell?

    i have JTable for which i hav disabled editing & i want it to be displayed as list. for example i have columns like id, item_name, price etc..
    So, when user clicks on any row another window will show its details.
    now problem is when i click on any row a specific cell gets selected (in dark rectangular border). i wnt tht border to cover the whole row.. how to do this??
    otherwise if i cn disable tht border, then also it will b ok for me.. pls help me..

  2. #2
    ContoNick is offline Member
    Join Date
    Dec 2011
    Location
    Croatia,Zagreb
    Posts
    24
    Rep Power
    0

    Default Re: how to select a whole row instead of a single cell?

    Hi.
    I had same problem as u.
    Check here
    JTable selecting single row problem

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,298
    Rep Power
    20

    Default Re: how to select a whole row instead of a single cell?

    Moved from 'New to Java'

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    camickr is offline Senior Member
    Join Date
    Jul 2009
    Posts
    1,236
    Rep Power
    7

    Default Re: how to select a whole row instead of a single cell?

    otherwise if i "cn" disable "tht" border, then also it will "b" ok for me.. "pls' help me..
    First of all , this is a forum, use proper words, not messaging shortforms.

    You can disable the column selection by using:
    Java Code:
    table.getColumnModel().setSelectionModel( new DefaultListSelectionModel()
    {
    	@Override
    	public int getLeadSelectionIndex()
    	{
    		return -1;
    	}
    });
    i wnt tht border to cover the whole row.. how to do this??
    Check out the approach used in: Table Row Rendering « Java Tips Weblog
    mangesh.gho likes this.

  5. #5
    mangesh.gho is offline Member
    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0

    Default Re: how to select a whole row instead of a single cell?

    thank you everybody.. got that

Similar Threads

  1. How to get <select> tag values on other jsp
    By nehakuls in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 11-18-2009, 06:58 PM
  2. how to select the whole tree
    By beatme in forum XML
    Replies: 0
    Last Post: 10-10-2009, 06:01 PM
  3. How to retain value in struts 2 using <s:select></s:select> tag
    By SaiPrasad@Sella in forum Web Frameworks
    Replies: 0
    Last Post: 02-09-2009, 07:23 AM
  4. Select Count
    By Apple2 in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 04-29-2008, 09:02 AM
  5. Select specific cell
    By Echilon in forum New To Java
    Replies: 1
    Last Post: 01-01-2008, 07:47 AM

Posting Permissions

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