Getting screen to repaint() before long operation

greetings all,
lately, i've been having a heck of a time getting my JFrame to repaint itself before i start a long operation. In this case, i'm generating a little network traffic. What i'd like to do is be able to update a label on my JFrame so that text is displayed telling the user that a long operation is starting, and then start the operation. However, no attempt i've made so far works. i've tried calling repaint() on multiple objects in a row, i've tried calling repaint() on the same object many times in a row....nothing seems to work.
Can anyone shed some light on this?
peace
...alan lew

I find it very disappointing that Java can;t do a simple task like this. I guess i won;t be including this status message into the app i'm writing at this point. That is, unless someone has a definitive answer that doesn;t involve re-writing code for a simple graphics update.
I, too, had the same problem when I just started out with Swing stuff. I had a status bar that needed updated immediately. I solved it by taking good advantage of Java's multithreading abilities, and ever since then I've never had the problem.
I don't think it comes down to Java not being able to do it, but rather to a fundamental design flaw in your program. If you would have thought about the status problem BEFORE writing it, then the threading stuff would have been no problem. Please don't take that the wrong way, I'm not knocking your program or competence or anything. I'm just saying, that some times when you've never done a particular thing before, then you don't really think about problems like that because you don't know they exist, and therefore when they come up, you're pretty unprepared and it's a pain in the ass.
Granted, it seems like paintImmediately() should work, or at least there should be some way to do that. But, the fact remains that paint() doesn't work and it may come down to you having to rewrite part of your code.
I still have the original code for my program that had the status bar problem. If I can figure anything out, I'll let you know. If you figure out how to do it without threads, post it here.
Good luck,
Jason

