This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I am writing a text editor application. Right now its really basic with just a JTextArea, and a JMenuBar in a JDialog. The problem I have is if I highlight some text in the JTextArea, when I click on the menu bar the highlighting dissappears. I know it is a focus problem, but is there anything I can do to fix it or get around it? Maybe I am going about this all wrong, any ideas??
Terence Doyle
Ranch Hand
Joined: May 30, 2001
Posts: 328
posted
0
Hi, Just a shot in the dark here. How about adding a MouseListener to the JTextArea and onMousePressed() try something like this:
I don't have time to test it right now - it's 1am over here in Europe. Hope that helps,