What the heck is going on with my CODE?

Ok.. so the program encrypts and decrypts text files.. you input the paths for which file to read and where to export it to..
the encrypt code and decrypt code is EXACTLY the same only like ONE line of code is different.. the difference was one had "encrypt()" the other had "decrypt()"
I changed it back to the original "encrypt()" and it worked fine.. which doesnt make any sense because the encrypt() and decrypt() methods are exactly the same only one encrypts the stuff while the other decrypts..
This is what the ActionListener looks like:
String command = group.getSelection().getActionCommand();
          String tempString = inputTimes.getText();
          File inputPath = new File(inputFile.getText());
          File outputPath = new File(outputFile.getText());
          if(inputPath.isAbsolute())
               if(inputPath.exists())
                    if(inputPath.isFile())
                         if(outputPath.isAbsolute())
                              if(!outputPath.exists())
                                   try{
                                        outputPath.createNewFile();
                                        FileWriter writeFile = new FileWriter(outputPath);
                                        if(tempString.length() == 0)
                                             String theText = readFile(inputPath);
                                             writeFile.write(dataTool.encrypt(theText, "1", command), 0, theText.length());
                                             outputFileStatis.setText("Success");
                                             writeFile.close();
                                        else
                                             String theText = readFile(inputPath);
                                             writeFile.write(dataTool.encrypt(theText, tempString.substring(0), command), 0, theText.length());
                                             outputFileStatis.setText("Success");
                                             writeFile.close();
                                   } catch(IOException e) {
                                        System.out.println(e);
                              else
                                   outputFileStatis.setText("Failed: Cannot overwrite files");
                         else
                              outputFileStatis.setText("Failed: Path's not absolute");
                    else
                         outputFileStatis.setText("Failed: Cannot encrypt directories");
               else
                    outputFileStatis.setText("Failed: File does not exist");
          else
               outputFileStatis.setText("Failed: Path's not absolute");
And then the method readFile() which is used in the above code:
public static String readFile(File f) throws IOException
          StringBuffer sb = new StringBuffer();
          BufferedReader in = new BufferedReader(new FileReader(f));
          String line = "";
          while((line = in.readLine()) != null) {
          sb.append(line).append(' ');
          in.close();
          return sb.toString();
So why does it not work when I change the encrypt() part to decrypt() ???

ok.. so..
when the Encrypt File button is pressed it runs this part if it passes the IF statements:
try{
                                        outputPath.createNewFile();
                                        FileWriter writeFile = new FileWriter(outputPath);
                                        if(tempString.length() == 0)
                                             String theText = readFile(inputPath);
                                             writeFile.write(dataTool.encrypt(theText, "1", command), 0, theText.length());
                                             outputFileStatis.setText("Success");
                                             writeFile.close();
                                        else
                                             String theText = readFile(inputPath);
                                             writeFile.write(dataTool.encrypt(theText, tempString.substring(0), command), 0, theText.length());
                                             outputFileStatis.setText("Success");
                                             writeFile.close();
                                   } catch(IOException e) {
                                        System.out.println(e);
which encrypts the text in the file specified to look something like:
tittemfek2ueehseo2yt2sistdi2s2i2ww2sta2satsfsaoo22r0222e2orrrjr
then when the decrypt file button is pressed it is supposed to run the same thing only
encrypt is changed to decrypt
and it runs the readFile(File) method listed in the first post to read the files.
it runs the encryption perfectly, but when it decrypts it the command prompt fills with errors and scrolls several times..
there is no problem with the decrypt method, it has to be the readFile(File) method but I dont know how to fix it..

Similar Messages

  • What the heck is going on with TV Shows?

    Wow the descriptions of the shows are non-existant before you buy them, are listed as "albums" (bug?) and what the heck is going on with shows taking forever to make it to iTunes after they air??? It's killing the experience for me... three days to a week? Who's messing up, ALL the networks or Apple?

    All I can tell you is Apple is dependent on the networks to provide the files. If the network isn't prompt in providing said files, there is not a lot Apple can do.

  • What the heck is going on with my Virtual Memory??!!

    I'm not really sure why but when I check activity monitor and see my VM it says i'm using anywhere from 230-270 gigs of virtual memory. This is literally fresh out of restart when it says this much and never changes. I go through and check every process I see runing and create a quick estimate of the virtual memory being used, and it's definitely not over 10 gigs if even 5; honestly I think it's listing between 1-2.
    What the heck could be causing this? Verified HD and came up clean. Should I be concerned? I'm not gonna lie this macbook isn't running the best it used to be. Watching videos, whether mp4, mkv, youtube, is pretty laggy. I'm aways sure to close all other processes to to try and maximize video performance, not that it helps much. I'm considering a fresh install and recovery via timemachine.

    I excluded the list of fonts from step 4 as I'm a graphic design major and have well over a thousand...and I didn't want you to burn up your scroll wheel or rub the tips of your fingers off with the amount of scrolling you'd have to do had I included them .
    Command 1:
    com.displaylink.driver.DisplayLinkDriver (1.7)
    com.rogueamoeba.HermesAudio (3.0.1)
    com.Cycling74.driver.Soundflower (1.5.1)
    com.bresink.driver.BRESINKx86Monitoring (7.0)
    com.logmein.hamachi (1.0)
    foo.tun (1.0)
    foo.tap (1.0)
    Command 2:
    com.autodesk.backburner_server
    com.autodesk.backburner_manager
    net.openvpn.client
    com.vmware.launchd.vmware
    com.themha.airlock.daemon
    com.rogueamoeba.hermes
    com.logmein.hamachi
    com.google.keystone.daemon
    com.displaylink.usbnivolistener
    com.bombich.ccc
    com.autodesk.wiretapgateway
    com.autodesk.sw_start
    com.autodesk.sw_server
    com.autodesk.sw_probed
    com.autodesk.sw_dbd
    com.autodesk.sw_bwmgr
    com.autodesk.dl_mpd
    com.autodesk.backburner_start
    com.autodesk.adlm
    com.adobe.versioncueCS4
    Command 3:
    com.wacom.pentablet
    com.lexmark.hostregister
    com.lexmark.hostinfoupdater
    com.lexmark.hbnlistener
    com.google.keystone.root.agent
    com.displaylink.useragent
    com.adobe.CS4ServiceManager
    com.google.GoogleContactSyncAgent
    com.adobe.ARM.930da3ce175de4e82bd3cdf1dd8571f74bd3b6a7236bc94bfc00f6e9
    com.adobe.AAM.Scheduler-1.0
    Command 4:
    /Library/Components:
    XiphQT.component
    /Library/Extensions:
    ham.kext
    /Library/Frameworks:
    .DS_Store
    AECore.framework
    AEProfiling.framework
    AERegistration.framework
    Adlm.framework
    Adobe AIR.framework
    AudioMixEngine.framework
    Cairo.framework
    Compressor.framework
    DSPPublishing.framework
    DivX Toolkit.framework
    EWSMac-GC.framework
    EWSMac.framework
    Frameworks
    FxPlug.framework
    GLib.framework
    Gtk.framework
    HPDeviceModel.framework
    HPPml.framework
    HPServicesInterface.framework
    HPSmartPrint.framework
    Jackmp.framework
    Jackservermp.framework
    MacFUSE.framework
    MediaServerAPI.framework
    Mesh3DS.framework
    Mono.framework
    NyxAudioAnalysis.framework
    OpenVPN.framework
    Panda.framework
    PluginManager.framework
    ProMetadataSupport.framework
    Python.framework
    Qmaster.framework
    TSLicense.framework
    WacomMultiTouch.framework
    XSKey.framework
    libZJBIG.dylib
    libxml.framework
    /Library/Input Methods:
    /Library/InputManagers:
    Safari AdBlock
    /Library/Internet Plug-Ins:
    AdobePDFViewer.plugin
    CANONiMAGEGATEWAYDL.plugin
    CANONiMAGEGATEWAYLI.plugin
    CouponPrinter-FireFox.plugin
    CouponPrinter-Safari.webplugin
    DivXBrowserPlugin.plugin
    Flash Player.plugin
    Flip4Mac WMV Plugin.plugin
    Flip4Mac WMV Plugin.webplugin
    Google Earth Web Plug-in.plugin
    JavaAppletPlugin.plugin
    Quartz Composer.webplugin
    QuickTime Plugin.plugin
    Silverlight.plugin
    Unity Web Player.plugin
    Unused
    WacomNetscape.plugin
    WeatherScope.plugin
    flashplayer.xpt
    googletalkbrowserplugin.plugin
    iPhotoPhotocast.plugin
    npdivx.xpt
    npgtpo3dautoplugin.plugin
    nsIQTScriptablePlugin.xpt
    /Library/Keyboard Layouts:
    /Library/LaunchAgents:
    com.adobe.AAM.Updater-1.0.plist
    com.adobe.CS4ServiceManager.plist
    com.displaylink.useragent.plist
    com.google.keystone.agent.plist
    com.lexmark.hbnlistener.plist
    com.lexmark.hostinfoupdater.plist
    com.lexmark.hostregister.plist
    com.wacom.pentablet.plist
    /Library/LaunchDaemons:
    com.adobe.versioncueCS4.plist
    com.apple.aelwriter.plist
    com.apple.qmaster.qmasterd.plist
    com.apple.remotepairtool.plist
    com.autodesk.adlm.plist
    com.autodesk.backburner_manager.plist
    com.autodesk.backburner_server.plist
    com.autodesk.backburner_start.plist
    com.autodesk.dl_mpd.plist
    com.autodesk.sw_bwmgr.plist
    com.autodesk.sw_dbd.plist
    com.autodesk.sw_probed.plist
    com.autodesk.sw_server.plist
    com.autodesk.sw_start.plist
    com.autodesk.wiretapgateway.plist
    com.bombich.ccc.plist
    com.displaylink.usbnivolistener.plist
    com.google.keystone.daemon.plist
    com.logmein.hamachi.plist
    com.rogueamoeba.hermes.plist
    com.themha.airlock.daemon.plist
    com.vmware.launchd.vmware.plist
    net.openvpn.client.plist
    org.macports.Privoxy.plist
    /Library/PreferencePanes:
    DivX.prefPane
    Fan Control.prefPane
    Flip4Mac WMV.prefPane
    MacFUSE.prefPane
    PenTablet.prefPane
    VersionCueCS4.prefPane
    /Library/PrivilegedHelperTools:
    com.bombich.ccc
    /Library/Privoxy:
    privoxy
    /Library/QuickLook:
    BrushViewQL.qlgenerator
    GBQLGenerator.qlgenerator
    LogicQLGenerator.qlgenerator
    VMware Fusion QuickLook.qlgenerator
    iWork.qlgenerator
    /Library/QuickTime:
    AppleHDVCodec.component
    AppleIntermediateCodec.component
    AppleMPEG2Codec.component
    AppleProResCodec.component
    CanonMJPEGAVI.component
    CanonMJPEGAVIDec.component
    CanonText.component
    DVCPROHDCodec.component
    DVCPROHDMuxer.component
    DVCPROHDVideoDigitizer.component
    DVCPROHDVideoOutput.component
    DVCPROHDVideoOutputClock.component
    DVCPROHDVideoOutputCodec.component
    DesktopVideoOut.component
    DivX Decoder.component
    DivX Encoder.component
    FCP Uncompressed 422.component
    Flip4Mac WMV Advanced.component
    Flip4Mac WMV Export.component
    Flip4Mac WMV Import.component
    Google Camera Adapter 0.component
    Google Camera Adapter 1.component
    IMXCodec.component
    MayaIFF.component
    /Library/ScriptingAdditions:
    Adobe Unit Types.osax
    /Library/Spotlight:
    GBSpotlightImporter.mdimporter
    LogicPro.mdimporter
    Microsoft Office.mdimporter
    iWork.mdimporter
    /Library/StartupItems:
    BRESINKx86Monitoring
    CoreDuoTemp
    FanControlDaemon
    /etc/mach_init.d:
    /etc/mach_init_per_login_session.d:
    /etc/mach_init_per_user.d:
    Library/Address Book Plug-Ins:
    SkypeABDialer.bundle
    SkypeABSMS.bundle
    Library/Fonts:
    alot...
    Library/Frameworks:
    Library/Input Methods:
    .localized
    Library/Internet Plug-Ins:
    Move_Media_Player.plugin
    doubleTwistWebPlugin.bundle
    fbplugin_1_0_1.plugin
    fbplugin_1_0_3.plugin
    Library/Keyboard Layouts:
    Library/LaunchAgents:
    com.adobe.AAM.Updater-1.0.plist
    com.adobe.ARM.930da3ce175de4e82bd3cdf1dd8571f74bd3b6a7236bc94bfc00f6e9.plist
    com.apple.AddressBook.ScheduledSync.PHXCardDAVSource.8F30A2BB-9699-4472-B47A-69D 7FA822C70.plist
    [email protected]
    com.apple.FolderActions.enabled.plist
    com.apple.FolderActions.folders.plist
    com.google.GoogleContactSyncAgent.plist
    Library/PreferencePanes:
    .c4dsetup
    .c4dsetupCINEMA 4DF51A2E69
    Airlock.prefPane
    Connect360.prefPane
    Perian.prefPane
    Library/QuickTime:
    AC3MovieImport.component
    Perian.component
    Command 5:
    Connect360Helper, DockSpaces, MiniUsage, OpenVPN Connect, Bowtie, SpacieHelper, Rowmote Helper, Dropbox, BambooCore

  • What the Heck is going on with 10.5.2? . . . Part 1

    Part 2: Is a huge list of all kinds of weirdness that follows this, but . . .
    For the longest time 10.5.2 was flawless and I thought +"I'm home!"+ Then my machine started freezing at sleep and then the Part 2 of things started to happen that I am seeing many others doing through. Then the other day the Energy Control Panel just disappeared. I looked at it earlier in the day and later I was restoring my laptop from a partition on my main machine and wanted to make sure that it didn't go to sleep/freeze during. So I went to the Energy Panel to make sure it was set it to "never" and it was not there. Just Plain Gone. Just earlier I have it set just to make the screens dim and I can make it sleep manually when I know I will be done for a while. So I saw it and it was there. But a restore via TM of the ES PP the screens didn't dim, and the screen saver that is turned off, came on. What!
    This install of 10.5.2 was done so very carefully and more meticulously than any install in my life. Been using Macs since the late 80's. There are just a couple of apps installed that have been there and all worked great for many weeks. Then all of a sudden freezes and then System Prefs Panels start disappearing. What's next . . . . Oh that's Part 2. I need to get this Sleep thing dealt with before I transcribe my notes. But I will. I know, +"Oh, Joy!"+
    I spend more time messing with keeping this thing running now than using it. I have to make a recommendation for a start up organization that has an obscenely large budget and I can spec anything I want. But if this is the way OSX is going to be, I'll go XP. At least all the complications will be expected and potentially addressed.
    Anyone having the same problems or found the culprit? Please no "mines fine comments". Remember this is a place to find fixits, not comments for comments sake.
    Any assistance will be greatly appreciated by me personally and Apples Third Quarter Profits.

    TheGuyintheProjectionBooth wrote:
    That's what this was. A very meticulous virgin reinstall, more so than any other install I have ever done in 18 years. With the worst results of any of them. And then what's the use of TM then? IF you can't recover any file you need. Supposedly the file being from a previous and "cleaner" install, it should be safe and clean. If not and not advisable to pull form, then why TM at all?
    Time Machine is meant to restore your own documents or a full system restore. You are not supposed to replace random parts of the operating system using Time Machine or any other means. You don't know what caused your problems. You don't know if your problems are specific to a specific user on your machine.
    What is the point of doing a meticulous virgin install and then hacking it up?
    It's obvious that there are still major holes in 10.5.x. Of which I am hearing from many third party vendors that I am trying to get updates from. So if they see it, they're there. I am very curious to see how large 10.5.3 will be. I read the list of fixes is quite large and getting larger.
    Does this mean you will do what so many others have done and hope that 10.5.3 is going to magically fix your problems? Guess what - if your machine is flaky, installing an update is only going to make it worse.
    As soon as I can get at least level with the tide, I will post Part 2, I have to sort through my notes, which is a list of all the things that have gone wrong.
    Until then . . . . arm yourselves. I know you'll want to retort.
    Perhaps not. If you're going in and hacking up your machine, it is pointless to try to diagnose problems due to any number of unknown problems you may have caused yourself.
    Also, I took the time to read your post and ask some very specific questions to which you didn't bother to respond. Why would I respond to your Part 2 if you wouldn't meet me halfway on Part 1?

  • What the heck is going on with my scripts?

    I've been using some home brew scripts to do some video work (Easier to input all the file names and recheck it to make sure everything's right and then just type
    ./encode
    then to type the whole command into the command pompt.  I have been having some issues with creating these scripts though.  I have been getting a bunch of back up files showing up in konqueror, and recently I tried to create a script, and it wouldn't show up in konqeuror at all.  It was there, I could access it in kate and kwrite, but it wasn't listed in a konqueror browser window.  What's going on????
    Thanks,
    Nathan

    Sounds like an issue with Konqueror, not with your scripts. A more appropriate topic might get you a better answer.

  • What the heck is going on with my iPhoto, duplicate, triplicate, quad

    i think my iPhoto is possessed, all of my pictures seem to be growing by number.  I have up to six copies of the same picture.  Have about 4000 originals, but it's showing over 17,000 pictures.  Now most of them are extremely blurry and pixelated.  So I can't run a duplicate finder for fear it will delete the one good copy I have.    Note:  I'm  running Yosemite with all the latest Firmware upgrades. 

    Im not 100% sure what additional info I can provide,
    How do you transfer the Photos from iPad and iPhone? Are you using Photo Stream or connect them to a USB port?
    Which OS version are having on your mobile devices?  Do you have iCloud Photo Library (Beta) enabled?  (If you are using iCloud Photo Library, deleting the photos from the devices on import does no longer work)
    Do you notice duplicates in the Import panel, when you connect the iPhone, iPad to USB? Keep the Camera.app on the devices open, when you import, then the Photo TSream photos will not show as well.
    Now most of them are extremely blurry and pixelated.
    That suggests, that some an iPhoto library got imported to iPhoto; the pixellated photos are probably thumbnails. Look at one of the pixellated photos in the Info panel in iPhoto. Are their keywords, e.g. Photo stream, and do the pixellated versions show EXIF data like camera model, lens, or are they without meta data?

  • RIM, what the heck is going on with my PB??

    Here are some of the issues:
    It shuts off by itself at 50% of battery!!
    When a new tab is opened, a message pops up asking "how to name the file" (it's been happenning on the last few days).
    Everytime i turn on my PB, native mail program prompts me for my account's passwords (Yahoo, Outlook...).
    It has been frustrating, please help me.
    Thank you.

    1 - See what others say. I don't think this is a good sign. If you are still under warranty, my advice is contact support.
    2 - I have had this happen and it usually corrects on its own. In fact blackberry.com was doing this yesterday, but not now. If it is happening on several websites, then I don't know.
    3 - Same thing. This happens to me with one of my emails. Usually opening the settings page and simply saving fixes it. Sometimes I have to enter the passwords again and save. But it happens again after a few days or a week or two. Don't know that there's anything to do to prevent it.
    - Ira

  • What the heck is going on with ITunes?!  I'm still getting Error 7.  I have lost all my music, books and podcasts...so angry, What the heck is going on with ITunes?!  I'm still getting Error 7.  I have lost all my music, books and podcasts...so angry

    I've installed and reinstalled several times.  Any ideas?

    First of all, why did you say yes to Nero Back up before researching what it does with files already on the HDD? When I install Nero, the Back Up is the first thing I disable, it is a nagging pain, there are much better backup programs available. There are several file recovery programs out there to recover deleted files, that is, if that is what happened. Also, if you haven't overwritten the files, so you should be able to find them.

  • What the heck is going on with the S3 Jelly Bean update

    While I do think it is ridiculous that we don't have JB for the S3 yet, I think I'd rather have them fix the f'n radio reception problems on the S3.   Not sure the Verizon has so many issues with the S3 when it is one of the best selling phones for all other carriers.

    Verizon doesn't care....otherwise we would be getting these updates at a more reasonable time rather than hearing "its coming soon". We have been hearing "coming soon" since the beginning of October. Now we are almost at the middle of December...and every other country and carrier has the update minus US Cellular. Which would not surprise me if US Cellular gets the update before Verizon. Just my two and half cents.

  • What the heck is going on with my podcast settings

    All of a sudden, my preferences don't work. No matter how I set them - which is to DO NOTHING and Keep All Episodes when podcast becomes available - the episodes automatically download (which I don't want) and I can't figure out how to get them to get off my ipod but stay in my itunes! This is new. I've subscribed to ONE podcast for the last year. Never a problem. Until a recent upgrades knocked out my entire podcast library and left me with this problem. Help!

    All of a sudden, my preferences don't work. No matter how I set them - which is to DO NOTHING and Keep All Episodes when podcast becomes available - the episodes automatically download (which I don't want) and I can't figure out how to get them to get off my ipod but stay in my itunes! This is new. I've subscribed to ONE podcast for the last year. Never a problem. Until a recent upgrades knocked out my entire podcast library and left me with this problem. Help!

  • What the heck is going on with Safari 7.0?

    Ever since I upgraded to Mavericks, Safari is just sucking out my RAM and slowing my machine.
    I use FreeMemory Pro to keep an eye on RAM usage. iMac 2.8 i5, 16GB RAM.
    Until I upgraded to Mavericks, my system would almost always have about 8 to 10GB unused RAM. I usually have these apps open: Safari, Mail, iTunes and sometimes iPhoto. (Previously iPhoto was a RAM hog but that doesn't seem to be a major issue now.)
    After the upgrade I noticed the system slowing down and the available RAM dropping dramatically.
    A little while ago my available RAM dropped to 256MB!!! This is shocking ...
    As soon as I quit Safari, available RAM climbs up to 8 to 10GB available.
    The culprit clearly is Safari.
    Anyone else have the same experience? Any way to fix this? I'm using Chrome now to post this.

    Thank you Carolyn. Turning off plug-ins did fix the problem.
    Not the ideal solution as I do like to use some of those plug-ins. I did try to isolate them to figure out which one was causing the problem ... but in the end I couldn't identify any one plug-in.
    I've moved away from Safari now ... because I do like the four plug-ins that I use, to improve browsing.
    Pity that Safari won't work well with them ... I do prefer Safari to Chrome, but had to move.
    Appreciate your directing me to the cause of the problem.
    Thank you, again.

  • ARRRRGGG - so what the heck is going on with my e-...

    Please help before I throw my 5800 XM through the window
    For reference I'm not on a data plan, I'm using WiFi at home and at work.
    I set up the phone to retrieve e-mail from my Juno account, and for a while it all worked fine.  Now it seems to work at home, but not at the office.  Here's what I'm experiencing at the office:
     1) If I'm not connected to the wifi I and try to retrieve mail I get two messages stating "Unable to find WLAN"
    2) If I connect to the wifi (and verify by calling up a web page) and try to retrieve messages it will try to connect to my mailbox and return a message "No new mail" even though I know that there is.
    3) I can try 5 times and it may indeed get my mail on the 6th try, then when I sync again the mailbox on my phone is emptied  of all messages and it again says "No new mail".  Then it won't work for the next several syncs
    4) I have alternately set the e-mail connection settings access point to "Default" and specified the name of the WiFi and both settings work sometimes, but not always.
    So much for all the talk that Windows Mobile is so unstable, this thing is driving me crazy !!! 

    Please help before I throw my 5800 XM through the window
    For reference I'm not on a data plan, I'm using WiFi at home and at work.
    I set up the phone to retrieve e-mail from my Juno account, and for a while it all worked fine.  Now it seems to work at home, but not at the office.  Here's what I'm experiencing at the office:
     1) If I'm not connected to the wifi I and try to retrieve mail I get two messages stating "Unable to find WLAN"
    2) If I connect to the wifi (and verify by calling up a web page) and try to retrieve messages it will try to connect to my mailbox and return a message "No new mail" even though I know that there is.
    3) I can try 5 times and it may indeed get my mail on the 6th try, then when I sync again the mailbox on my phone is emptied  of all messages and it again says "No new mail".  Then it won't work for the next several syncs
    4) I have alternately set the e-mail connection settings access point to "Default" and specified the name of the WiFi and both settings work sometimes, but not always.
    So much for all the talk that Windows Mobile is so unstable, this thing is driving me crazy !!! 

  • What the heck is going on with Finder?

    Guys, I don't even know where to begin... something is seriously wrong with Finder. No, it's not Google Drive. It's something bigger than that.. I'm talking big. Windows are closing, programs are freezing, it's getting crazy. How much longer can this go on for? Apple has to know about it, right?

    It's something bigger than that.. I'm talking big ... Apple has to know about it, right?
    They do now. Thanks!

  • What the heck is going on with ImageIcon

    Hi,
    When running the following code :
    public class Main {
         public static void main(String[] args) {
              String t = null;
              try {
                   ImageIcon i = new ImageIcon(t);               
              } catch (Exception e) {
                   System.out.println("exception");
              } finally {
                   System.out.println("finally");
    the app hangs saying:
    Uncaught error fetching image:
    java.lang.NullPointerException
         at java.io.FileInputStream.<init>(Unknown Source)
         at java.io.FileInputStream.<init>(Unknown Source)
         at sun.awt.image.FileImageSource.getDecoder(Unknown Source)
         at sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
         at sun.awt.image.ImageFetcher.fetchloop(Unknown Source)
         at sun.awt.image.ImageFetcher.run(Unknown Source)
    So, the thread waits for the image to be loaded, even if it's not possible to load it.
    Just wondering if this is an intended behaviour or not...
    Cheers

    So, the thread waits for the image to be loaded, even
    if it's not possible to load it.
    Just wondering if this is an intended behaviour or
    not...Andah... maybe add something like
    if(t!=0){*code*/}
    That may prevent it from trying to load something that doesn't exist.
    Regards,
    Guido

  • What the heck is going on with update 6.1.3  its awfy

    Battery life is shocking and phone keeps going back to home screen, keyboard is dodgy as well!!

    I've noticed problems too. mine keeps shutting down completely.

Maybe you are looking for