Results 1 to 3 of 3
  1. #1
    yontan8888 is offline Member
    Join Date
    Jan 2011
    Rep Power

    Default i try to put JProgressBar i jtabl

    i try to put JProgressBar in row on jtabl but i can not do it

    I uploaded a picture

    Thank you

  2. #2
    NRitH is offline Senior Member
    Join Date
    Feb 2011
    Rep Power


    By default, TableModel.getObjectAt() returns a String representation of the data in the cell. What you want is a custom TableCellRenderer. Here's how:

    1. Create a class that implements javax.swing.table.TableCellRenderer.
    2. Implement its getTableCellRendererComponent() to return an instance of your progress bar.
    3. Tell the table to use that custom cell renderer whenever it has to render a cell in that column. This is done by overriding Table.getCellRenderer().

    What I would do is subclass JProgressBar, have the subclass implement TableCellRenderer, and have getTableCellRendererComponent() just return this. That way, you can continue to use your progress bar as you did before, with the added benefit that it can do double duty as the cell renderer.

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

Similar Threads

  1. Problem With JProgressBar
    By akssingh400 in forum AWT / Swing
    Replies: 6
    Last Post: 02-24-2011, 07:08 PM
  2. Load thread with JProgressBar
    By Dennis in forum Advanced Java
    Replies: 10
    Last Post: 10-09-2010, 09:32 AM
  3. JprogressBar
    By cotarelo in forum AWT / Swing
    Replies: 7
    Last Post: 03-26-2010, 04:13 AM
  4. JProgressBar inside a JDialog
    By Mikey_S in forum AWT / Swing
    Replies: 10
    Last Post: 07-13-2009, 02:55 PM
  5. Updating a JProgressBar from another thread?
    By Xiphias in forum AWT / Swing
    Replies: 3
    Last Post: 03-18-2009, 02:48 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