Default Button: switched to last focussed, but want Windows behavior, how?

In a JDialog, if I add components and set one to be the default button, plus
use the Windows L&F, I expect the Windows L&F behavior, that is, as long
as I tab along buttons, an Enter will activate a button if it has focus, but if I
tab to another component, the desired default button should be visually marked (darker edge)
and an Enter should activate it.
In Plugin's JRE 1.3.1, this is not the case. The default button is reset to the last button that had
the keyboard focus.
In a JVM 1.2.2, the same code produced the expected result!
The bug db listed a few solutions, one of them was to use a Focus Manager to
track focus and then "manually" reset the default button each time the focus is not on a button.
Anyone out there with a more details on this solution?
Or perhaps, there is a better solution than tracking focus events manually?
Sylvia

Found a solution myself, which at least works for windows l&f:
make all buttons non-default capable (setDefaultCapable(false)), except for the one button, that is to be the default button. This has the unfortunate effect, that a non-default button, which has input focus, does not react to to ENTER, but the ENTER is sent to the default button instead.
So must add a keyboard action to handle the ENTER:
KeyStroke keyStroke = KeyStroke.getKeyStroke ("ENTER");
ActionListener action = new ActionListener(){
public void actionPerformed() {getMyButton().doClick();}};
getMyButton().registerKeyboardAction (action, keyStroke, WHEN_FOCUSED);
That did it for my case.
Sylvia

