Trouble with threads and awt

Hello everyone I have some code that I'll like to thread, I'll like to draw two lines that prints alternatively one after the other in a blinking effect usig thrreads but the code is not functioning the way I'll like it too, please can someone take a look at it for me?
import java.applet.*;
import java.awt.*;
public class ArgueRunnable extends Applet implements Runnable{
  Thread myThread;
    int width, height;
boolean running= true;
   public void init() {
      width = getSize().width;
      height = getSize().height;
      setBackground(Color.white);
      myThread = new Thread(this);
      myThread.start();
  public void run() {
    try {
      for(;;) {
        repaint();
        myThread.sleep(33);
        repaint();
    catch (InterruptedException e) {
      return;
public void paint(Graphics g){
  update1(g);
  update2(g);
public void update1( Graphics g ) {
       g.drawLine(0, 15, 200, 15);
public void update2( Graphics g ) {
       g.drawLine(100, 15, 200, 15);
   

Hello again, thanks for sending the code, however there were a couple syntax errors, which was easy to fix, but the code still did not work the way I expected I'm still not getting the blinking effect I'm trying to accomplish, can you look at it again for me?{import java.applet.*;
import java.awt.*;
public class ArgueRunnable2 extends Applet implements Runnable{
       Thread myThread;
         int width, height;
     boolean running= true;
     boolean up1 = true;
     int x=200;
     int y=200;
   public void init() {
      width = getSize().width;
      height = getSize().height;
      setBackground(Color.white);
      myThread = new Thread(this);
      myThread.start();
  public void run() {
        while (true)
          try {
               myThread.sleep(500);
          catch(Exception e){
          if (up1==true){
               up1=false;
               if(up1==false){
               up1=true;
          repaint();
     public void paint(Graphics g){
          if (up1 == true){
                 update1(g);
               x=0;
               y=200;
          else{
               update2(g);
               x=200;
               y=0;
public void update1( Graphics g ) {
     g.setColor(Color.red);
       g.drawLine(0, 15,y, 15);
public void update2( Graphics g ) {
     g.setColor(Color.blue);
       g.drawLine(100, 15, x, 15);

Similar Messages

  • Trouble with edit and develop after november 2013 release?

    Hi,
    I can not use edit and develop after release November 2013.
    I am a user from Sweden and wonder if it only hit European data center?
    The language has also changed from Swedish to English in the modules.
    I can not access the following in Site Settings:
    Admin users
    Mobile support
    Secure Domain redirect
    Beta features
    Does anyone have the same problem?
    Regards André

    Hi Florin
    There is no errors in the browser. I tested Chrome, Safari, Firefox.
    I sent a video to your colleague Silviu Ghimposanu (Adobe Business Catalyst Support)
    He can give you more information. I submit tickets. Ticketsnr 60092, 60085
    Maybe you can solve this together.
    Regards André
    20 nov 2013 kl. 12.17 skrev Florin Carlig:
    Re: Trouble with edit and develop after november 2013 release?
    created by Florin Carlig in Business Catalyst - View the full discussion
    Hi Andre,
    Can you please record a quick video with the errors you might have in your browser, in the browser's console?
    Here's what I want (a video I did in Chrome): http://screencasteu.worldsecuresystems.com/Florin/2013-11-20_1306.swf
    You can use Jing to record this kind of videos: http://www.techsmith.com/jing.html
    Thanks and regards,
    Florin
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5857868#5857868
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Re: Trouble with edit and develop after november 2013 release?
    To unsubscribe from this thread, please visit the message page at Re: Trouble with edit and develop after november 2013 release?. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Business Catalyst at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Problem with Thread and InputStream

    Hi,
    I am having a problem with threads and InputStreams. I have a class which
    extends Thread. I have created and started four instances of this class. But
    only one instance finishes its' work. When I check the state of other three
    threads their state remains Runnable.
    What I want to do is to open four InputStreams which are running in four
    threads, which reads from the same url.
    This is what I have written in my thread class's run method,
    public void run()
         URL url = new URL("http://localhost/test/myFile.exe");
    URLConnection conn = url.openConnection();
    InputStream istream = conn.getInputStream();
    System.out.println("input stream taken");
    If I close the input stream at the end of the run method, then other threads
    also works fine. But I do not want to close it becuase I have to read data
    from it later.
    The file(myFile.exe) I am trying to read is about 35 MB in size.
    When I try to read a file which is about 10 KB all the threads work well.
    Plz teach me how to solve this problem.
    I am using JDK 1.5 and Win XP home edition.
    Thanks in advance,
    Chamal.

    I dunno if we should be doing such things as this code does, but it works fine for me. All threads get completed.
    public class ThreadURL implements Runnable
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        public void run()
            try
                URL url = new URL("http://localhost:7777/java/install/");
                URLConnection conn = url.openConnection();
                InputStream istream = conn.getInputStream();
                System.out.println("input stream taken by "+Thread.currentThread().getName());
                istream.close();
                System.out.println("input stream closed by "+Thread.currentThread().getName());
            catch (MalformedURLException e)
                System.out.println(e);
                //TODO Handle exception.
            catch (IOException e)
                System.out.println(e);
                //TODO Handle exception.
        public static void main(String[] args)
            ThreadURL u = new ThreadURL();
            Thread t = new Thread(u,"1");
            Thread t1 = new Thread(u,"2");
            Thread t2 = new Thread(u,"3");
            Thread t3 = new Thread(u,"4");
            t.start();
            t1.start();
            t2.start();
            t3.start();
    }And this is the o/p i got
    input stream taken by 2
    input stream closed by 2
    input stream taken by 4
    input stream closed by 4
    input stream taken by 3
    input stream closed by 3
    input stream taken by 1
    input stream closed by 1
    can u paste your whole code ?
    ram.

  • I am having all kinds of trouble with itunes and updating my ipad. when I open up itunes, it seems to just sit there, never going to itunes store. when I connect my ipad, I check update and it starts, but then I get this message:backup can't be saved on

    I am having all kinds of trouble with itunes and updating my ipad. I open itunes up but it doesn't do anything except open to a blank screen. I try to access the itunes store but it won't go there. When I connect my ipad, and try to update it, it starts and then I get a message that says backup cannot be saved on this computer. I have tried everything suggested to no avail. This is the 2nd or 3rd time I have had problems with itunes. Sometimes I even get a message that I am not connected to the internet.
    I have uninstalled and re-installed. Any help?

    You might not have enough space left on your hardrive.

  • Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Just bought a new iPhone and am having trouble with iTunes and App Store. I can log in to Cloud, iTunes, and app store but once I try to download, it says "Youe apple id has been disabled". I've reset my password three times and have no issue on my Pad.

    Hi FuzzyDunlopIsMe,
    Welcome to the Support Communities!
    It's possible that resetting your password multiple times has triggered this security.  Click on the link below for assistance with your Apple ID Account:
    Apple ID: Contacting Apple for help with Apple ID account security
    http://support.apple.com/kb/HT5699
    Here is some additional information regarding your Apple ID:
    Apple ID: 'This Apple ID has been disabled for security reasons' alert appears
    http://support.apple.com/kb/ts2446
    Frequently asked questions about Apple ID
    http://support.apple.com/kb/HT5622
    Click on My Apple ID to access and edit your account.
    Cheers,
    - Judy

  • I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. Can I go back to the older version? I had no trouble with that and I do not like this new version at all.

    I downloaded Firefox 4.0 and it says to re-install the toolbar but I have not been successful in doing so. I went to the forums and tried all the suggested fixes but none worked. Can I go back to the older version? I had no trouble with that and I do not like this new version at all. I tried a system restore twice and it did not fix the problem.

    I would imagine it's the MyWay Searchbar which is classified by most anti-malware scanners as adware, or even worse as spyware. I say that because I see "SmileyCentral" in your list of plugins and that's an add-on for that particular toolbar. You can disable that via Tools | Add-ons | Plugins.
    There are a number of toolbars which won't work with Firefox 4 anymore due to the enhanced protection mechanisms in the browser.
    Mozilla recommends that you only install add-ons from its own security site @ https://addons.mozilla.org/en-US/firefox/?browse=featured Generally speaking, those have all been tested and approved. The exceptions are those currently under review which are marked with a yellow banner to warn users that they haven't passed Mozilla's labs yet.

  • Trouble with Mail and Maverick

    Trouble with Maverick and Mail - contacts (groups) will not load into address bar in mail.

    Check that the mac's preferences for icloud is still connected to the proper account.  Be sure photo stream is turned on. 
    You haven't described what "trouble" your mail account has.

  • Several of us have a iPhone 6s and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Several of us have a iPhone 6plus and are having trouble with hearing and speaking at the same time when using the phone. ? The speakers seem to be too far apart? Are others having this issue? Solutions?

    Not having the problem, don't personally know anyone who is.

  • Trouble with export and import

    I am having trouble with export and import
    here is what I did...
    exp "'/ as sysdba'" PARFILE=parfile.txt
    PAFILE
    TABLES=user1.Table1
    file=Table1_1006.dmp
    LOG=Table1_1006.log
    query="where to_char(processeddate,'YYYYMMDDHHMISS') between to_char(to_timestamp('1911-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS') and to_char(to_timestamp('2011-10-06 16:46:26','YYYY-MM-DD HH24:MI:SS'),'YYYYMMDDHHMISS')"here is my log from export
    set and AL16UTF16 NCHAR character set
    About to export specified tables via Conventional Path ...
    Current user changed to user1
    . . exporting table               Table1   16019049 rows exported
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    EXP-00091: Exporting questionable statistics.
    Export terminated successfully with warnings.Then I started importing
    /database2/rdbm15> imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log
    Import: Release 10.2.0.5.0 - Production on Thu Oct 6 19:57:01 2011
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    Export file created by EXPORT:V10.02.01 via conventional path
    import done in US7ASCII character set and AL16UTF16 NCHAR character set
    . importing user1's objects into user1
    IMP-00015: following statement failed because the object already exists:
    "CREATE TABLE "Table1" ("APPROVALTRACEID" VARCHAR2(64), "REQUESTOR"
    "EID" VARCHAR2(9), "EID" VARCHAR2(9), "FIRSTNAME" VARCHAR2(32), "LASTNAME" V"
    "ARCHAR2(32), "MIDDLEINITIAL" VARCHAR2(8), "TIER" VARCHAR2(3), "JOBTITLE" VA"
    "RCHAR2(64), "JOBCODE" VARCHAR2(10), "EMPLOYEETYPE" VARCHAR2(2), "CONTRACTOR"
    "TYPE" VARCHAR2(2), "EMPLOYEESTATUS" VARCHAR2(2), "COSTCENTER" VARCHAR2(10),"
    " "COSTCENTERDESCRIPTION" VARCHAR2(50), "CONTRACTENDINGDATE" VARCHAR2(8), "A"
    "CCOUNTSTATUS" VARCHAR2(2), "LOGINID" VARCHAR2(70), "APPLICATIONGROUP" VARCH"
    "AR2(50), "APPLICATIONNAME" VARCHAR2(50), "APPLICATIONID" VARCHAR2(12), "LEV"
    "EL1" VARCHAR2(512), "LEVEL2" VARCHAR2(512), "LEVEL3" VARCHAR2(512), "LEVEL4"
    "" VARCHAR2(512), "LEVEL5" VARCHAR2(512), "PROFILECODE" VARCHAR2(50), "PROCE"
    "SSEDDATE" DATE, "APPROVERMANAGEREID" VARCHAR2(9), "APPROVERMANAGERDELEGATEE"
    "ID" VARCHAR2(9), "APPROVERT4MANAGEREEID" VARCHAR2(9), "APPROVERT4MANAGERDEL"
    "EGATEEID" VARCHAR2(9), "APPROVERAPPOWNEREID" VARCHAR2(9), "APPROVERAPPOWNER"
    "DELEGATEEID" VARCHAR2(9), "PERFORMEREID" VARCHAR2(9), "NATIONALID" VARCHAR2"
    "(30), "COUNTRYCODE" VARCHAR2(9), "PASSPORTID" VARCHAR2(20), "DATEOFBIRTH" V"
    "ARCHAR2(15), "CITYOFBIRTH" VARCHAR2(15), "VENDORNAME" VARCHAR2(50), "VENDOR"
    "MANAGERNAME" VARCHAR2(50), "VENDORMANAGERID" VARCHAR2(9), "VENDORADDRESS1" "
    "VARCHAR2(100), "VENDORADDRESS2" VARCHAR2(100), "VENDORSTATEPROVINCE" VARCHA"
    "R2(15), "VENDORCOUNTRYCODE" VARCHAR2(9), "VENDORZIPPOSTALCODE" VARCHAR2(9))"
    "  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE(INITIAL 4076863488 "
    "NEXT 1048576 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)            "
    "                   LOGGING NOCOMPRESS"
    Import terminated successfully with warnings.but I did not get rows to database2
    [server1]database2
    /database2/rdbm15> sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Thu Oct 6 19:59:17 2011
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> select count(*) from user1.Table1;
      COUNT(*)
             0
    SQL> exit
    SQL> select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for HPUX: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - ProductionEdited by: user3636719 on Oct 6, 2011 5:23 PM

    user3636719 wrote:
    Thanks for the reply...
    Old EXP IMP doesnt have capability to append the row, since you're using 10g use datapump instead. use option TABLE_EXISTS_ACTION=APPENDso my import should be like this
    imp "'/ as sysdba'" file=Table1_1006.dmp fromuser=user1 touser=user1 tables=Table1 log=imp_Table1_1006.log TABLE_EXISTS_ACTION=APPEND
    Did you look up the command line syntax and control options for imp?
    You should make it a habit that whenever anyone - especially a stranger on the web - gives you a bit of code or references a command or init parm or any some such, the VERY FIRST thin you should ALWAYS do is look it up for yourself and see exactly where and how it is used and what it means. That is how you grow beyond having to be spoon fed every little thing and become more self-sufficient.
    If you had, you would have seen that there is no TABLE_EXISTS_ACTION option for imp and seen that it is an option for impdp. And realized that exp and imp are NOT the same thing as expdp and impdp.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • TO ALL THOSE HAVING TROUBLE WITH ICHAT AND AIM ON MACBOOKS

    I've had a lot of trouble with AIM and iChat on my new Macbook, but I believe I've figured out the answers to all the problems I and others have encountered.
    Firstly, for those who's AIM continually crashes and displays the message "The application AIM unexpectedly shut down," my answer to your problem is too many sent messages. Watch the bar in the bottom left of your chat window, when it reaches red, your application will probably shut down.
    Secondly, for those experiencing difficulties with iChat, it's most likely a problem with communitcation between your wireless router and your computer. Try these steps:
    1. From the Apple menu, choose System Preferences.
    2. From the View, choose Sharing.
    3. Click the Firewall tab.
    4. Click New.
    5. From the Port Name pop-up menu, choose Other.
    If you have a Macbook, you'll probably have a TCP Port Number Bar and a UDP Port Number Bar. Try these steps:
    1. In the TCP Port Number(s) Bar, type: 5190, 5298
    2. In the UDP Port Number(s) Bar, type: 1024-5219, 5221, 5223-65535
    3. In the Description Bar, type: iChat AV
    4. Click OK
    5. Click Start above the window with your firewall settings, and make sure the box next to iChat AV is checked
    6. Relaunch iChat
    Good Luck! I hope this solves some of the problems that people have been encountering.

    Rob
    My Linksys is the WAG54G, which might be different from your WRT54G. Currently, UPnP is disabled and the Router ports are a bit of a mystery, because they're forwarded to an IP address that's outside of the current DHCP Address Range! Once I got it working, I was reluctant to change it even though it looked anomalous.
    The Firewall is on, with the iChat ports open that I listed in the previous post.
    My two regular buddies are my sons, who both use Trillian Pro on a Windows machine. Works pretty well despite occasional freezes or garbled sound.
    Hope you get sorted soon.
    Dave

  • I am having trouble with safari and most apps shutting down when I'm in the middle of stuff what do I need to do to resolve this?

    I am havering trouble with safari and apps shutting down on me all the time what can I do to resolve this problem. Thanks :-)

    Make sure you have enough free space on your iPad. With iOS 7 it is recommended that you have 15-20% of the storage space on the device free.  For a 16 GB device that is 2.4-3.2 GB free. For a 32 GB device that is 4.8-6.4 GB free. For a 64 GB device that is 9.6-12.8 GB free.
    Also try a reset. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. See if that fixes your problem.

  • I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-

    Hi, everyone.
    I'm Having trouble with OWA and Certs after the Rollup 7 for SP3 installation. any idea? update 2961522-
    after running get-OWAVirtualDirectory or test-OWAConnectivity i'm getting a message that says "OWA it's Orphan, No Metadata information can be found."
    I only have the OWA users impacted.- anywhere users, and ActiveSync are working well.-
    Thanks,
    Fabian Alberto Campo
    MCT-MCSA 2012-MCITP365-MCTS
    Fabián A. Campo H. Consultor tecnico @ IXO Ltda. MCT MCP MCTS MCSA HP-APS Cra. 67 No. 167 – 61 of 303 Bogotá, Colombia

    Hi Fabian,
    Is there any error code when user access their mailbox on OWA. Please confirm if there is no results returned in EMS when you run Get-OWAVirtualDirectory cmdlet. Also check whether there is any Event Logs related to OWA in Exchange.
    In IIS manager, make sure the OWA virtual directory is listed in the Default Web Site. In EMC, we can navigate to Server Configuration > Client Access, select server and turn to Outlook Web App tab. Then we can click Reset Virtual Directory in the right
    Actions pane to reset OWA virtual directory.
    Additionally, please restart IIS service by running iisreset /noforce from a Command Prompt window.
    Regards,
    Winnie Liang
    TechNet Community Support

  • I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    I have an iPhone and just goy I pad but no computer I'm trying to synch them together but having trouble with iCloud and I can't seem to subscribe for iTunes match from either devise

    You first have to subscribe to iTunes Match through iTunes on your computer and have your music library in iTunes uploaded/matched before you can enable it on your iOS devices (see http://www.apple.com/itunes/itunes-match/).  Without a computer you won't be able to use iTunes Match.

  • Mail: trouble with threads

    I have been having some odd problems with Mail.app for the last day or so, and I haven't had luck finding anything online that seems to indicate similar problems. I'm running Tiger (10.4.6) on a Powermac G5.
    I was fiddling with Mail last night, including adding a fourth account (gmail pop access) to check. I tried to change the icon on Mail, and the icon I mistakenly pasted in through the "Get Info" window was stuck there -- couldn't click on it to paste over it. Unable to find any similar problems online, I used Pacifist to reinstall Mail from my Tiger CD.
    Since then, though, mail has been acting pretty wacky. When I click on threads to expand them, sometimes they expand, but usually they don't. I was able to uncheck "View Messages in Threads" (and thus get to my mail) in a couple mailboxes, but not in all. Often, when I switch mailboxes, the mailbox I switch into will appear empty and even say across the top, "0 messages, 1 unread." When I close the viewer window and open a new one, it will show all my messages again and correctly indicate, "32 messages, 1 unread." When I try to quit mail, it basically freezes up -- I can use the rest of my computer, but about a half hour passed after one time I told Mail to quit and Mail was still chugging along. It seems like if I can avoid clicking on threads, I can avoid these problems for the most part -- though, as I said, it won't always let me get out of thread view.
    A few somewhat similar problems I read about online led people to suggest using Disk Utility to repair the hard disk. I tried doing that, and the things it listed highlighted in red/green included:
    Incorrect number of thread records
    Volume bitmap needs minor repair
    Invalid free block count
    Repairing volume
    The volume Tanooki could not be repaired
    Then it gave me an error message that said:
    First Aid Failed
    Disk Utility stopped repairing "Tanooki" because the following error was encountered:
    The underlying task reported failure on exit.
    Since then, I have also had trouble deleting mail. It often sits where it is, despite my attempts to delete, but it seems like it does find its way to the trash eventually; it just doesn't tell me right away, and sometimes I go back to find that it says it "hasn't been downloaded" (a problem normally associated with Panther to Tiger installs, I guess, though I did a full erase and install about a year ago).
    There are so many variables above that I'm not even sure where to start. I've received advice elsewhere that I should be using Disk Warrior rather than Disk utility, but honestly, if the disk repair issue is less pressing than the issues with using Mail, it can wait. I appreciate any input you might have to offer. Thanks very much,
    Jason
    Powermac G5   Mac OS X (10.4.6)   Running Tiger about a year now

    I used Pacifist to reinstall Mail from my Tiger CD.
    Since then, though, mail has been acting pretty wacky.
    Why am I not surprised? The version of Mac OS X on your Tiger install disks is probably earlier than the version you're using, which means Mail is probably out-of-sync with the rest of the system now.
    A few somewhat similar problems I read about online
    led people to suggest using Disk Utility to repair
    the hard disk. I tried doing that,
    You must repair whatever filesystem issues you have. If Disk Utility cannot repair them as described here:
    The Repair functions of Disk Utility: what's it all about?
    then read the "Disk Utility cannot repair the disk" section of the following article for additional guidance and links to more powerful (third-party, not free) disk utilities:
    Resolving Disk, Permission, and Cache Corruption
    The less you play with files until the issues are fixed, the better. After having fixed all filesystem issues, you should reinstall the Mail application using your Tiger installation disks as described here:
    Custom installs in Mac OS X 10.4
    If the version of the system software on your installation disks is earlier than what you're using now, then you must reinstall the appropriate system update afterwards, using the Combo installer, to bring the Mail application back in sync with the rest of the system:
    Mac OS X 10.4.6 Combo Update for PPC
    If you had installed a Security Update meant for the version of Mac OS X you're using, you'll have to reinstall it as well:
    Security Update 2006-003 Mac OS X 10.4.6 Client (PPC)
    if the disk repair issue is less pressing
    than the issues with using Mail, it can wait.
    You cannot wait. You must repair the filesystem issues before trying to fix anything else.

  • Trouble with CardLayout and actionPerformed; null exception thrown

    Hello. I'm writing my first GUI, and I am using the CardLayout class to do so. I have two panels, and a button on each that "should" navigate to the other. However, when the button is pushed on the first card, I get this exception:
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
         at emerensi_BMI.actionPerformed(emerensi_BMI.java:149)
    There are many lines after that, but I figured I would start with the first??
    Here is the code associated with that line:
    public void actionPerformed(ActionEvent e){
         if (e.getSource() == btnReCalculate){
              ((CardLayout)cardPanel.getLayout()).show(cardPanel, "one");
         } else if (e.getSource() == btnCalculate){
              ((CardLayout)cardPanel.getLayout()).show(cardPanel, "two");The last line is the actual line referenced. I am wondering if the "two" is what is null? Here is the code that it's associated with:
    String one = new String();
    String two = new String();
    JPanel cardPanel = new JPanel();
    cardPanel.setLayout(new CardLayout());
    cardPanel.add(one, Page1);
    cardPanel.add(two, Page2);
    contentPane.add(cardPanel, BorderLayout.CENTER);If I understand it correctly, the string in the (string, container) is supposed to reference its container, right?
    I'm not sure if this will make a difference, but also when the "calculate" button is pressed, I have it so that there will be calculations done with text that is entered on the first page, and the second page will display these calculations. Here is the code for that:
    } else if (e.getSource() == btnCalculate){
              ((CardLayout)cardPanel.getLayout()).show(cardPanel, "two");
         String feet = txtFeet.getText();
         String inches =     txtInches.getText();
         String pounds =     txtPounds.getText();
         float f = Float.valueOf(feet);
         float i = Float.valueOf(inches);
         float p = Float.valueOf(pounds);
         float height = (f * 12 + i);
         float math = (p * 703) / (height * height);
         String BMI = String.valueOf(math);
         lblBMI.setText(BMI);
         if (math <= 18.5){
              lblHealthEval.setText("Underweight");
         } else if (math <= 24.9){
              lblHealthEval.setText("Normal");
         } else if (math <= 29.9){
              lblHealthEval.setText("Overweight");
         } else if (30 <= math){
              lblHealthEval.setText("Obese");
         } // end else ifI have labels defined for the second panel that should get the set strings. But since the null exception is thrown right before it regarding the card layout stuff, this probably isn't an issue (yet).
    Sorry if this is verbose; just wanted to be thorough. Thanks for any and all help...

    Well... I took out as much code as I could. Here's my simplified program:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    @SuppressWarnings("serial")
    public class emerensi_BMI extends JFrame implements ActionListener{
         JLabel lblHeading1;
         JLabel lblHeading2;
         JButton btnCalculate;
         JButton btnReCalculate;
         JPanel Page1;
         JPanel Page2;
         String one;
         String two;
         JPanel cardPanel;
    public static void main(String args[]){
              new emerensi_BMI();
         public emerensi_BMI(){
              super("Body Mass Index Calculator");
              setupGUI();
              registerListeners();
         } // end constructor
         public void setupGUI(){
              Container contentPane = getContentPane();
              JPanel pnlHeading1 = new JPanel();
              lblHeading1 = new JLabel("Page 1");
              pnlHeading1.setLayout(new FlowLayout());
              pnlHeading1.add(lblHeading1);
              // north panel for page1
              JPanel pnlCalculate = new JPanel();
              btnCalculate = new JButton("Calculate");
              pnlCalculate.setLayout(new FlowLayout());
              pnlCalculate.add(btnCalculate);
              // south panel for page1
              JPanel Page1 = new JPanel();
              Page1.setLayout(new BorderLayout());
              Page1.add(pnlHeading1, BorderLayout.NORTH);
              Page1.add(pnlCalculate, BorderLayout.SOUTH);
              // page1 panel
              JPanel pnlHeading2 = new JPanel();
              lblHeading2 = new JLabel("Page 2");
              pnlHeading2.setLayout(new FlowLayout());
              pnlHeading2.add(lblHeading2);
              // north panel for page2
              JPanel pnlReCalculate = new JPanel();
              btnReCalculate = new JButton("<-- Recalculate with different data");
              pnlReCalculate.setLayout(new FlowLayout());
              pnlReCalculate.add(btnReCalculate);
              // south panel for page2
              JPanel Page2 = new JPanel();
              Page2.setLayout(new BorderLayout());
              Page2.add(pnlHeading2, BorderLayout.NORTH);
              Page2.add(pnlReCalculate, BorderLayout.SOUTH);
              // page2 panel
              String one = new String();
              String two = new String();
              JPanel cardPanel = new JPanel();
              cardPanel.setLayout(new CardLayout());
              cardPanel.add(Page1, one);
              cardPanel.add(Page2, two);
              contentPane.add(cardPanel, BorderLayout.CENTER);
              // card panel with page1 and page2
              this.setSize(500, 350);
              this.setVisible(true);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         public void itemStateChanged(ItemEvent evt) {
                 CardLayout cl = (CardLayout)(cardPanel.getLayout());
                 cl.show(cardPanel, (String)evt.getItem());
         public void registerListeners() {
              btnCalculate.addActionListener(this);
              btnReCalculate.addActionListener(this);
              // registered actions
         public void actionPerformed(ActionEvent e){
              if (e.getSource() == btnReCalculate){
                   ((CardLayout)cardPanel.getLayout()).show(Page1, one);
              } else if (e.getSource() == btnCalculate){
                   ((CardLayout)cardPanel.getLayout()).show(Page2, two);
              } // end else if else if
              // handling action events
         public void textValueChanged(TextEvent e) {
              // TODO Auto-generated method stub
    }// end main

Maybe you are looking for