How can i refresh JFrame at regular intervals to display in intervals

I have a query which is :
String query = "select FIRSTNAME, MIDDLEINITIAL, LASTNAME from user" ;
now i have executed the above query
ResultSet rs = stmt.executeQuery(query) ;
Suppose i get 2000 rows in my resultset after execution.
If i want to display all the contents of my query inside a JFrame, then i can say
JFrame myFrame = new JFrame() ;
myFrame.setSize(500, 500) ;
while(rs.next()){
add the results to myFrame
myFrame.pack() ;
myFrame.setVisible() ;
but this may take a long time to show my frame, because first it has to either add components to my JFrame if use JLabels or if i use graphics then it has to wait till complete all of my drawString's to display the JFrame.
and this may take time.
I would like to know, how can make my JFrame intelligent enough so that if first display an empty frame, refresh at regular intervals and see how many i have fetched from the result set and add those to my JFrame, and do this opration untill i am done fetching all the results.
Thanks
Arun

Any reason why you aren't displaying the results in a table? Both labels and drawString do not seem like a good alternative.
Now to your question, you could use a thread and force painting after so many from the resultset. You could display a fixed number and implement your own scrolling scheme. Say paint first 50 and scrolling forward and back.

Similar Messages

  • How can I "refresh" my iTunes Library?

    How can I "refresh" my iTunes Library? I recently moved my library to an external and made the source folder change in preferences. My library now shows all exclamations asking me to locate the files. What is the quick fix to locate or "refresh" all?

    Michael,
    Your response here seems exaclty like the answer that I need.  My logic board broke and I had to get a new one.  Sent to Apple and all is working again.  I didn't have an super recent time machine back up....my last one was 2 months old.  I was able to salvage my music from the computer before sending in for repair and when I got it back, I reloaded my music file onto my machine.  I use iTunes match so maybe that kept many of my files/playlists etc in order.  But my iTunes is asking me to download many songs that are showing in iTunes and are in a folder in iTunes.  These are songs I downloaded during that 2 month break between time machine backups.  I think a refresh will fix this issue.  But when I follow your steps above, I not certain what file to choose.  I tried to go to my itunes ---> itunes media ---> music but that doesn't work.  Do I need to choose the "iTuens Library.itl" file?  I use my playlists for my job so I don't want to just guess here and lose everything.  I did do a backup of my playlists so hopefully I'm protected if something happens but just want a bit more guidance on this.  Thank you for your help and your time and let me know if you have any questions. 
    Best,
    Kirk

  • How can i Refresh my Variable Screen In WAD templet?

    Hi Experts,
    When i execute a WEB Templet giving Variable Selection Inputs , the Variable input values gets stored in the Variable Tab and will not change untill i Change it.
    Example
    Variable input 0PLANT     5030(this 5030 is the input where i give in the variable selection screen)
    when i  click back on the intrenet Explorer , this 5030 will be there stored in the 0PLANT tab.
    can any one give me solution how can i refresh the variable screen in the WAD
    Santosh Nagaraj

    Tis might be a browser feature - the variable values tend to get stored - you could look at implementing DSM ( through portal ) or try making your template stateless and see if the value changes...

  • My colors seem to be inverted on my g5 how can i return to the regular look?

    my colors seem to be inverted on my g5 how can i return to the regular look?

    I found the answer on the forum thx. Awesome

  • How can I refresh a web site that I use often but it also changes its content frequently. Where is the refresh icon?

    I use to refresh my browser & web pages by clicking on the "refresh" button. This button is no longer on my browser. how can I refresh a web page or keep it up to date if there is no refresh icon to use.?

    Firefox 4 and later use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    Middle-click the Reload button to duplicate the current tab to a new tab.<br />
    *https://support.mozilla.com/kb/common-questions-after-updating-firefox

  • How can i refresh view on query after changing the query?

    Hi,
    i built few view's on 1 query in BI7. after i made a change in the query i haven't seen it in the view, why?
    it's not refreshing automaticly from the query? and if it's not, how can i refresh the view?
    thanks
    Meirav
    Edited by: Meirava on Apr 2, 2009 11:43 AM

    Hi,
        You need to refresh that view and once again save the view with changed settings. Then it will brings according to the query changes.Once check the variables also.
    Regards
    Pcrao.

  • ListOptions what event is called on refresh?how can i refresh the sessionB

    Hi everyone, i'm currently starting my studies on this platform ...and i'm now going trough some problems that i hope someone can help me out on them.
    I have a project that involves accessing a xml file , and i managed to put some random values of the file on a ListOptions for a listbox.Now i would like to know how can i refresh the session bean or refresh the listbox when i change something on the file?
    Thanks
    DMS

    Hi everyone, i'm currently starting my studies on this platform ...and i'm now going trough some problems that i hope someone can help me out on them.
    I have a project that involves accessing a xml file , and i managed to put some random values of the file on a ListOptions for a listbox.Now i would like to know how can i refresh the session bean or refresh the listbox when i change something on the file?
    Thanks
    DMS

  • How can i refresh all CMP cache?

    Hi,
    In my application i need to delete many rows from DB using direct mySql commands. after i do that, my application server is still using the cached entity beans from before the deletion, and this might cause problems.
    How can i refresh all the entity beans cache completely?

    In my application i need to delete many rows from DB
    using direct mySql commands. after i do that, my
    application server is still using the cached entity
    beans from before the deletion, and this might cause
    problems.
    How can i refresh all the entity beans cache
    completely?Maybe if you were really using EJB you would know the answer. Describe the problems this is causing and explain what you don't respond to your forum post. Do you know how to write a SQL statement? Do you know what CMP stands for? Would you like to know how to create software programs?

  • How can i refresh the session object

    Hello..
    I am jst learning jsp... i hav a problem plz help me...
    I am using <jsp:useBean id="util" class="myUtilClass" scope="session" />
    I hav modified the object content...
    how can i refresh the object...
    ie...i want to access the modified data in the session object...

    You don't do that. It should already be reflected.
    Unless you modified another instance of it. If this is the case, then fix your code logic accordingly that it modifies the right object instance.

  • How can i refresh the mail, to see the latest email received from my hotmail account. If i close Mail, the program, and re-open, then I can see the latest mail received. Is there a key combo-short-cut to do this.

    how can i refresh the mail, to see the latest email received from my hotmail account. If i close Mail, the program, and re-open, then I can see the latest mail received. Is there a key combo-short-cut to do this.

    isaackito wrote:
    how can i refresh the mail, to see the latest email received from my hotmail account. If i close Mail, the program, and re-open, then I can see the latest mail received. Is there a key combo-short-cut to do this.
    Mailbox menu>Get New Mail:

  • How can I distinguish between a regular iPod and a iPod 4 s?

    How can I distinguish between a regular iPod and a iPod 4 s?

    Hi ARPantoja!
    I have an article here that can help you distinguish different iPod models:
    Identifying iPod models
    http://support.apple.com/kb/HT1353
    Take care, and thanks for visiting the Apple Support Communities.
    -Braden

  • I got bulks of videos in my ipad 2, how can i look at my videos in list display? or make the fonts in my movie gallery smaller?

    I got bulks of videos in my ipad 2, how can i look at my videos in list display? It's hard for me to look through my gallery with grid display..
    any ideas?

    There is no list display option. If there were such an option, it would likely be available within the Videos app.

  • How can I get the date and time and display it on the report main page?

    Gurus,
    How can I get the date and time and display it on the report main page?
    Thanks!

    Hello,
    You can create a Formula Colum returning a date :
    function CF_1Formula return Date is
    begin
    RETURN(SYSDATE);
    end;
    Put a Field in the Layout having this formula column as source .
    Regards

  • CS4 extended. Capture One vs Photoshop . How can I be sure that photoshop use my Display icc  Color Munki Color Profile?

    CS4 extended, OS10.7.5 . When I process an image in Capture One Pro  and then open it in Photoshop CS4 extended and compare to my original image in Capture I can see a big difference . ( Darker in C1 and flat in CS4)     I contacted Phase One and they said that the problem was probably due to photoshop who do not recognise my  Color Munki Display icc profile . How can I be sure that photoshop use my Display icc Color Munki Profile? Thanks !!!

    Hello Station_two,
    Thanks for you response.
    Yes . that's what I did as I created an icc profile with Color Munki .
    My problem is  when you look at the left image   ( Capture One )  and  the same images processed  and open in Photoshop ( Right image ) I can see a big contrast difference ...
    Now, let's assume that photoshop work automatically with my icc Color Munki  in display panel , why the image in  Capture One do not look the same ?  Is it a question of setup in C1 ? In c1 ICC /Process recipe  I have Adobe rgb (1998)  selected.... 
    Thanks!

  • How can i change sequence of structrure when i display in alv grid.

    Hi,
    I am doing object oriented alv. Now i need to change my sequence of alv grid. How can i change sequence of structrure when i display in alv grid. Send me code if possible....
    IF G_CONTAINER IS INITIAL.
         CREATE OBJECT G_CONTAINER
             EXPORTING
                CONTAINER_NAME = 'CONTAINER'.
         CREATE OBJECT ALV_DISP
             EXPORTING
                I_PARENT = G_CONTAINER.
         CALL METHOD ALV_DISP->SET_TABLE_FOR_FIRST_DISPLAY
             EXPORTING
               I_STRUCTURE_NAME  = 'ZPMS_OUTPUT_V3'
              CHANGING
                IT_OUTTAB        = IT_PMT
                IT_FIELDCATALOG  = G_FLDCAT
              EXCEPTIONS
                INVALID_PARAMETER_COMBINATION = 1
                PROGRAM_ERROR                 = 2
                TOO_MANY_LINES                = 3
                OTHERS                        = 4.
         IF SY-SUBRC <> 0.
         ENDIF.
    Regards,
    Gurprit Bhatia
    Message was edited by:
            GURPRIT BHATIA

    Hi Gurprit,
    when you are maintaining the field catalog you can maintain the order by populating the value as 1,2,... into col_pos filed.
    <b><REMOVED BY MODERATOR></b>
    Satish
    Message was edited by:
            Alvaro Tejada Galindo

Maybe you are looking for

  • SRM 7.0 Configuration

    Hi All, I trying to configure the SRM 7.0 system. When I am trying to run BBPSC01, it gives the following error. Error when processing your request What has happened? The URL http://in-ccuapp004.in.nam.ad.pwcinternal.com:8003/sap/bc/gui/sap/its/bbpsc

  • Quality issues in iDVD - is DVD Studio Pro the answer?

    Hi all, I am having a problem producing a high quality DVD with iDVD. I know this is the DVD studio forum but I am wondering if I need to switch form iDVD to get the results I want. So, this is what I am doing in iDVD. I am using 13 QT (.mov) movie f

  • IPod 3G mounting via Firewire problem

    hello, I've bought an iPod 3G 20gb. All was ok, but I couldn't connect it to my powrbook via firewire. iPod was charging but wasn't seen by computer (itunes, finder nor system profiler). When I plugged the ipod via usb powerbook recoknized it. Unfort

  • Hi do modifications to this code

    hi, i want to create a transaction with one or two fields and one save button in standard tool bar  and one variant button in application tool bar.                                if i click on save button the value entered in feld(s) must  stored in

  • Running Servlet in Tomcat 5.0

    Hi! This is with reference to my previous mail. I want to run a servlet program on Tomcat 5.0 installed in Windows XP/2000 computer. I was suggested from community previously to set classpath to jar files in tomcat directory. I did the same thing, bu