Results 1 to 4 of 4
  1. #1
    tvalerio is offline Member
    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0

    Question JTable Customized Row Question

    I would like some input on how to implement the following row rendering. I don't need actual code but just the concept.
    Row 1 is Yellow and Row 2 is White. My bean has Order Date, Req Ship Date, ... and Product as properties.

    JTable Customized Row Question-table-row.jpg

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

    Default Re: JTable Customized Row Question

    You would need to use a custom cell renderer to do this. The JTable tutorials have information and examples on how to do this.

  3. #3
    tvalerio is offline Member
    Join Date
    Jul 2012
    Posts
    2
    Rep Power
    0

    Default Re: JTable Customized Row Question

    Fubarable, are you sure about that? I would like to take one of the cells and put it under all the other cells in the row and have it span the columns.
    I have coded many cell renders which only effect the cell of the column I attach to it. I have not found any example or code that shows what I am trying to do.

    I think I have to implement my own TableUI, most likely override the BasicTableUI and customize the paint(), paintCells(), and paintCell() methods.
    If I do this I think that I might mess up thing down the line like drag and drop, row selection, etc.

    It has been a while since I coded Swing so I am looking for some guidance and maybe so things to look out for by extending some of these objects.

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

    Default Re: JTable Customized Row Question

    No, I'm not sure. My answer was mainly for the color differences of the two rows. To make a fancy row as you are desiring would require a bit more, I believe as rendering on the cell level would not be adequate. Sorry for the mistaken advice.

Similar Threads

  1. Customized Title Bar
    By ex0b1t in forum AWT / Swing
    Replies: 1
    Last Post: 11-07-2011, 02:55 PM
  2. Customized JFrame
    By oomrichie in forum Advanced Java
    Replies: 10
    Last Post: 05-02-2011, 02:22 AM
  3. Customized Radio Button
    By Javified in forum AWT / Swing
    Replies: 6
    Last Post: 12-13-2010, 07:06 AM
  4. A customized dialog box
    By radhi in forum AWT / Swing
    Replies: 9
    Last Post: 09-27-2010, 08:06 AM
  5. Create customized ColorChooser
    By LianaN in forum AWT / Swing
    Replies: 1
    Last Post: 08-26-2010, 08:24 PM

Tags for this Thread

Posting Permissions

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