I'm making a chat app. that looks like this:
I have a submenu called "private" that toggles the users rights to read chatlogs.
However, when I read chatlogs into the Jtextarea (the chatbox), the submenus appear behind the chat history label.
The label isn't a component of the Jtextarea. How do I fix this?
EDIT More information. I know that the problem occurs when I read in a chatlog, because I no longer have this problem when removing the following from the code. chatBox.read(reader, chatLog);
What I mean by not having this problem is, I can toggle the private on and off and click on objects in the friendlist, without the "chatroom" label getting in the way of the submenu.
Don't use a Label. That is an AWT component. Use a JLabel which is a Swing component. – camickr
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.