Similar Messages

  • I want to replace the hard drive on my IMac but want to know how to transfer from the time machine external hard drive to the replacement drive?

    I have reached capacity on my IMac hard drive.   It is a 250 GB drive.   I have an external drive backing up using the time machine utility.  My question is once I replace the HD on the IMac, how do I load the new drive with the back up from the external drive?

    So many possibilities.
    I am not an expert, but I have learned this much is doable:
    Buy an external enclosure to re-use you old drive.
    Buy a new external drive at least as large as as your intended new internal drive.  Make it self-powered.
    Download CarbonCopyClone (free download, relatively small).
    Make a CCC clone of the original disk on the new external disk
    Install the original disk in the external enclosure.
    Install the new disk in the main system.
    Boot from that new external drive that has the carbon copy clone.  CCC will be installed on it and it will be bootable.
    Use CCC on the external to directly clone back to new drive you install in the main system (the "bootable" flag will copy).
    NOTE THAT AT NO TIME IS YOUR ORIGINAL DISK BEING OVERWRITTEN IN THIS PROCESS.  YOU CAN ALWAYS GO BACK AND REINSTALL IT.
    Step 1 makes your old disk resuable as a spare copy for "anything".
    Step 2 gives you something to use as CCC for after the recovery process.
    Step 3 gets the software needed for cloning
    Step 4 makes a bootable saved copy of your current system
    Step 5 shifts your old disk to a usable place
    Step 6 positions your new disk
    Step 7 boots your existing install of OSX (just from a different drive)
    Step 8 puts your original install on your new disk.
    Now you have a bootable larger hard drive, and a bootable copy on a drive large enough to save all you can store on your new internal drive.  And you have your old disk to use for "anything".
    Now you have TM backup in one place, and CCC backup in another.
    Two backups is better than one, and one of your backups is bootable in case of system failure.

  • I have PS and LR but want Premier.  How much more is this per month?

    I don't understand how these apps are bundled.  If I want Premier on top of PS and LR, how much does this cost?  Do I piggyback on my existing membership?  Thanks!

    The subscriptions fall into 3 plans:
    PS+LR (standalone special deal - no connection to other plans)
    Single App subscriptions
    Full Cloud
    I suspect you'd either have to take out a Single App subscription for Premiere Pro on its own or a full Cloud membership (and cancel your PS+LR subscription).

  • My old computer died, but I have a utility and have been copying files and transferring them to my new computer. I have copied the bookmark files, but want to know how to install them on my new system (Windows 7) . . . how do I do that?

    The file I copied is the "profiles" file. If that's not the correct one, please point me in the right direction.
    Thanks.

    Is there no ANSWER TO THIS PROBLEM?

  • I am getting ready to wipe a PC clean but wanted to know how to get the activation code for the Version of Adobe reader that is currently installed on the PC?

    I do not have the activation code for this PC and need to know how to get the software loaded back on it after a clean install of the OS and other programs.

    If you use any additional subscription services to Adobe Reader, they are activated with your Adobe ID & password.

  • Focus loss? bad modality? wrong default buttons?

    Hi Forté Users,
    Can I ask if anyone has experienced any of the following problems?
    We are using Forté 3.0.G2 on NT4.0 SP3 using Compaq Deskpro PCs.
    1. Occasionally, the modality is lost when a modal child window is
    displayed for the first time.
    2. Sometimes the closing of a child window doesn't correctly return the
    focus to the parent window. This may be related to using the keyboard to
    "click" the default button rather than actually clicking with the mouse, but
    I'm not sure of that.
    3. Also the default button is set correctly when a child window closes,
    but the window indicates that a different button is the default button. The
    highlighting is on the wrong button.
    All these problems happen in both distributed and standalone runs.
    I ask because I don't want to waste time with Forté Support if they aren't a
    generic problem.
    Thanks,
    Nick.
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Troubleshooting Update:
    If I first import my project using the RH7 WYSIWYG as default
    editor, the Russian ToC is produced. I can then change the default
    editor, (say, to Word2003 or FrontPage) and the Russian ToC is then
    preserved. Very strange!
    That still leaves a css problem. On import of a Word file,
    the styles belong to some unknown (default?) stylesheet, and
    editing and correcting is an intolerable job. Why is the Word
    template not being imported to become the RH7 topic template?
    Your assistance much appreciated.

  • Changing Language for Default Buttons

    Hi,
    I have been searching Google and this forum for info on how to change two very specific settings in Captivate 7. We are creating a quiz in French.  At the end of it, a window pops up and says a few things in English, like "You have left some questions unanswered," "Submit all," etc.  We have figured out how to change most of these, but there are two buttons, Yes and No, which we cannot figure out how to change.  Does anyone know where this might be done?

    Hi Lilybiri, they appear at the very end of the quiz, after hitting the Submit button on the last slide but before calculating the final score.  I am attaching a screenshot.  I can change the text to French--just haven't done it yet--but not these Yes and No buttons.  I can't find those settings anywhere.  Changing the system language and reinstalling is not an option.

  • My iphone5 has a yellow screen. Turned it off last night but its still there. What should I do?

    I'm at the beach right now then when I was taking pics, the yellow screen appeared. Turned it off last night, but its still there.

    How long have you had your phone? Because if you've had it a long time, the battery in the phone might of died on you. Or have you dropped it in water, snow, from high up? All those things could of disconnected something internally in your phone, or permentaly damaged the internal hard drive its self, or the sims card.

  • Keep my phone when contract ends want to know how sim cards are

    WHEN MY CONTRACT END IN NOVEMBER want to keep my phone but want to know how much sim cards are

    Hi, 
    Your phone belongs to you so when your minimum term ends you will revert to monthly contract if you are on contract now. 
    Thanks, 

  • Hi.. i bought an ipad from frys store last week. but when i use it, the home button has some strange sound when i push it. if i want to exchange at apple store, it could be

    hi.. i bought an ipad from frys store last week. but when i use it, the home button has some strange sound when i push it. if i want to exchange at apple store, it could be

    Does Target accept returns from something you bought at Wal-Mart?
    Bring it back to Fry's.

  • Need multiple 'MAIL' Icons.   Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain

    Have two mail accounts and i want to keep them separate but want to EASILY switch back and forth from the main screen instead of going through, Settings, Mail, and selecting account. Major pain the butt.  This has been a request from Apple users for many years.    it's great you can now combine all emails into one, but some people want them kept separate and have separate icons on the main page.   They could easily do this by having one "MAIL" account as white and another red.  Or put MAIL 1 and MAIL 2.    Or an actual label that the mail accounts are called on the ICONS!!  
    Help!

    eshghoolak wrote:
    ...I could switch back and forth between accounts while in the mailbox, with one button.  I think that is what you are referring to?  Whoever said it's just a simple switching - you obviously haven't had the pleasure of using an Android device.  It's not that quick to go back and forth - definitely not efficient...
    Not that it matters a lot, Android vs iPhone interface is largely a matter of personal preference and what you know... I'm not sure which one you're saying is not efficient...
    In any event...
    I currently have two email accounts setup.  My iPhone main page Mailbox settings reads:
    Mailboxes
    Inboxes
    All Inboxes
    Gmail
    [email protected]
    Accounts
    Gmail
    [email protected]
    I wish there an efficient way to move back and forth while in the "Inbox" between accounts.  Also, Why does one gmail account show as "Gmail" and another as the actually address?
    The names are based on the names you gave the accounts when you set them up.
    Settings>Mail, Contacts, Calendars.
    Tap the account you want to re-name. Go to the "Description" field and put in what ever you want.
    Second, there is no way to quickly choose a bunch of emails to delete. I have to manually go into each one and move it to the Trash folder.
    If you tap the edit button in the upper right while in mail, you can select multiple items to move, delete or mark (flag).
    I don't want any of the condescending remarks, that I've read here and in other forums.  I'm honestly looking for a solution, which I think you are too!  One thing I realized is that iPhone users in these forums are really defensive and quick to say "that's how it is, live with it, if you don't like it go away"  Um...the only thing that tells me is you are pretty bitter and have kept telling yourself that, to force yourself to like your device.  I prefer to express my issues, and find solutions.  There is ALWAYS a solution...
    I think what you will find is that many people here, myself included, tend to get a bit short with people who start off with attacks or whining about how something has been asked for for years and should be easy, rant about things that have already been beaten to death multiple times in the forums, talk about how much better Android or BB are at something (really... if it's that much better, why did they buy an iPhone to begin with?), etc., or continue to ask questions that could easily be answered with a simple search, or even just by looking back at the last dozen posts to the forum, half of which probably asked the EXACT SAME question.
    I don't think any of us go out of our way to be rude or uncivil.  That said, attacking the people who are attempting to help you is much more likely to generate a response of 'if you don't like it, go away', than it is to generate something that will be truly helpful.

  • I've just downloaded the add-on - Quick Locale Switcher but don't know how to access it because there doesn't appear to be a button for it on the Firefox toolbar?

    I've just downloaded the add-on - Quick Locale Switcher but don't know how to access it because there doesn't appear to be a button for it on the Firefox toolbar?

    With any extension, look at the add-on page for that item in Mozilla Add-ons: https://addons.mozilla.org/en-US/firefox/<br />
    *Answers can usually be found there: https://addons.mozilla.org/en-US/firefox/addon/1333/<br />
    *Also the developer's home page for the extension (the link is on the above page): http://www.captaincaveman.nl/firefox-extensions-quick-locale-switcher.aspx<br />
    *Also see if there is a forum on the developer's home page (there is for this one): http://forum.captaincaveman.nl/default.aspx?g=topics&f=12

  • I just switched to Lion from SL, and am regretting it deeply, is there anyway to switch back to SL but still keep lion on your hard drive until you want it again?

    I just switched to Lion from SL, and am regretting it deeply, is there anyway to switch back to SL but still keep lion on your hard drive until you want it again?
    I hate to have paid for it and have it go away. Help please!

    Start by creating a second partition on your hard drive:
    To resize the drive do the following:
    1. Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    After the main menu appears select Disk Utility and click on the Continue button. Select the hard drive's main entry then click on the Partition tab in the DU main window.
    2. You should see the graphical sizing window showing the existing partitions. A portion may appear as a blue rectangle representing the used space on a partition.
    3. In the lower right corner of the sizing rectangle for each partition is a resizing gadget. Select it with the mouse and move the bottom of the rectangle upwards until you have reduced the existing partition enough to create the desired new volume's size. The space below the resized partition will appear gray. Click on the Apply button and wait until the process has completed.  (Note: You can only make a partition smaller in order to create new free space.)
    4. Click on the [+] button below the sizing window to add a new partition in the gray space you freed up. Give the new volume a name, if you wish, then click on the Apply button. Wait until the process has completed.
    You should now have a new volume on the drive.
    It would be wise to have a backup of your current system as resizing is not necessarily free of risk for data loss.  Your drive must have sufficient contiguous free space for this process to work.
    Install Snow Leopard on the new partition:
    Boot from your Snow Leopard Installer disc. Proceed with reinstalling OS X. Be sure to choose your new partition as the target destination.
    Download and install the Mac OS X 10.6.8 Update Combo v1.1 update. Any additional updates can be installed using Software Update.

  • HT1414 i downloaded the ios7, now i cant swipe to unlock my screen, when i go to itunes and click restore iphone it says i have to get into iphone and switch off location services, but i Cant as i am unable to unlock iphone. And my lock button is broken..

    i downloaded ios7 my iphone 4s now isnt working i am unable to slide to unlock my iphone, yet my lock button at the top of my phone is broken and has been for sometime so i have been using the accessibility feature to lock and switch off my iphone i can still click on this button and i can still swipe up and down but i am unable to swipe too unlock and enter my passcode.. so i am thinking somethings wrong with the software? when i try to restore my iphone in itunes i am unable to as ios7 needs for location services to be switched off in iphone but i cant do this cos i cant get into my iphone, can someone please help me,,, please,,,

    IF the device does NOT have a cracked screen or liquid damage and is in hardware warrenty.. apple can repair/replace the device for free.
    Call apple tech to find out what your croverage is for fixing that button
    IF IT DOES then you will pay a fee for repairing

  • Is there another way i could turn my phone on? it wont turn on or show me the battery screen to show its charging. i already tried to hold the on and home button at the same time but it does not want to turn on. please help?

    is there another way i could turn my phone on? it wont turn on or show me the battery screen to show its charging. i already tried to hold the on and home button at the same time but it does not want to turn on. please help?

    Device Not Recognised
    For PC
    http://support.apple.com/kb/TS1538
    For Mac
    http://support.apple.com/kb/ts1591

Maybe you are looking for

  • New to the MAC world - can you suggest a new drive for my G4?

    Hi, I'm a newcomer to the MAC world after using Windows for years. I'd long wanted to make the switch and now my chance has come I'm absolutely delighted. At the moment I'm still finding my way around but I already have an idea about upgrade choices

  • Mouse/Trackpad/Trackpoint acceleration: How to get it right?

    I fail to get the acceleration for my mouse, trackpad and trackpoint right. It seems like having 100 interdependent knobs and trying to find some secret combination of values. I decided to use xset and xinput. For example: xset m 5 1 xinput --set-pro

  • Hello friends, I've a huge matter: whould I buy a Macbook Air or Pro?

    I'd want to get a Macbook for my birthday (university's approaching, too). I saw the new MacBook air 13" and the new MacBook Pro 13" are pretty much at the same prize. I'll tell you things I considered: MacBook Pro: more CPU power, more storage, more

  • GTX 660 TF 2GD5 works in 8x bus interface instead of 16x

    Hallo, the issue that I'm having is that my GPU (MSI GTX 660) is reported to be working in x8 bus interface, not the x16. I have checked and the card is seated in the upper PCIE slot, which is supposed to be giving x16 interface, and I have no second

  • XI pricing / message size

    Hi guys! I understand that XI licensing is based on message throughput, both for inbound and outbound messages and if originator or destination is SAP licensed system, then message is not counted. What I need is the information about size of the mess