How do I load graphics at boot, to make the initial paint faster?

I'm running a big application, with many screens (JPanels) on a slow system. The average time for the system to change screens is about 200ms. The first time you visit a screen, the average time to load is 400ms. Every time after that, its about 200ms. All of the screen are on top of each other, with setVisible(false) applied to all but the visible one. The only call made when changing screens is setVisible(false) and setVisible(true) (one to turn the previous screen off, the other to turn the new one on. I'm trying to find a way to get rid of that initial 400ms, and bring it down to 200ms. Is there anyway I can cache the graphics before the page is first visited?

No, i dont think that is it. I think I have narrowed it down to something very simplistic. Say you extend JPanel, and at the end of your initialization for this panel, you say
System.out.println(this.getGraphics());
It will print out "null".
It will continue to say null, from any point that you call this, until it is visibly painted to the screen. After that it will return something like sun.java2d.SunGraphics2d....etc. Something that basically identifies this Graphics object. What i believe will solve my issue, is figuring out how to get the "getGraphics()" method to return something other than null BEFORE it is initially painted to the screen. Once the Graphics object is instantiated, I believe that will solve the extra time issue when first entering a screen. Using a card layout will still make the graphics object null until it is first painted....or something else initializes it...and that is what I'm trying to figure out.

Similar Messages

  • How Can I make the following query faster

    Hi Guru
    I want your valuable suggestion to make the following query faster.I did not write all required columns list. I gave here all those columns where I have conditon like decode,case when,or subquery
    (SELECT CASE WHEN REPORTED_BY IS NULL THEN
              (SELECT INITCAP(EMP_NAME) FROM HR_EMP WHERE EMP_NO = M.EMP_NO_RADIO)
         ELSE (SELECT INITCAP(EMP_NAME) FROM HR_EMP WHERE EMP_NO = M.REPORTED_BY) END RADIOLOGIST_NAME,
         (SELECT TEAM_NAME FROM DC_TECHTEAMMST WHERE TEAM_NO = M.GROUP_NO) GROUP_NAME,
         CASE WHEN M.RESULT_ENTRY_LOCK_BY IS NOT NULL THEN 'R'
    WHEN M.REPORT_DONE = 'D' THEN 'D'
    WHEN M.REPORT_DONE = 'P' THEN 'P'
    WHEN M.REPORT_DONE = 'F' THEN 'F'
         WHEN NVL(M.IMG_CAPTURED,'X') NOT IN ('B','Y') OR M.QA_RESULT = 'F' THEN 'S'
    WHEN NVL(M.IMG_CAPTURED,'X') IN ('B','Y') AND NVL(M.QA_RESULT,'X') NOT IN ('B','P') THEN 'Q'
         wHEN NVL(M.IMG_CAPTURED,'X') IN ('B','Y') AND NVL(M.QA_RESULT,'X') IN ('B','P') THEN 'C'
    END STATUS,
         (SELECT DECODE(NVL(V.DELIVERY_STATUS,'N'),'E',3,'U',2,1)
              FROM FN_VOUCHERCHD V WHERE V.VOUCHER_NO = M.VOUCHER_NO AND V.ITEM_NO = M.TEST_NO) DELIVERY_STATUS,
         trunc((start_time-order_end)*24,0)||' hr'||':'||
         decode(length(trunc(to_char(MOD((M.start_time-M.order_end)*24,1)*60),0)),2,to_char(trunc(to_char(MOD((M.start_time-M.order_end)*24,1)*60),0))
              ,1,to_char('0'||trunc(to_char(MOD((M.start_time-M.order_end)*24,1)*60),0)))||' mi' duration_order_capture,
         DECODE(R.CONFIDENTIAL_PATIENT,'Y','*',NVL(R.NAME,R.name_lang_name||' '||R.name_lang_fname)) PAT_NAME,
         FNC_PATIENTAGE(R.REG_NO,'',R.CONFIDENTIAL_PATIENT) pat_age,
         DECODE(R.CONFIDENTIAL_PATIENT,'Y','*',R.PATIENT_SEX) PAT_SEX
    FROM DC_MODALITYAPPOINTMENT M,DC_TESTMST T,OP_REGISTRATION R
    WHERE M.ACCESSION_NO IS NOT NULL AND NVL(M.CANCEL_FLAG,'N') = 'N'
    AND (NVL(T.SP_GEN,'S') = 'S' OR NVL(M.DOC_REQ_GEN,'N') = 'Y')
    AND M.TEST_NO IS NOT NULL AND M.TEST_NO = T.TEST_NO AND M.REG_NO = R.REG_NO)
    How can I make the above query faster.
    Query condition or indexing whatever is preferable please guide me.
    The approximate data of tables
    DC_MODALITYAPPOINTMENT 2,000,000
    A lot of updating is going on some columns of this table.all columns are not in the select list, Insertion is happend in batch process by back-end trigger of another table.
    Primary key based one column,
    OP_REGISTRATION 500,000
    Daily insertion on this table around 500 records,updation is not much.
    Primary key based one column 'reg_no'
    DC_TESTMST
    Total records of this table not more than 1500.This is setup table. Insertion and updation is not much on this table also
    I have to create a view based on this query .
    and I have to create another view to serve another purpose.
    In the 2nd view I need this query as well as I need another query by using union all operator based on a table(dc_oldresult)
    which have 1,600,000 records.There is no DML on this table
    SELECT      NVL((SELECT USER_DEFINE_TEST_NO FROM DC_TESTMST WHERE TEST_NO = SV_ID AND ROWNUM = 1 ),SV_ID) USER_D_EXAM_NO,
    (SELECT TEST_TYPE FROM DC_TESTMST WHERE TEST_NO = SV_ID AND ROWNUM = 1 ) EXAM_TYPE,
         NVL((SELECT TEST_NAME FROM DC_TESTMST WHERE TEST_NO = SV_ID AND ROWNUM = 1),'Exam Code: '||sv_id) EXAM_NAME,
         (SELECT PAT_NAME FROM OP_REGISTRATION WHERE REG_NO = HN) PATIENT_NAME,
         (SELECT PAT_AGE FROM OP_REGISTRATION WHERE REG_NO = HN) PATIENT_AGE,
         (SELECT PAT_SEX FROM OP_REGISTRATION WHERE REG_NO = HN) PATIENT_GENDER
    FROM DC_OLDRESULT
    WHERE HN IS NOT NULL AND SV_ID IS NOT NULL AND UPPER(ACTIVE) = 'TRUE'
    Should I make join DC_OLDRESULT, OP_REGISTRATION and DC_TESTMST? or The eixisting subquery is better?
    I use OP_REGISTRATION and DC_TESTMST in both query
    Thanks in advance
    Mokarem

    When your query takes too long ...

  • How do I add scripts in order to make the page compatible with all the browsers.

    How do I add scripts in order to make the page compatible with all the browsers.

    As Jon says, please be more specific about "don't line up right"
    I notice you are inserting some arbitrary <BR> tags which will cause very unpredictable displays with varying user viewports and text preferences.
    <P>In 2008-2009, Families Forward benefited 278 homeless Philadelphia families, <BR>
      including 834 children. Families Forward assisted 1,413 stranded travelers, including <BR>
      235 children. In the first 6 months of 2009-2010, from July 1, 2009 to <BR>
      January 1, 2010, Families Forward assisted 185 homeless families and 220 <BR>
      stranded travelers.</P>

  • On an ipod touch 4th generation, how do I load and sync my music from the computer to the ipod without mixing up and/or losing all of my photos which I have in categories?

    On an ipod touch 4th generation, how can I load and sync my music from my computer to the ipod without losing and/or mixing up my photos which I have put into categories?

    Finally did somethign that fixed this.  I restored my hard drive.

  • How can i load  microsoft SQL Server driver in the classpath ?

    Hi
    i need to have microsoft SQL Server driver in the classpath , how can i do that to run the following code :
    String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver";
    Class.forName(driver);
    with best regards

    Just as information, if you need to load a JDBC driver dynamically without previously knowing its name (meaning you can't add it to the classpath manually in your startup batch), the following will not work:
    // register the SQL driver as necessary
    DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());
    // connect to the DB by using the driver.
    String connString = "my_dbserver:1433;databasename=my_database";
    String strDBConnect = "jdbc:microsoft:sqlserver://" + connString;
    conn = DriverManager.getConnection(strDBConnect, userName, passwd);
    This is because the DriverManager.getConnection checks if the loaded class was loaded by the same class loader than itself. And for dynamic scenarios, you need a new classloader for the new classes.
    Above, the class will be loaded correctly, but getConnection will fail.
    This behaviour costed me several hours while developing a dialog for adding drivers dynamically, until I saw the reason.
    But a solution has been posted in the forums, which goes like this:
    // jdbcLoader is my individual class loader, you can construct it with the driver url
    Class driverClass = Class.forName(driverName, true, jdbcLoader);
    currDriver = (Driver)driverClass.newInstance();
    // problem: classes which were loaded in custom class loader are not recognized by DriverManager. So the following would fail:
    // conn = DriverManager.getConnection(...)
    Properties prop = new Properties();
    prop.setProperty("user", (String)paras.get("youruser");
    prop.setProperty("password", (String)paras.get("yourpwd");
    conn = currDriver.connect((String)paras.get("yourURL", prop); // this one works for all classloaders
    But in your case, it seems to be enough to add the file manually, as was described in previous replies...
    Regards,
    Christian Sy

  • How to restore data on new iphone without using the initial setup

    I bought a new iphone 5s today but the guy in the shop skipped the initial setup to activate the sim meaning I didn't get to restore the data through iCloud from my old phone as the wifi in the shop wasn't working. I have now got home to a wifi connection and have signed into my iCloud account but how do I restore my data? Or how do I get back to the initial setup?

    On your phone: Settings>General>Reset>Erase All Content & Settings. You can now restore your previous phone's backup to your new phone.

  • How can i make the smooth paint effect?

    Just see the below image. Can anyone suggest how do i get this effect using photoshop? or is there any other software through which i can attain this? I tried using HDR effects of photoshop as well as photomatix and lightroom. No where i could find this.

    Hi smILUv,
    Here is a tutorial that demonstrates how to do exactly that: Photoshop New Oil-Paint Filter and Skin Tone Selection Tool.
    The key is to use the Oil Paint Filter in Photoshop CS6 or Photoshop Creative Cloud (CC). To do this, go to Filter --> Oil Paint.
    This dialog box will appear and you will be able to make adjustments according to your image.
    This is the end result:
    Before
    After
    Hope this helps!
    Good luck with your project.
    Clarice

  • How to down load graphics from se78 transaction to local desk top?

    Hi Experts,
    I've a requirement on sap scripts.
    I've to copy the graphics from one system to another system.
    For this i've to download the graphic from transaction code SE78 to local desck top..Is it possible to download the graphics .
    Could you please send me the reply as early as possible.
    Regards,
    Rekha

    Hi Rekha,
    Apart from the above solution u can try the following steps also:
    1)Print the graphic first which will generate a spool.
    2)Note down the spool no. & use Tcode zpdf to convert the spool into a pdf doc which will save the file with the graphic in ur desktop.
    Regards,
    Himayan

  • How to SQL*loader to skip some columns from the source file?

    I am using oracle9i sqlldr to load some .csv files into db.
    If I want to skip the first two columns in the source file, can I do that?
    If yes, how should I specify it in the ctl file?
    Thanks
    Wendy

    Hello Dave,
    Here is a sample of what you'll need to have in your control fileLOAD DATA
    APPEND
    INTO TABLE <target_table>
    FIELDS TERMINATED BY ','
    ( column_1  FILLER
    , column_2
    , column_3
    , column_4  FILLER
    )Hope this helps,
    Luke

  • How do I load and run a sequence from the Tools menu?

    If I can build a sequence to do something special, what's the syntax required to load and run it from a menu? This must be transparent to the customer. I know how to add menu items, but the tools customize window seems to be looking for an exe.

    When you go to tools>>customise and then add in an item to appear in a menu, you need to select sequence, rather than command.
    Hope that helps
    S.
    // it takes almost no time to rate an answer

  • How do I load contacts from an exchange to the iCloud?

    I previously had an android phone and all of my contacts were loaded in to my google mail account.  I set up an exchange to have all of my contacts go to my new iPhone.  How do I now transfer the contacts in the exchange to put them in the iCloud?  Thank you.

    I wish someone would post how to make this happen. I've been looking for hours and can't seem to find out how to move my gmail contacts to itunes so I can load them on my new iPhone. Seems like this would be a popular issue to resolve, but I see no resolutions. Frustrating!!

  • How can I add graphics and other items to the content manager in PSE 10?

    I am hoping to add some jpg and png files to my content manager in PSE 10 for easy access, but can't figure out how.  Would appreciate any help so I can start scrapbooking with my new software!

    Steps from other forum post with folder locations translated to Mac
    II. Place the files in the appropriate directory.
    Copy those three files into this directory:
    "HD/Library/Application Support/Adobe/Photoshop Elements/10.0/Photo Creations/backgrounds"
    III. Have PSE recognize the new files.
    Browse to this directory:
    "HD/Library/Application Support/Adobe/Photoshop Elements/10.0/Locale/en_US"
    and delete or rename this file:
    MediaDatabase.db3
    Browse to this directory:
    "HD/Library/Application Support/Adobe/Photoshop Elements/10.0"
    and delete or rename this file:
    ThumbDatabase.db3

  • How can I load more then 1 img within the same Cell of datagrid?

    Hi
    I am using Flash CS3 datagrid component, I want to show more than one image in the same cell.
    I m using LoadCellRenderer class extends UILoader implements ICellRenderer,
    but it loads only one image in cell.
    can any one guide me?
    Thanks in advance.

    Hi, kennethkawamoto2
    I go through the on-going thread. and apply the code also but result is same,
    Data Grid inbuilt Roll over , selected, selection --  events are disappear after apply custom CellRenderer class.
    Any idea Why this happend?

  • How do I load music from a CD to the iPod?

    I want to put my CDs onto my iPod Touch.  How do I make that happen?

    If you  have iTunes 11 turn on the Sidebar.  Go to iTunes>View and click on Show Sidebar. You can also do a Crtl+S to show the sidebar.
    To import music into your iTunes library on the computer go to iTunes>Help>iTunes Help>Add items to iTunes and follow the instructions
    To sync to your iPod go to iTunes>Help>iTunes Help>Syncing your iPod....>Sync You Device and follow the instructions.

  • How to Down load Data in Application server into the Internal Table

    hi freinds,
    iam having a file in the application server.
    now i need to send the data in the file to the internal table.
    is there any Function Module?
    i need with out using the OPEN DATA SET and CLOSE DATA SET Keywords.
    is there any possible?
    Regard's,
    Ranjith.

    Hi,
    There is no other option for uploading the data from the application server to the internal table without using OPEN DATASET and CLOSE DATASET. Even if you find the FM internal logic in FM uses these keywords to read the data from Application server.

Maybe you are looking for