Very Strange Focus problem

I've encountered a very strange focus problem that I hope someone can help me
with. In my frame, I have a toolbar and some JTextFields. When I press one of
the toolbar buttons, I do whatever and at the very end I use requestFocusInWindow()
to set the focus to one of the JTextFields. Now here's the strange part. If I don't
touch the keyboard or the mouse, I can see the caret in the JTextField as expected.
As soon as I move the mouse or touch any key, the focus changes to the next
toolbar button. Makes no sense to me. By the way, I'm running 1.4 on Windows NT.

Create a new class ToolbarButton extends JButton where you have the following method:
     * Identifies whether or not this component can receive the focus.
     * A disabled button, for example, would return false.
     * @return true if this component can receive the focus
    public boolean isFocusTraversable() {
       return false;
    }This prevents the buttons from getting keyboard focus, this makes only sense for toolbar buttons.
Cheers,
Taoufik

Similar Messages

  • Very Strange Internet Problems

    I own a MacBook Pro 15.4 Inch that I purchased about a year and a half ago. I recently upgraded to Leopard and have all the latest updates. I am from the US, and when I am home my internet works fine. However, I am on travel to Seoul, South Korea right now and am having a very strange internet problem.
    As far as I can tell, the URLs that I type in to my browser are, sparodially, not translated correctly into the webpages that they are supposed to represent. This problem is probably effective 75% of the time, and the rest of the time my internet works roughly correctly. For instance, when I enter http://www.google.com, instead of being taken to the Google homepage, I am taking to the homepage of Jammin Beats DJ Service, an obscure website about a company in northern Pennsylvania. The actual URL of this website is http://www.jamminbeats.com, but when my internet is malfunctioning, 'jamminbeats' is for all intensive purposes replaced by 'google' (that is, it applies not only to the main page, but to sub pages, so "http://www.google.com/weddings" takes you to "http://www.jamminbeats.com/weddings" and etc). For most other webpages, one of two things happens. Either I am taken to the correct page but it is displayed without any images or frames (just the html text and links), or I am taken to a blank page with the header "Under Construction", which I assume is the default for a page that doesn't exist. This is why it seems as though the URLs are simply being interpretted erroneously.
    This problem occurs when connecting both to the wireless and the wired internet at my hotel, and it occurs on both Safari and Firefox, so it is not a connection-specific or browser-specific problem. It may be a problem with the hotel's internet, and as of yet I have not had a chance to test the computer at another location. However, a colleague using an IBM computer has had no problems, and I am currently on a Samsung machine in the business center of the hotel and it is working correctly as well. I have searched extensively online for a similar problem but have come up empty handed, and more than anything, I am confused about what might be causing this problem. The strangest thing is that a fraction of the time, the internet functions normally, but it is usually roughly 15 minutes out of every hour, and eventually I am inevitably taken back to Jammin Beats.
    I am a computer science graduate but I still have no idea what would cause this problem. At first I thought it might be a hacker, but if it is, he or she has been at it consistently for 3 days now, and only seems to be targeting my computer. Any ideas or solutions would be greatly appreciated, as I have been forced to resort to the hotel's business center for checking email, doing work, etc. Thanks in advance.

    I did consider that, as I was in Beijing last week and there are a number of censored sites. However, in Korea I have had problems with very basic sites like facebook, wall street journal, google, yahoo, Korean google, my hotel's webpage, etc. Further, I have successfully gotten all of these sites to load seemingly at random, and can access them without problems on other computers. The only disconnect seems to be between my MBP and the internet, not between Korean internet and the web. I have toyed around with the network settings, and although sometimes after switching from "Automatic" to a fixed connection I get some sites to work, it usually only lasts a short time and eventually the same sites stop working. I reset my cache regularly to make sure I'm not getting sent to cached sites, but this also doesn't help. Further, my Apple Mail, Skype and AIM accounts jump between being connected and disconnected randomly as well. Again, this is isolated to my own computer, which is why I'm so confused.

  • Very strange power problem...

    Hey guys (and girls ofcourse),
    I'm having a very strange power problem with my late 2007 2.2Ghz santa rosa macbook.
    Can you guys help me determine what the problem could be?
    Here's what happened prior, when the macbook was still working. I got home from work, plugged my adapter into the wall, and it started charging. I left it on the table, and when I came back from the diner table I continued working, but suddenly noticed my macbook wasn't charging anymore. (the orange/green led wasn't lighting up but i was able to work on battery power)
    I thought it was the poweradapter, so I went to the apple store the next day to lend one to test it. That didn't work, so it's not the adapter.
    So then I started thinking it must be the magnetic DC connector. So I ordered that from the guys at ifixit, (since it's out of warranty) but I replaced it and it's not working.
    I don't think it's the logic board, because I was able to continue working until I ran out of battery power. And I also don't think it's the battery connector, because if i'm not mistaking, the macbook can run without battery as well, but mine can't anymore.
    Now I can't get any life out of my mac anymore...
    Might there be something I overlooked?
    Any suggestions are definately welcome!
    Thanks a lot.
    Timo from Belgium.

    Hi Timo,
    I think i have the same problem, my mac is not working without battery in it. and it wont charge it.
    i wrote a post here http://discussions.apple.com/thread.jspa?threadID=2105648&tstart=0
    let me know if you have fixed the problem
    thanks

  • Very strange MRP Problem

    HI ALL
    I am having a very strange mrp problem and that is
    I created a material with all mrp1and mrp2 requirement,created the info record and source list for that material.I created a reservation for that material which in turn created the deficiency when I did the MD04.I run the MD03,as per re-order point and fix lot size two Preqs created( vendor was not shown in the Preqs even though I established the source list for the material?).I change these Preqs into PurOrds and did the Gr.Every thing fine till here all changes happened in material requirement list(MD04).Now I did one more reservation and created the deficiency again and run MD03 again with a message that mrp done but this time when I went back and checked MD04, there is no Preqs shown and deficiency remained  same as was before. I did the same exercise on several material and every time I am having the same problem as the 2nd time the Preqs don't show in MD04. Please help me as I check upto my knowledge but unable to resolve this one.

    what is the control parameter of the MRP run that you select.

  • Very Strange Bluetooth Problem

    Hi There
    My mac seems to have developed a very strange bluetooth problem. When i try to connect my mighty mouse, it 'connects' then a couple seconds later disconnects, then connects and disconnects etc. during the time that it is apparently connected, the LED on the bottom of the mouse keeps flashing in the way it does when it's searching for a connection, which tells me it ain't connected at all.
    Thinking this was just a mighty mouse problem i try connect my iPhone, same problem. This time I do it with the bluetooth preferences open i notice that the status of the iPhone connection has gone funny (like it has not connected on top of the word connected in the status, one atop the other) this weirdness happens irrespective of what you connect, and only to the iPhone status, even if it's bluetooth is off.
    This weird status thing has happened before, when i was messing about with bluetooth tethering on my iPhone. So, naturally, i assume the iPhone's buggered up the system somehow. I remove it from the list of paired things and try the mouse again, no luck. I try to re add the mouse, but the pairing process doesn't complete itself before the mouse drops signal again. I can't re-pair my iPhone either for the same reason.
    how can i fix this?
    Cheers, Joe

    Hey there,
    Navigate to HD > Users > Your Account > Library > Preferences.
    Locate, and move to the Trash, this file com.apple.Bluetooth.plist.
    If still no luck, try zapping the PRAM to see if that helps. Instructions on how to do that can be found [HERE|http://support.apple.com/kb/HT1379].
    B-rock

  • Need your help with very strange Oracle problem..

    hello,
    At our office we have an oracle 10g database (don't have exact version on hand) installation that stores data for many of our applications. We are having a very strange, intermittent issue that is causing us lots of headaches lately.
    The problem is, the database will be running fine, humming along, with clients connected to it, from different hosts, different networks, and using different technologies (PERL DBI::DBD, OJDBC, etc). Every so often (at intermittent intervals, no real patterns we can discern), it seems as though the database will just hang and not respond to requests for a few seconds. Outages have ranged from 1,2,3 seconds to sometimes 20,30,40 seconds (very rarely longer than 5-10 seconds though).
    Over the last few weeks, we've done lots of work to try and rule the network out of the equation. Today, a java client i wrote that was running locally on the database host, connected via OJDBC timed out (my timeout was set to 5 seconds) running a simple query ("select sysdate from dual") at the same time as all our other remote clients.
    I'm really not sure where else to look at this point. Our DBA department says they see no errors in the database, no indication of problems anywhere. We've ruled out our backend applications and the network at this point. The java test client i wrote was running from about 5 different clients, dispersed through many different networks. They all timed out at the same time as other network clients that run via perl's dbi/dbd framework.
    Can anyone suggest what would be a possible cause for this? How could it be possible that network clients issuing "select sysdate from dual" would hang for over 5 seconds?
    Thanks in advance for any suggestions you can offer.

    I am hoping you are not in a situation where your DBA said there's nothing wrong with database, your network admin said networking issue ruled out, your system admin said OS is normal. Yet, you as end user suffer and end up trying to figure out the issue by yourself while you didn't have expertise in any of these fields.That's basically the situation we were in for a few months here. It was, to say the least, extremely frustrating. Since we wrote the applications that were suffering the most due to this db/hardware issue, naturally, we felt "responsible" for taking the ownership to track down and fix the issue (after some perseverance ,we were finally able to narrow this problem down to a database storage issue).
    After exhausting every other dba theory about DBI/JDBC/Firewalls/Networks/etc, we simply just failed over our database to some standby hardware that had some directly attached storage (as opposed to a SAN configuration like our primary db instance runs off of), and the problem has basically disappeared at this point. It's been about two weeks now. Whereas we normally see a handful of episodes a day, now we see none.
    Our system administrators are looking into our SAN now and working to optimize its performance.
    Hopefully this will put this mystery to bed. It's been a long year+ chasing this problem down and I'm glad to see it licked finally. Thank you all for your input. I've learned quite a bit about Oracle in the process and I sincerely hope our DBA team here has learned something valuable from this exercise too.

  • Very strange SQL problem

    Hellou everybody,
    I have very strange problem and I don't understand WHY.
    when i run this query:
    SELECT regexp_instr(nvl(trim('LDAPexport_20150429'), '^.*$'),'^\^[0-9]{2,2}_[A-9]{1,1}[A-9]{1,4}/') FROM dual; --ERROR
    I always getting this error: ORA-12728 - invalid range in regular expression
    but when I run this:
    SELECT regexp_instr(nvl(TRIM('LDAPexport_20150429'), '^.*$'), '^\^[0-9]{2,2}_[A-Z0-9]{1,1}[A-Z0-9]{1,4}/') FROM dual    -IT WORKS
    My client version is: 11.2.0.1.0
    DB version:
    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE    11.2.0.3.0    Production"
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    Please can somebody tell me what is the problem? Because I found this issue in production code and my collegues can run it.
    Thank YOU

    and i have created one transient field Static_cr_limit where i set default value using SQL option- which comes from another table. Can you tell us the expression you used to default this field. Also a little more details or a similified use case as ADF7 mentioned would help.

  • A very strange synchronization problem

    Hi Everybody,
    I would like to get some help regarding a strange synchronization problem that I have found. I have created a java server application and after a lot of testing I have found the following problem:
    A certain thread (Thread-A) is stuck forever on a synchornized (objX) line, whereas another thread (Thread-B) every 30 seconds performs a section which is protected by the same synchornized (objX) line.
    It seems that the objX is not held by any thread, but Thread-A is stuck forever.
    The BUG is reproducible after the server runs about 1 day.
    The server is running on Linux machine (Red Hat 7.3) with JVM 1.4 (Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)).
    I would appreciate any help.
    Thanks In Advance,
    Idan Zach

    This is not a starvation problem since Thread-B performs its job every 30 seconds. The job is very short (I have added log messages before Thread-B starts its job and after it completes the job).
    However, the priority of both threads are the same.
    Thanks In Advance,
    Idan Zach

  • Very strange Arch Problem

    I have a very strange problem with Arch. I know the title isn't very descriptive, but i don't have a quick, short way to say this:
    I love Arch. I use it as a "secondary OS" and other than the times when i'm playing with other distros to see how they've changed, i'm in Arch on my devel system and a few others....However, i still use Debian (Testing) as my desktop/laptop/primary PC OS. For the longest time (probably well over a year), i could not figure out why i could not bring myself to use Arch as my primary OS.
    About 2 days ago, i finally had a epiphany (Well...someone smacked me with a CD-R containing the source for the Epiphany Browser, but that's besides the point). The reason i can't use Arch as a primary desktop is because in Arch, i'm too tempted to play with stuff, play with new apps, break stuff, etc and like most people (probably), on my main Desktop, i want stuff to work...I don't want to be breaking things on a weekly basis.
    I was wondering if anyone else has this problem or if people could give me some advice as to how to get over it or something.

    string wrote:
    Maybe someone somewhere should create some sort of "Arch Linux updaters anonymous". "Hi, my name is jdhore and I update my system daily" (others reply:) "Hi jdhore..".
    All joking aside, come on, admit it, you don't actually have a problem, you just wanted some Arch Linux community love -- nothing wrong with that, mind you -- it's why I'm here too. "I'm afraid to buy a car because I might be tempted to drive it off a cliff." .. you'd have to have some *serious* problems in order for stuff like that to be credible.
    Don't want to break stuff: then don't. Just keep telling yourself that the cake is a lie.
    dude...That's exactly why i don't have a car...

  • Very strange screen problem (previous app leaves mark)

    I'm Danielle, i'm from the Netherlands and i'm having a very strange problem with my iPad mini (bought It August 2013).
    never had problems with my iPad, but since a few weeks i have à strange problem with my screen.
    when i open an app, for example messages, and i use it for a while, and then return to the home screen or go to another app,the messages app leaves a mark o'n the screen at the left side of my screen (an area of 2 cm from the Side). my english is not very good but im trying to describe it.
    I cant make a print screen of iT because its a problem with the screen So you dont see iT on a print screen.
    so:
    - i see a mark of THE previous screen(app) on my screen
    - first i throught iT was: in dutch we call it doorgebrand, translated in english: burn through (dont know if i translated it right). Like a old computer when you are working at a screen for to long so letters and text are printed, permanently, on the Screen (Thats why you have screen savers).
    - but: it disapears in a few minutes or if i open a black screen.
    - It's not very clear to see (The longer i used the app, The clearer the Mark) and iT has horizontal stripes
    i hope someone has experience with this problem or knows what i have to do.
    i never heard of this problem before and i cant Find iT on Google.
    kind regards,
    danielle from the netherlands

    A workaround is to turn the brightness down, it may reduce the 'burn in' less & makes it less noticeable.
    You should get in contact with Apple ASAP if you consider it bad enough to need repair, it should have a 1 year warranty. I suspect it is considered just to be how it behaves.

  • Very Strange Mailbox problem

    ./imsimta version
    Sun Java(tm) System Messaging Server 6.1 (built Apr 28 2004)
    libimta.so 6.1 (built 12:38:06, Apr 28 2004)
    SunOS mail.abc.com 5.9 Generic_112234-03 i86pc i386 i86pc
    I faced very strange problem last week regarding the mailbox. I have doubt that must be bug in that release. Previously we were using a single box for multiple domain hosted on it so mailboxes were created like user/[email protected]/INBOX expect the mail boxes for user domain matched with hostname domain. Then we separated one of our domain and mail server was created with hostname like mail.abc.com. All application and services was installed successfully and schema 2 was created at LDAP, as I was migration the users so user�s mail boxes must be migrated as well. Default user mailboxes was created on new box as user/uid/INBOX as domain part was missing so I put all the old mailboxes on the same partition where the default one was created and I manually copy over the contents from old one to new one and run ./reconstruct -m command so users wre eable to see all of their pervious mail and folders. Every thing went fine and well later I issue the ./mboxutil �o to get the orphan mailboxes; output gave me all mail boxes which have @domain part. So I create the file from that list and issue the command ./mboxutil �d �f filename. Oh no! Then seriuos problem occurs as the default mailboxes /usr/uid/INBOX deleted as well and technically they should not be because they were not present in the list. Then I create the mailboxes manually or some was created on reception of mail and I notice the user/[email protected]/INBOX is created as well associated to each user.
    So real question is if user/[email protected]/INBOX is linked with default usr/uid/INBOX then why ./mboxutil �o is giving these mailboxes as orphan in the list, if they are not link or associated then why they are created automatically while the new mail boxes created manually or reception of mail.
    I will appreciate if any body can help me with these question based on scenario presented above.

    Youve found a bug with mboxutil -o
    I would have suggested following a different path to achieve your goal.
    I would have suggested using imsbackup to capture the existing mailboxes you wanted to move, and imsrestore to populate the new server.
    the two mailboxes are NOT linked, other than mboxutil is confused.
    by running reconstruct -m, you entered them both into the database. I think this was a bad idea.
    If you were going to manually manipulate mailbox files, I would have removed the old uid@domain mailboxes before running the reconstruct -m
    I would have also run reconstruct -r afterwards. If you had done these, you would not have seen the problem at all.

  • Very very strange backflush problem during CO11N?????

    Hi Experts,
    I find a strange backflush problem during production order confirmation by CO11N,described as follows:
    When I create a production order for material A ,total order quantity is 2,means to produce 2 material A. For produce 2 material A, we need 10 material B.That means in the component view of this produciton order ,there is item material B, and the requirement quantity is 10.
    After release the production order,when doing order confirmation by CO11N,I enter 1 for material A in the "Yield to Be Confirmed" ,that means to confirm 1 material A and having done a partial confirmation (Beacause the production order quantity for A is 2) .Because 2 material A need 10 material B,so the system will post goods movement for 5 material B.
    After that ,confirm 1 material A, I change the production order,change the requirement quantity of material B from 10 to 5,and the quantity withdrawn of B is aslo 5 because backflush of confirmation 1 material A.
    And after changing the production order ,when again doing order confirmation by CO11N,I aslo enter 1 for material A in the "Yield to Be Confirmed" ,that means to confirm 1(the last material A to be produced) material A.But because I have already change the BOM of produciton order,2 material A only need 5 material B now,and the quantity withdrawn of B is 5 now.So I think the system should not backflush material B      by this order confirmation.
    But the system aslo backflush material B by this order confirmation,and the backflush quantity is 3 ,not 5,that means system automatic post 3 material B goods movement.
    Very strange, I don't undrestand why?
    I don't konw why system still automatic post goods movement backflush although I have changed the requirement quantity of one material and the Quantity withdrawn is equal to the requirement quantity?
    What is the automatic goods movement logic by production order confiramtion ,especially the backflush quantity logic?
    I aslo want to konw how I can set the backflush component quantity when doing order confirmation by CO11N in customzing through IMG?
    Where can I customzing backflush quantity in IMG?
    Edited by: Fei Liu on Apr 1, 2009 12:11 PM

    duffymo's right (but a little terse in explaining).
    Your "urgent problem" is that your SQL query is unorderd. However duffymo is also pointing out that a little additionaly work can make your code be more standard and work better/faster.
    Instead of doing what you're doing (bouncing to the end of the result set end, getting the number of messages, then walking through the result set backwards), retrieve the data in the order you want to display, using an "ORDER BY x" or "ORDER BY x DESC" clause. Use rs.next() to walk through the records and count them as you do so.
    no_of_mail = 0;
    while (rs.next())
       no_of_mail =  no_of_mail + 1;
        // process here.
    }Many drivers and DBs are designed to be much much more efficient when ResultSets are accessed "in order"; since that's the normal case, that's what is optimized the most.

  • A very strange boot problem not yet found in the User Forums

    Hi
    I know you guys are fed up with all the booting problems, but this one is the strangest one I've yet come across.
    I'm putting a PC together to function as an extra render for my 3D animations. Here is the specs as follows.
    865PE Neo2-P Mobo
    Intel Pentium 4 2.8GHz Processor
    2 x 256 DDR 400MHz Memory modules (two of the exact same make and model)
    300w PSU
    60GB HDD Maxdor
    nVidia nForce 5600
    here is the problem.
    It goes past the post, but then the system stops there. It does not go to boot at all.
    In the top of the screen below the memory testing and above the HDD and DVD Ram listings it displays as follows:
    DEL -> Bios, F12 - Boot Menu etc.
    when i press any of keys listed there, that line changes accordingly to the function I selected.
    I can get into the BIOS.
    But the Motherboard does not boot any further, it just stays there.
    I tried diffrent memory, CPU, Powersupply etc, but to no avail.
    (I disabled the QUICK BOOT options to see what problems it may give, but it lists none what so ever.)
    On the motherboard, where the DIMM2 starts and the MSI CoreCell chip, to above the IDE1 connector to the full length of the IDE connectors, it looks like the transistors/chips connections has a kind of plaque, it does not shine like the rest. Could that be the problem? How can I clean it?
    Please help, this is sort of urgent!!!!!!

    Disconnect hard & optical drives........
    Power up system.
    Do you still have freeze on post? (Start up)
    I would also concur with Bas, 300w psu no go.
    Intel P4 478 2.4 and above Northwood processors are very power hungry. You would be advise to look for PSU with at least 24amps on the +12V rail....... (Enermax 465 and some 365's or the new Corsair VX 450)

  • Very strange display problem just started

    Hi ... I'm wondering if anyone can help with a strange problem I've just started to experience.
    I'm running Win XP via Bootcamp. All had previously worked absolutely fine -- until today. Whenever I boot into Windows, I get past the welcome screen, my desktop appears for about 1-2 seconds, then -- boom -- goes black.
    Totally black screen -- no cursor or anything.
    Windows is still running, I can tell -- and if I press keys, I know they are working still (eg. can still shut down/restart through key combos). But the display is totally gone.
    I'd used Boot Camp without problems yesterday -- but the last thing I did was shut down and install updates. So presumably something in the latest windows update has clobbered the display in some way. But I have no idea what, or how to solve the problem.
    Further info:
    If I F8 boot into VGA mode, exactly the same thing happens.
    I've also F8 booted into safe mode and disabled the graphics card driver (ATI card) then rebooted into normal and still the same problem occurs.
    I'd be hugely, hugely grateful for help, as I'm at my wits' end here ... Thanks

    Ah, so you have a first-gen model from the looks of it. If I might make a suggestion, please update your tagline as follows to assist others in helping you:
    MBP (Early 2006)
    You can expand upon this as you like.
    Perhaps I wasn't reading the original post, but what version of Windows were you running at the time?
    As I recall, that model line of MacBook Pros needed an EFI firmware update to operate Boot Camp. Before the mid-2006 speed bump, these models also needed an SMC firmware patch. With the EFI update, your "Boot ROM revision" should be MBP11.0055.B08
    If you can boot to Safe Mode, try using the Add/Remove Programs or Programs and Features applet in your Control Panel to uninstall the ATI driver properly. Should that fail, search out "ATI Catalyst Uninstaller" using your favorite Web crawler. The first thing to come up should be AMD's uninstall tool, which you can then run to get rid of the driver.
    Once you've done this, reinstall the ATI software from your Leopard/Boot Camp DVD and re-run the Boot Camp 2.1 patch from the Web; this should properly update the ATI software and get you back on track.
    We would also need to rule out whether a recent update caused this issue, in which case rolling back to a prior restore point may help. You may lose documents created between the restore point time and the present, but this is normal.
    The only other possibility I can suggest is to rebuild your entire Boot Camp setup and take notes as you get back up to the point where the blackout occurred. This way, you'll have some documentation handy whether you repost here or contact Apple directly.
    Good luck,
    Nate
    Message was edited by: Nathan Alden

  • Very Strange iPhoto problem and lots of spinning beach balls!

    Hi - been using iPhoto 08 since it came out. Never a problem. About a week ago things starting going weird. It would crash and I'd get the spinning beach ball a lot. This never happened ever. It got so bad I jumped on here, followed some advice and downloaded iphoto library manager. I rebuilt my library - no change. I would double click a photo to enlarge it and it would just stop with a spinning ball. Other programs worked fine, just iPhoto would ground to a halt. Then I noticed some pics I would double click to enlarge would be corrupt. Grey half way down or black completely? They use to be fine. So I got so frustrated that I reinstalled Leopard. Everything worked fine. I even downloaded a trial Lightroom and it worked fine too with a project of mine. Tonight I decided to test iPhoto and it is still playing up. My iMac is a 24 with all latest updates. 4 Gig ram. Hard drive has 250 gig available. my iPhoto library is on an external drive which has 140 gig available. Something went wrong in the last week or so. Is there a way to search out and find a corrupt file or whatever is causing my mac to struggle using iphoto? Thanks so very much for any help.
    Rob

    Have you tried to rebuild the library? Make a backup of it first and then launch iPhoto with the Command+Option keys depressed and follow the instructions to rebuild the library. Select all the options.
    If that doesn't clear up iPhoto's problems rebuild the library with iPhoto Library Manager as follows:
    Using iPhoto Library Manager to Rebuild Your iPhoto Library
    1 -Download iPhoto Library Manager and launch.
    2 -Click on the Add Library button, navigate to your User/Pictures folder and select your iPhoto Library folder.
    3 - Now that the library is listed in the left hand pane of iPLM, click on your library and go to the File->Rebuild Library menu option
    4 - In the next window name the new library and select the location you want it to be placed.
    5 - Click on the Create button.
    Note: This creates a new library based on the LIbraryData.xml file in the library and will recover Events, Albums, keywords, titles and comments but not books, calendars or slideshows. The original library will be untouched for further attempts at fixing or in case the rebuilt library is not satisfactory .
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: iPhoto 8's (09) new option in the library rebuild pane, "Rebuild the iPhoto Library Database from automatic backup" may make this tip obsolete. We'll know when users have occasion to use it and see if that's the case.

Maybe you are looking for