JPanel add method not accepting components
My JPanel object isn't accepting components for it's add method. I am trying to add other components of type JPanel to this object and am unabke to. Anyone know why?

14 Replies
⌛
This post has been reserved for your question.
Hey @DevLop games! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
what does your
createSingleFrame
return?JPanel
type mismatch?
javadoc suggests PopupMenu object is required
Why when I added a JPanel object?
yep
Does it change the type of the object?
no, add method only accepts
PopupMenu
can you hover over red squigly line?
what does the error say?
yep type mismatch
What is a PopupMenu anyway
A class that implements a menu which can be dynamically popped up at a specified position within a component.
popup basically
what are you trying to do?I'm trying to layout a list of boxes going downward ontop of my JPanel object which sits on the right side of my screen
Wait if add takes a PopupMenu then how am i supposed to add components to my JPanel??
💤
Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping
.
Warning: abusing this will result in moderative actions taken against you.