Search code examples
javaswingawtmixingjmenubar

Java JTextArea overlaps JMenuItem


I have a jmenu called file with one menu item called quit when you click it it activates

System.exit(0);

its all fine until in the jtextfield when ever I enter anything and click enter If I then click on the file button on the jmenubar the quit button is hidden under the jtextarea.

Its quite hard to explain so here is a before and after typing image: enter image description here

Iv'e looked into it and It could be something to do with focusing but any attempts to refocusing the quit button haven't worked.


Solution