Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Posts
    21
    Rep Power
    0

    Post Hilighting Mulitiple Rows

    i have Jtable.
    this table updates the contents dynamically

    and in that some of the rows should be dynamically highlighted.
    Example : consider as table

    Date-------------------Time -------------------VideoMass
    12/02/2009-------------8:30:12-------------------7.0

    12/02/2009-------------8:30:13-------------------15.0

    12/02/2009-------------8:30:14------------------10.0

    12/02/2009-------------8:30:15--------------------9.0

    12/02/2009-------------8:30:16-------------------21.0


    in the sample table

    12/02/2009-------------8:30:12-------------------7.0

    12/02/2009-------------8:30:15--------------------9.0

    only these rows should be higlighted.
    this higlighting is done base on the VideoMass Column value is less than
    9 and below.
    the end user need not to click on the row and hold on CTRL button
    from the keyboard.the highlighting should be done by itself when the
    VideoMass Column value is lower than 9



    is there any idea to do.

    is there any sample available on the net.

    thanks advance for ur help
    Last edited by britto_bicsjohn; 08-29-2009 at 03:12 PM. Reason: Not aligned properly
    :) javadeveloper

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    You may do well to create a new TableCellRenderer that subclasses DefaultTableCellRenderer and have it set the background of an opaque JLabel as desired. The Sun JTable tutorial will show you how to play with renderers.

  3. #3
    Join Date
    Aug 2009
    Posts
    21
    Rep Power
    0

    Default

    Thank you
    .i will use TableCellRenderer and let u know
    :) javadeveloper

  4. #4
    zweibieren is offline Senior Member
    Join Date
    Aug 2009
    Location
    Pittsburgh, PA
    Posts
    284
    Rep Power
    6

    Default

    By calling
    Java Code:
    table.getSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION)
    You can suimultaneously select as many different rows in the table as you like.

Similar Threads

  1. Highlight rows of a jtable
    By simmi in forum AWT / Swing
    Replies: 5
    Last Post: 08-20-2009, 02:13 PM
  2. Deleting rows from a database using JSP
    By Manas Das in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 02-17-2009, 03:31 PM
  3. How to get the no. of rows in a resultset
    By baskar.nitt in forum New To Java
    Replies: 5
    Last Post: 09-19-2008, 02:30 PM
  4. Two diM aRRay and add rows and columns....
    By filly444 in forum New To Java
    Replies: 2
    Last Post: 08-30-2008, 06:24 PM
  5. Fetching rows from DB
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-06-2008, 10:23 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
  •