Retarding the repainting of a JComponent

Discussion in 'Java' started by Richard B. Christ, Oct 24, 2003.

  1. I am working with a table (not the JTable but a fully customized
    extension of
    JComponent). With this table it is possible to have some rows selected
    and to have column sorted(s) for instance. This table implementation
    is per default embedded in a JScrollPane.
    After having changed the whole model of the table, I would like to
    retrieve the
    previous state (defined by the position of the scrollbar, the selected
    rows and the sorted column(s)) of the table. While doing this Java
    does the things one after the other so that the user sees the whole
    process (what is not very elegant):
    - user gets a new table
    - old selected rows gets selected
    - old sorted columns get sorted
    - scrollbar updates its state
    I would like Java making all these updating steps before showing the
    table. I would like Java retarding the repainting of the table until
    the table has selected its previous selected rows, until the table has
    sorted its previous sorted columns and so on. How can I achieve that?
    Any help would be gracefully appreciated. Cheers,

    richard
    Richard B. Christ, Oct 24, 2003
    #1
    1. Advertising

  2. Richard B. Christ

    Harald Hein Guest

    "Richard B. Christ" wrote:

    > While doing this Java
    > does the things one after the other so that the user sees the whole
    > process (what is not very elegant):
    >


    No, it is not Java, it is you who does this by firing the corresponding
    events. First do all your changes in the model, than fire one event
    telling the JTable to update the display.
    Harald Hein, Oct 25, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Roger Davis

    JComponent repaint nightmare

    Roger Davis, Nov 22, 2003, in forum: Java
    Replies:
    3
    Views:
    6,660
    Alex Hunsley
    Dec 11, 2003
  2. dbritton

    How to "ghost" a jcomponent?

    dbritton, Feb 5, 2004, in forum: Java
    Replies:
    2
    Views:
    287
    Andrew Thompson
    Feb 5, 2004
  3. smat

    JComponent on JTree

    smat, Oct 24, 2005, in forum: Java
    Replies:
    2
    Views:
    1,482
    Roedy Green
    Oct 25, 2005
  4. Jacob
    Replies:
    8
    Views:
    562
    VisionSet
    Mar 18, 2006
  5. Mahesh S

    Tooltip on JComponent

    Mahesh S, Jan 31, 2007, in forum: Java
    Replies:
    1
    Views:
    367
    Andrew Thompson
    Jan 31, 2007
Loading...

Share This Page