Slow again(why in this case)

few days back I posted a problem chat runs slow....... someone told me to use wait and notify to remove the cpu slow issue
here is how I solved
//server
public synchronized void settxt(String txt)  throws RemoteException{
           try{
                message=txt;
                notify();
           }catch(Exception e){
                System.out.println(e);
      public synchronized String gettxt()  throws RemoteException{
           try{
                wait();
           }catch(Exception e){
                System.out.println(e);
           return message;
//client
public void design(){
     setVisible(true);
              send.addActionListener(this);
         try{
               while(true){
                     clmessage=rmiServer.gettxt();
                     if((clmessage!=null) && (!prevtxt.equals(clmessage)) ){
                          texta1.append(clmessage+"\n");
                          prevtxt=clmessage;
           }catch(Exception e)
}Now I wrote another program and ran into similar problem, but this time wait and notify doesn't seems to be working.
program 2....
The program doesn't runs slow. The gui in the client side is not shown. When i remove and paste the code inside a button action. The program runs properly but when I press the button the client stops working.
//client
public void design(){
setVisible(true);
try{
     InetAddress thisIp = InetAddress.getLocalHost();
     while(true){
          String urworkfile=rmiServer.doihavawork(thisIp.getHostAddress()); //client checks if anyone called him
               System.out.println("this is ur work "+urworkfile);
  }catch(Exception ep){
                 System.out.println("error 31 "+ep);
//server
public synchronized String doihavawork(String n) throws Exception{
         wait();
          for(int i=0;i<callclientno;i++){
               if(callclient.equals(n) ){
               return callfordfilename[i];
     return "false";
Hope you understood
thanks                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

i found the problem.... but I didn't understand why??
my main method was this:
public static void main(String []args){
              try {
               // UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel");
              } catch (Exception e) {
                System.out.println("Substance Raven Graphite failed to initialize");
              SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                   new rmiclient().design();
}If I change the main method to this it works... could anyone explain what was going wrong and how can I use the Look&Feel
public static void main(String []args){
                   new rmiclient().design();
}

Similar Messages

  • HT1491 I bought a season pass to season 6 of the Penguins of Madagascar, and it said I would get all the new episodes in the season for free. But a new episode just came out, and it wants me to pay for the whole season pass over again. why is this happeni

    Does anyone know what is going on?

    For what it's worth, you posted this in 2011, and here in 2014 I am still having this same issue. Over the last two days, I have had to unlock my apple account 8 times. I didn't get any new devices. I haven't initiated a password reset. I didn't forget my password. I set up two factor authentication and have been able to do the unlocking with the key and using a code sent to one of my devices. 
    That all works.
    It's this having to unlock my account every time I go to use any of my devices. And I have many: iMac, iPad, iPad2, iPad mini, iPhone 5s, iPod touch (daughter), and my old iPhone 4 being used as an ipod touch now.  They are all synced, and all was working just fine.
    I have initiated an incident with Apple (again) but I know they are just going to suggest I change my Apple ID. It's a simple one, and one that I am sure others think is theirs. I don't want to change it. I shouldn't have to. Apple should be able to tell me who is trying to use it, or at least from where.
    Thanks for listening,
    Melissa

  • Since upgrade to latest ios, everything is sooooo slow. Why has this happened?

    In Japan, using softbank.
    Since an upgrade to 7.0.4, everything, and I mena everything, I try to do on the iPad, is sooo slow. It's taken overy 20 minutes to download a 13.2mb app from the iStore.
    There is at least one hour a day where the internet simply doesn't connect at all.
    And before people chime in with 'this is a carrier issue', it wasn't ever a problem before the upgrade, and has been a consistent problem since the upgrade.

    How to Fix a Slow iPad
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-A-Slow-iPad.htm
    iPad running slow? How to speed up a slow iPad
    http://appletoolbox.com/2012/07/ipad-running-slow-how-to-speed-up-a-slow-ipad/
    If You Think iOS 7 Feels Slow Here’s How to Speed It Up
    http://osxdaily.com/2013/09/23/ios-7-slow-speed-it-up/
    You may have many apps open which can possibly cause the slowdown and possibly the loss of wifi. In iOS 4-6 double tap your Home button & at the bottom of the screen you will see the icons of all open apps. Close those you are not using by pressing on an icon until all icons wiggle - then tap the minus sign. For iOS 7 users, there’s an easy way to see which apps are open in order to close them. By double-tapping the home button on your iPhone or iPad, the new multitasking feature in iOS 7 shows full page previews of all your open apps. Simply scroll horizontally to see all your apps, and close the apps with a simple flick towards the top of the screen.
     Cheers, Tom

  • Arithmetic overflow error converting expression to data type int. Why in this case?

    Hi guys, it is Friday and I am really tired but..
    WITH CTE AS (
    SELECT LEN(CONS_ID) AS PROCA FROM TryCons)
    SELECT SUM(PROCA) FROM CTE
    Why I retrieve
    Arithmetic overflow error converting expression to data type int.
    Len should returns a number and so sum should work. It can be because I am trying to read  500 millions rows? But it wouldn't make sense.. 

    Len should returns a number and so sum should work. It can be because I am trying to read  500 millions rows? But it wouldn't make sense.. 
    If the average length of the field exceeds 4.29, that statement will explode. Since I don't know what's in CONS_ID, I can't say whether it makes sense or not. Although, I will have to say that from my uninitiated position, this seems like an
    accident to happen.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • HT4600 i Get a solid amber light sometimes, bUT all works fine. I have to unplug the airport extreme to reset it and then it turns green and starys that way for a week or so and then turns back to amber. why is this and how do i fix it ?

    I gat a solid amber light once a week on my airport extreme, but all works fine. I have to unplug it to reset it and then the light turns back to green and it is good for another week and then it happens again. why is this and what can i do to fix it ?

    Solid amber on an AirPort Extreme is an indication that the internal power supply is starting to act up.
    If the AirPort Extreme is in warranty, it shouid be exchanged for another AirPort Extreme.
    If the AirPort Extreme is several years old, keep any eye on things. When/if you find that you are having to reset the device several times a week, it's time to start thinking about a replacement device, as the end is near.

  • The small icons beside my bookmarks, like the F for facebook, keep disappearing when i close firefox, why is this?

    the small icons beside my bookmarks, logos for each site keep clearing when i close firefox. when i open the bookmark the logo comes back while im on the site, but when i close it again, it goes again, why is this?

    Make sure that you do not run Firefox in (permanent) [[Private Browsing]] mode.
    Using [[Clear Recent History]] to clear item when you close Firefxo can also cause problems, so you can try to uncheck items in you use that feature.

  • TS3297 i can no longer connect to itunes. a message comes up "we could not complete your itunes request. The itunes store is temporarily unavailable. please try again later. but when i use a different acct. it goes through right away . why did this start

    i can no longer connect to itunes. a message comes up "we could not complete your itunes request. The itunes store is temporarily unavailable. please try again later. but when i use a different acct. it goes through right away . why did this start happening?

    I don't know - but I am having the same problem and have not had any useful help from Apple Support.  Everything they told be to do has been done and it hasn't fixed the problem.

  • Connecting to the update has been connecting for more than 6 hourand is still trying to connect when will it finish downloading the suggested update?s, why? This update has slowed me down way too much.

    A window opened when I started that said " We strongly suggest that you update......" I did not want to but each time I turned my computer on the same window pops up with the "strongly suggest" and my computer began to run slower and stop lot. So I finally pressed the bar for more information..But never got any. My computer continued to keep "stop script" and run slow. So after several days of this I clicked on "Next" to download the update and it has been" Connecting to the update server" for over 6 hours now and still running little green boxes in a frame over and over and over. Why is this happening?

    Join the club Robert.
    My huge annoyance is how Preview converts ai, .eps and .ps files to .pdf files.
    It has progressively deteriorated from Tiger to Leopard to Snow Leopard.
    In Leopard it defaulted to saving the .pdfs to the Documents folder not the place of origin and would regularly crash if more than a few (sometimes just 2) files were opened simultaneously.
    In Snow Leopard nothing was fixed and now the names are stripped off the converted files so that they are all called Untitled.
    Apple must have received hundreds of bug reports (I diligently sent one every time Preview crashed) and several feedbacks detailing the problem, to the point I believe persecuting Designers and ruining their work has become a NEXT programmers secret objective.
    Except for a couple of minor bug fixes to do with drag & drop in Preview, I am puzzled where the so-called improvements in Snow Leopard really benefit user.
    Peter

  • Why does the top button always brake why as my screen decided to pop off why is the back of my case bending when I have never dropped it why dose this shity phone keep sending text messages as picture messages this is the worst phone av ever had!!

    Why does the top button always brake why as my screen decided to pop off why is the back of my case bending when I have never dropped it why dose this shity phone keep sending text messages as picture messages this is the worst phone av ever had!!

    I know a lot of people with iphone 5 and have never heard them complain about top button always brake and screen that decides to pop off or the back of their case is bending.
    That sounds like a phone that has been dropped a numerous times.

  • I have songs i ripped from cds on my computer.  after a while, some of them have started to skip? why does this happen? do i have to rip them all over again?

    i have songs i ripped from cds on my computer.  after a while, some of them have started to skip.  why does this happen?  do i have to rip them all over again?

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • Your message was not sent. Tap "try again" to send this message. Why do i get this error?

    your message was not sent. Tap "try again" to send this message. Why do i get this error?

    Hi babychriss,
    Thanks for visiting Apple Support Communities.
    There are several possible reasons why a message might not send. I'd recommend starting with the troubleshooting steps in this article:
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/ts2755
    Regards,
    Jeremy

  • My iMessages and FaceTime are offline.. When I try to activate my apple id account.. it says The server encountered an error processing registration. Please try again later. What should I do in this case?

    My iMessages and FaceTime are offline.. When I try to activate my apple id account.. it says The server encountered an error processing registration. Please try again later. What should I do in this case?

    Hey radyslav,
    There's an article that applies to your situation, I'd follow the steps within here:
    FaceTime, Game Center, Messages: Troubleshooting sign in issues
    http://support.apple.com/kb/TS3970
    Take care,
    Delgadoh

  • After I Repair The Permissions On My Mac Pro, Then I Verify The Permissions And They Have To Be Repaired Again And Again.  Why Does This Happen All The Time.   Please Reply,  James

    Hi, 
    After I Repair The Permissions On My Mac Pro, Then I Verify The Permissions And They Have To Be Repaired Again And Again. 
    Why Does This Happen All The Time. 
    Please Reply, 
    James

    As long as the report ends up with 'Permissions repair complete' then, as far as permissions go, you are fine. You can ignore the various statements in the report:
    Permissions you can ignore on 10.5 onwards:
    http://support.apple.com/kb/TS1448
    Using 'should be -rw-r--r-- , they are lrw-r--r--' as an example, you will see the that the permissions are not changed, but the | indicates a different location. This is because an update to Leopard onwards changed the location of a number of system components.
    Poster rccharles has provided this description of what it all means:
    drwxrwxrwx
    d = directory
    r = read
    w = write
    x = executeable program
    drwxrwxrwx
    |  |  |
    |  |   all other users not in first two types
    |  | 
    |  group

    owner

  • Why I receive started 2 hours the message that I must put my password on Iclod for my apple id and when I put the password I receive the message that the paswor is not god!What can I make in this case?Please help me

    why I receive started 2 hours the message that I must put my password on Iclod for my apple id and when I put the password I receive the message that the password is not god!What can I make in this case?Please help me

    Hi it sounds like a scam delete Email
    bsydd uk

  • The last 3 or 4 times I have tried to access my account, it has told me it has been deactivated and I have to reset each time, or give credit card info again.  Why is this happening and how do I stop it?

    The last 3 or 4 times I have tried to access my account, it has told me it has been deactivated and I have to reset each time, or give credit card info again.  Why is this happening and how do I stop it?

    You must contact iTunes support to get the problem resolved.
    http://www.apple.com/support/itunes/contact/
    If there is a problem with your account or payment info, you cannot
    download anything (including free apps or updates) until the matter
    is resolved.
    In countries where the iTunes Store only sells apps, the accepted payment methods are Visa, MasterCard, and American Express. Other payment types such as gift cards, store credit, monthly allowances, ClickandBuy, and PayPal are not accepted. Depending on your App Store country, prices may be listed in your local currency, US Dollars, or Euros.    http://support.apple.com/kb/HT5552

Maybe you are looking for