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??