Similar Messages

  • Cannot get screen sharing to work long distance...

    I set up an AIM account for my mother-in-law so that I could remote screen-share her MacBook and help her with learning how to use it and trouble shoot it (it's a Late 2008 Aluminum MacBook hand-me-down from my wife).
    I've set up the account, but cannot get remote screen sharing working. Screen sharing works fine over bonjour, but no go over the internet using AIM. I can control my wife's MBA from my iMac and vice-versa, but neither of us can control her MacBook. When we choose "Ask to share users screen...", we get the pop up window stating "Waiting for response from user", along with the spinning gear icon. If she chooses "Share my screen with...", the pop up window appears on our Macs and we're able to choose accept. But then the pop up window switches to "User would like you to share his or her screen" and just sits there. Nothing happens. On her screen, she gets the message "waiting for response from user" and nothing else happens.
    After a long wait, my screen will say, "There was a communication error during your chat. Messages didn't receive a response from..." and gives me the option to report the details to Apple.
    What am I doing wrong?
    Her MacBook is running Mavericks, as are our machines.
    Message was edited by: pmpknetr21
    Message was edited by: pmpknetr21

    Hi,
    @mac.com and @me.com ID works as AIM Screen Names  (you add them like they are and existing name) but only if you are using Messages 7 or 8 plus later versions of iChat 6 in Lion.
    You should be able to use the Apple Issued IDs in Mavericks.
    If you using an AIM Registered name try using it without the @AIM.com or @AOL.com suffix (User Name only)
    As AIM can "read" the Apple Database it will think the Apple IDs exist already but may not tell you that is the reason you can't re-register them.
    Can you post the info being sent to Apple here ?
    However stop the log after about 10 lines of the Binary Images (I will not need it all).
    9:28 pm      Sunday; August 3, 2014
    ​  iMac 2.5Ghz i5 2011 (Mavericks 10.9)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad

  • HT1420 old computer no longer operable, how do I get the contents of m iPod onto new compter

    I have an older iPod, and the computer I had it associated with is no longer operable at all. How do I get the music on my iPod onto my new computer?

    follow the steps given here...
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • Photoshop 12 screen has gotten too long on OS X, cannot get to the bottom to reduce, how do I make it smaller?

    Photoshop 12 screen has gotten too long on OS X, cannot get to the bottom to reduce, how do I make it smaller?

    Stuck Windows in Photoshop Elements on a Mac | Barbara's Sort-of-Tech Blog

  • Should my screen is cracked, how long does it take to get it fixed on apple repair shop?

    Should my ipad screen is cracked, how long does it take to fix it on apple repair shop?

    We are all end-users like you and not Apple employees or agents. Time to repeir depends of the repair facility. Contact several to see which has the best turn-around time for such repairs.

  • Not Connected Exception during long operation

    Hi all. My program does a very long operation - more than an hour. (import records from excel file). I create a thread, the operation runs there, and put af:poll on the page for changing progress indicator. So it's ok. The trouble is that I get
    Exception in thread "Thread-90" oracle.jbo.NotConnectedException: JBO-25200: Application module is not connected to a database.
         at oracle.jbo.server.DefaultTxnHandlerImpl.handleRollback(DefaultTxnHandlerImpl.java:145)
         at oracle.jbo.server.DBTransactionImpl.doRollback(DBTransactionImpl.java:4872)
         at oracle.jbo.server.DBTransactionImpl.rollback(DBTransactionImpl.java:2429)
         at kz.kklife.insis.modules.policyImport.ImportRunner.run(ImportRunner.java:124)
         at java.lang.Thread.run(Thread.java:619)
    after some time.
    With default jbo.ampool.timetolive (3 600 000) it throws exactly in an hour after starting developer server. So I changed it to 7 200 000. But I got an error on a production server in a random time - because I don't restart it just before importing, of course.
    So, is there any settings for weblogic not to disconnect transactions? (I get a transaction object through getDBTransaction() method of application module) I tried to uncheck "Ignore In-Use Connections" option, but it didn't help.

    Timo Hahn wrote:
    As far as I understand the framework, a transaction begins directly after the last commit or rollback.
    So I assume that the timeout is reset at this point. I would not make sense doing it otherwise. As you already mentioned if you set the timeout to e.g. 2 hours and you get the am instance from the pool after 1:59,59 of initializing the transaction it would be stale before you had any chance to do something with it.Oh. I'll try to commit new transaction just before import, thanks. Need I do something like
      DBTransaction transaction = ADFFacesUtils.getApplicationModuleForDataControl("ImportAppModuleDataControl").getDBTransaction();
      transaction.commit();
      // -- do long running stuffor you mean some another way to commit?
    I would set up a different configuration for this long running transaction (an other AM configuration) where I increase the timeout value to a higher number. Then use an instance from this configuration for the long running stuff only.I use another AM, only for long running stuff. But users can do import simultaneously.

  • I get the error message in QuickTime "operation stopped the operation is not supported for this media" most times when I try and export an .AVI file as something else (.m4v). I have not touched the file in any way (no trimming, clipping or other editing)

    I get the error message in QuickTime "operation stopped the operation is not supported for this media" most times when I try and export an .AVI file as something else (e.g. .m4v). I have not touched the file in any way (no trimming, clipping or other editing), all I want QuickTime to do is export the file in a compressed format. Bizzarely, if I shutdown and open QuickTime many times I can occasionally export a clip as another format (maybe one in 10 times). I have seen that other users have had a similar problem after clipping files in QuickTime but this seems to be a slightly different bug in that all I do is open the file and then try and export the file as is - either way, this is a very annoying bug

    @Z_B-B, thank you for taking the time to respond to my cry for help. However, the link you supplied does not address the problem: I am not trying to export from Final Cut Pro to QuickTime, I am trying to export from QuickTime to the rest of the world (like people's iPhones and Ipads) in .m4v format (so I am not emailing my freinds such huge files).
    If I were to spend hundreds of Dollars on a copy of Final Pro I could export directly from there and not have to bother with QuickTime, but I do not take enough video clips to justify the cost. I must say that I never had any of these problems before I decided to switch from Snow Leopard to Mountai Lion.

  • Long operations session killing

    hi
    i want to remove a particular session which one is running a long query.ie.some user a running a query which one is taking too much time to run.how to kill such session??
    regards
    Edited by: you on May 19, 2010 6:02 AM

    To find SQLs running for more than 5 Seconds:
    col username for a30
    col machine for a30
    select s.sid, a.sql_text, s.username, s.machine
         from v$sqltext a,
         v$session s
         where s.sql_address = a.address
         and s.sid in (select sid
    from v$session
    where LAST_CALL_ET > 5
    and status = 'ACTIVE'
    and username = 'USERNAME' )
    order by s.sid, a.piece;
    check for long operations :
    SET LINES 150
    COLUMN sid FORMAT 9999
    COLUMN serial# FORMAT 9999999
    COLUMN username FORMAT A30
    COLUMN machine FORMAT A30
    COLUMN progress_pct FORMAT 99999999.00
    COLUMN elapsed FORMAT A10
    COLUMN remaining FORMAT A10
    SELECT s.sid,
    s.serial#,
    s.username,
    s.machine,
    ROUND(sl.elapsed_seconds/60) || ':' || MOD(sl.elapsed_seconds,60) elapsed,
    ROUND(sl.time_remaining/60) || ':' || MOD(sl.time_remaining,60) remaining,
    ROUND(sl.sofar/sl.totalwork*100, 2) progress_pct
    FROM v$session s,
    v$session_longops sl
    WHERE s.sid = sl.sid
    AND s.serial# = sl.serial#
    AND sl.time_remaining > 0;
    the below query will tell on which object lock has been acquired , if you know the object name on which long operation is running . then after getting sid you can kill it
    select session_id "sid",SERIAL# "Serial",
    substr(object_name,1,20) "Object",
    substr(os_user_name,1,10) "Terminal",
    substr(oracle_username,1,10) "Locker",
    nvl(lockwait,'active') "Wait",
    decode(locked_mode,
    2, 'row share',
    3, 'row exclusive',
    4, 'share',
    5, 'share row exclusive',
    6, 'exclusive', 'unknown') "Lockmode",
    OBJECT_TYPE "Type"
    FROM
    SYS.V_$LOCKED_OBJECT A,
    SYS.ALL_OBJECTS B,
    SYS.V_$SESSION c
    WHERE
    A.OBJECT_ID = B.OBJECT_ID AND
    C.SID = A.SESSION_ID
    ORDER BY 1 ASC, 5 Desc
    Edited by: PrafullaNath on May 19, 2010 3:15 PM
    Edited by: PrafullaNath on May 19, 2010 3:16 PM
    Edited by: PrafullaNath on May 19, 2010 3:17 PM

  • What actually gets written to tape by long-term protection?

    I've been reviewing our long term recovery goals and am confused by the Customize Recovery Goal screen. The only documentation I can find for it only gives brief descriptions and is for 2010, I'm using 2012 R2.
    Customizing Recovery Goals for Long-Term Protection
    http://technet.microsoft.com/en-us/library/ff399209.aspx
    I notice it says 'Back up every:' under the recovery goals, not 'colocate'. Does this mean that it will take a backup and write it directly to tape instead of writing the recovery points on disk to tape?
    The specify long-term goals screen in the Modify Group wizard says 'All long-term tape-based protection uses full backups.' Does this mean the file and application recovery points from the short term protection aren't written to tape?

    Hi,
    <snip>
    What actually gets written to tape by long-term protection?
    >snip<
    It really depends if you are using short-term to disk or not.
    1) You are using short-term to disk, long term to tape (D2D2T)
           In this configuration the last successful disk based recovery point is written to tape. 
           The data is read from DPM recovery point and copied to tape.
    2) You are using short-term to tape and long term to tape (D2T2T)
         The first LT recovery goal is a full backup taken from the protected server.
          Other LT goals are tape copies from lesser goals, so you need multiple tape drives.
    As noted - all long term tape backups are full backups, no incremental backups are possible.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT]
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • 10.8.4 Screen Brightness Keys No Longer Work

    I ran updates this morning and I assume it updated to 10.8.4 from the app store updates tab.
    After this update and booting back up the screen brightness keys no longer work. F1 and F2 keys do nothing and they worked fine before the update.
    Anyone else experiencing this? If so know a way to fix it?
    Thanks
    Patrick

    I have been having the same issue and even with updates have continued to have the problem. I was able to find a chck box under the keyboard settings that I never noticed before. When checked it only allows you to use the function keys on the top of the keyboard when pressing the fn (function) key. Simply unchecking this (not sure how it got checked in the first place) solved the issue immediately.

  • Where do i get the qualifying product before installation of the new one

    where do i get the qualifying product before installing the cs6 product

    What product are you trying to install?  It sounds as if you have purchased an upgrade?  If that is the case then you would need to have a qualifying previous product in order to install successfully.  What software are you upgrading from?  Finally what operating system are you using?

  • While Charging get screen of death.  SHUT DOWN BY HOLDING Key

    Hi This is my first time posting a question regarding my MBP a couple of time's now I've left my computer on and the charger plugged in I've left it there and instead of stopping charging when it's full I think it's not sometimes I come back and the screen says warning shut down computer by holding down power button for 6 seconds. I unplug the charger it's super hot and the mac is past boiling point. I mean it runs hot sometime but when the problem has happened it's really hot. Also I never hear fans
    1)Has this happend to anyone?
    2)I did a hardware test and got an error 4SNS/1/40000000: 'TmOP'
    Thank you.

    Well, I had my MBP sent out for repair they changed the logic board and the thermal unit also the keyboard. And it also came back with some scratches and also on the left side at the seam where your arm/wrist rest is loose so it squeeks..plus is was dirty.
    Called Apple Care got someone who said they couldn't replace it because it was past 14 days, so I didn't like that answer and then they gave me to a product specialist. He said the they needed a resonable number of attempts to fix it. I ask him what a resonable number was? He couldn't answer. So each time you send it back your without your computer for 10 days. I said just send me a new one. He said he couldn't but if after some undetermined number of returns then he could. So I said just give me a refund. And that he could do. So I'm returning my MBP and going to wait for the second generation of MBPs that don't run so dam hot. Unfortunatley you have to get a little extra firm to have them do anything.
    Oh yeah, he also said if he sent out a new one that it could have the heat problem to. And that the Engineers are working on it but DO NOT have A SOLUTION YET.
    It's a bumer cause I like the computer. They should make it big enought not to have a heat issue and also to fit a dual layer burner for $3K. I don't need the thinnest computer just one that works comfortably on the desk in the lap etc. without excess heat issue, airport issues, and high pitched noises.
    Apple dropped the ball on getting this to market before the bugs were worked out.
    So I will wait, check these disucussion boards from time to time until things are running smoother. Good luck to you and don't cave into these folks trying to tell you the heat is ok or the noise, etc....you paid top $$$ expect the best and don't take any bull**.
    Peace,
    Time for a Margarita.

  • I keep getting my browser is no longer supported. how can I upgrade from mac os x 10.6.8

    I keep getting my browser is no longer supported. how can I upgrade from mac os x 10.6.8 . Any help would be appreciated

    Open the Mac App Store and try downloading Yosemite. If you get told it's incompatible, choose About this Mac from the Apple menu, check if the computer has at least a Xeon or Core 2 Duo(not Core Duo) CPU and 2GB of RAM, and if it does, click here and order a download code for Lion 10.7.
    Back up your data and check your applications for compatibility before upgrading. In particular, Mac OS X 10.7 and newer don't support PowerPC programs such as versions of Microsoft Office prior to 2008.
    (124406)

  • More on Updating Swing Components during long operations...

    After reading thru a few posts here, I've come to the conclusion that what I need is going to be much more difficult than I'd planned. Neverthess i'll try to explain...
    I have a JFrame which contains a simple JLabel and JProgressBar. While I am performing a long network operation, I am making calls to a Thread class (which contains the above components) to update the JFrame indicating the current status. Normally I have no problem with this as the paintImmediately method suffices. However, when I call this long operation from the constructor of a larger, more complex JFrame, the GUI remains unresponsive (despite the plethora of paintImmediately calls that are executed) until the user clicks in the threaded progress box.
    Unfortunately the SwingWorker solution will not work for me as I need to be completely backwards compatible with JDK 1.3 (supporting Mac OSX 10.X). Oddly enough tho, I don;t get these problems when I use the same code in JDK 1.1.8 on Mac OS9.
    Any ideas?
    thanks!

    heh...looks like it was a simple thing afterall :)
    The JDialog (not JFrame) just needed focus.
    heh...is it friday yet? ;)

  • Upgraded to ADSL2 now get slower speeds than befor...

    Hello
    Well last Tuesday my line was upgraded to the 20mb ADSL2 and I was looking forward to some increase in bandwidth (even though before the upgrade my line was pumping 7mb most of the time which I was happy with)
    Now for some reason I am getting slower speeds than before I upgraded. Something tells me I should not have bothered with the amount of effort it took to get the upgrade.
    I cant understand why my DL is saying 3000+ and before upgrade it was reading 7500+
    I have not reset my hub manually all disconnections have been done automatic.
    Here are my router stats and I have been reading a few posts and I am hoping someone can shine some light on this for me:
    BT Home Hub - DSL Connection
    DSL Connection
    Link Information
    Uptime:
    2 days, 0:36:48
    Modulation:
    G.992.5 annex A
    Bandwidth (Up/Down) [kbps/kbps]:
    687 / 3,347
    Data Transferred (Sent/Received) [MB/GB]:
    177.59 / 3.69
    Output Power (Up/Down) [dBm]:
    9.5 / 0.0
    Line Attenuation (Up/Down) [dB]:
    14.5 / 28.0
    SN Margin (Up/Down) [dB]:
    12.5 / 19.0
    Vendor ID (Local/Remote):
    TMMB / IFTN
    Loss of Framing (Local/Remote):
    0 / 0
    Loss of Signal (Local/Remote):
    2 / 0
    Loss of Power (Local/Remote):
    0 / 0
    Loss of Link (Remote):
    0
    Error Seconds (Local/Remote):
    17 / 0
    FEC Errors (Up/Down):
    0 / 0
    CRC Errors (Up/Down):
    0 / 97
    HEC Errors (Up/Down):
    0 / 96
    Line Profile:
    Fast
    Software version: 6.2.6.H
    Solved!
    Go to Solution.

    That's good to hear
    Enjoy the speed
    -+-No longer a forum member-+-

Maybe you are looking for