Swing Mnemonics

E

ecoswiss

Can Swing mnemonics be used for filling a number in JtextField as hot
key.
I am thinking to create a hotkey to fill the fields with certain
values if blank. It can be any hotkey. How can this be best
accomplished?

-Swiss
 
J

John B. Matthews

Can Swing mnemonics be used for filling a number in JtextField as hot
key. I am thinking to create a hotkey to fill the fields with certain
values if blank. It can be any hotkey. How can this be best
accomplished?

I have never done this. An alternative, perhaps more familiar, interface
might be to set the field to the default and select it entirely using
setSelectionStart() and setSelectionEnd(). Either the user types the
desired value, replacing the selection; or s/he tabs to the next field,
leaving the default as the new value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top