I have a JFrame that displays the current movies that are stored on my computer. It maps file names as String in JTextArea .
I want to double-click on a specific String (which is the actual file on my computer) and this file will open.
The initial part and the double-click part are already resolved, but when I double-click on a String in my JTextArea , only part of that String will be selected. (I am using JTextArea.getSelectedText() ).
I want all String be selected and I can get String . I need to do this because some of my movie files have similar names and the file does not open.
Is there an already implemented method that can expand the selection to a whole line? I tried to solve the Google problem, but nothing will display the entire line of text.
Example: http://i47.tinypic.com/wvol6a.png
Thanks to everyone for their contribution, and I'm sorry that I was unclear regarding JTextArea, JTextArea was a must.
I have a solution to my problem, and I thank Hovercraft Full Of Eels for this.
source share