That makes sense Larry. I'll get the text from the JTextField objects
in the event handler for the OK button.

I've been beating my head on the wall over this one. Sometimes the
answer is right in front of you.

Thanks,

SS

On Thu, Jun 26, 2008 at 3:02 PM, Larry Becker <[EMAIL PROTECTED]> wrote:
> It would seem that this would not be a problem in any modal dialog.  Even if
> the dialog was non-modal, you would have a button to perform the actual
> replace.  When you click the button, the focus changes and the values should
> be available to get at that point.  This is not happening?
>
> Larry
>
> On Thu, Jun 26, 2008 at 4:52 PM, Sunburned Surveyor
> <[EMAIL PROTECTED]> wrote:
>>
>> I'm doing some work on one of my examples for the Plug-In Programmer
>> Guide.
>>
>> In this example a plug-in prompts the user for both a search string
>> and a replacement string. It then replaces all of the search strings
>> it finds in the name of each layer with the replacement String.
>>
>> It appears that the plug-in works correctly, but I have to hit the
>> enter key to store the strings entered in the two JTextField objects
>> presented on the dialog that captures data from the user.
>>
>> When I "tab out" of the box the Strings are not set. I found out this
>> is because the "tab" key does not trigger the action listener like the
>> enter key does.
>>
>> If I want to store the Strings input by the user I have to
>> specifically wire up the tab key to trigger an event, as described
>> here:
>>
>>
>> http://blog.marcnuri.com/blog/default/2007/06/06/Detecting-Tab-Key-Pressed-Event-in-JTextField-s-Event-VK-TAB-KeyPressed
>>
>> This seems like a real pain-in-the-neck and I was surprised the
>> JTextField didn't automatically call the same event listener for the
>> tab key that it does for the enter key.
>>
>> Here is my question:
>>
>> Will most of our users expect the tab key to set the Strings they
>> provide, or will they expect that the enter key will be required to
>> enter the data?
>>
>> As an alternative, I can add a "set values" button to the form.
>>
>> I know OpenJUMP is used all over the globe, and I want to design my
>> form to be used as the majority of our users would expect. Any
>> suggestions on this GUI design issue?
>>
>> Thanks a bunch.
>>
>> The Sunburned Surveyor
>>
>> -------------------------------------------------------------------------
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Jump-pilot-devel mailing list
>> Jump-pilot-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>
> --
> http://amusingprogrammer.blogspot.com/
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to