Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 587
String.userName Avatar asked Dec 05 '25 15:12

String.userName


1 Answers

  • looks like as issue with awt.ScrollPane, have to use swing.JScrollPane instead

  • you are issue with mixing lightweight and heavyweight components

like image 54
mKorbel Avatar answered Dec 07 '25 05:12

mKorbel