Results 1 to 4 of 4
  1. #1
    azibhai is offline Member
    Join Date
    Apr 2009
    Posts
    7
    Rep Power
    0

    Default Can nyone fix this problem

    hii all

    I am using JDK 1.5.0_18 , I have a problem with my JTable. I need to do both Column alignment and color for specific cell.So I had used two TableCellRenderer for alignment and color the cell.When I apply both renders into a table only the alignment render doing something .But whlie using the single render it is coming (either alignment or color). Is it possible to use multiple renders for a single table ?
    If not tell me another choice to rectify this problem?

  2. #2
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

    Default

    Is it possible to use multiple renders for a single table ?
    Yes. You can set a renderer for each column: getColumnModel > getColumn > setCellRenderer.
    You can also set/modify default renderers according to column class.
    In addition to setting a renderer you also have the option of using the prepareRenderer method for things like cell coloring in the table.

  3. #3
    azibhai is offline Member
    Join Date
    Apr 2009
    Posts
    7
    Rep Power
    0

    Default

    Thank you very much Mr.hardwired

    I did n see prepare render yet anyway thank you very much

  4. #4
    hardwired's Avatar
    hardwired is offline Senior Member
    Join Date
    Jul 2007
    Posts
    1,576
    Rep Power
    8

Posting Permissions

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