How to obtain the string selected by mouse in a TextField

Hi!

We have a JtextField with a string. We want the user to select with the mouse a part of this string and we want to get it,when he press a button. We think we should use the function getCare but we don't really know how it works.

Thank you very much!

[273 byte] By [Kartoffela] at [2007-11-27 11:14:39]
# 1

JTextField extends JTextComponent which has methods for getting the selected text. The

comments section of the class api has a link into the tutorial where you can find more

discussion and examples.

crwooda at 2007-7-29 14:08:07 > top of Java-index,Desktop,Core GUI APIs...