Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #1594

Re: Updating a Single Pro

From "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this>
Subject Re: Updating a Single Pro
Message-ID <1178552408.753924.260070@e51g2000hsg.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
References <463e9e6e$1@dnews.tpgi.com.au>
Date 2011-04-27 15:34 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On May 6, 11:35 pm, Lionel van den Berg <lione...@gmail.com> wrote:
> Jason Cavett wrote:
> > I am trying to
> > figure out how to update just the JProgressBar in question.
>
> There's several ways you could do it. Can you pull out your code and
> create an example of what you have? If you post that here we can help.
>
> Also, what ISN'T working? I don't know what your program is doing as it
> stands. I don't know if you are doing all of your processing from the
> EDT or otherwise so I can't rule out that as being your problem.
>
> Lionel.

I've been working on the program this morning and I've figured *some*
things out.  The progress bar is now updatnig.  The problem is that,
if I have multiple rows, ALL of their progress bars are updating when
I only want one to be updating (the one that is currently
processing).  It seems as though every cell holds the same
ProgressBarRenderer and I'm not sure how to give each row its own
renderer (especially because the example I was using to help me figure
this out doesn't seem to do that).

Below is the initialization for the JTable.  I update the table model
(which extends DefaultTableModel) via the Observer pattern.  (The work
is being done in other classes and the progress bar is being updated
based on that work.  I'm not even sure if this is the best way to do
it, but that's not my main problem.)

private JTable getRunningTable() {
  if (runningTable == null) {
    runningTable = new JTable(runTableModel);

    // TODO set column widths

    // don't allow dragging of columns
    runningTable.getTableHeader().setReorderingAllowed(false);

    // setup selection process
 
runningTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

    // set column renderer for a JProgressBar
    TableColumn col =
runningTable.getColumnModel().getColumn(RunView.PROGRESS_BAR_COLUMN);
    col.setCellRenderer(new ProgressBarRenderer());
  }
  return runningTable;
}


Thanks for your help.

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Updating a Single Progres "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
  Re: Updating a Single Pro "Lionel van den Berg" <lionel.van.den.berg@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
    Re: Updating a Single Pro "Jason Cavett" <jason.cavett@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000
      Re: Updating a Single Pro "Michael Rauscher" <michael.rauscher@THRWHITE.remove-dii-this> - 2011-04-27 15:34 +0000

csiph-web