#removing everything from JFrame
1 messages · Page 1 of 1 (latest)
While you are waiting for getting help, here are some tips to improve your experience:
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.
not quite sure what exactly u want to remove
the content or the decoration? borders? close buttons? title? ...
have u overriden the paint method already?
follow any basic "java swing tetris" tutorial or similar
and whats the issue now?
dont quite get the problem
so... just call the remove method
whats the issue
well, definitely cnat help u then unles su share the code
You are not supposed to remove them
You should have a Jpanel right ?
Can't you switch the panel by another?
Do you write directly on the frame ? You shouldn't
it would be a lot easier if u could just share ur code
then we could give u concrete info
swing only updates when u do sth
it doesnt refresh all the time
only when u click on sth or move around or whatever
If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.
When you use bounds you need to set the Layout on null
i gotta repeat but we can not help u if u dont share ur full code
ideally also not as image but as formatted text
put urself into the shoes of a helper
make it easy to help them
provide all u got. ideally so that we can just copy pasta and run it locally
Use a card layout to switch between panels or use the setvisible for the panel.
Youll need multiple panels for what you want
Imposable. If you want a game and a main menu youll need two
You can
But for a main menu that sets itself invisable than shows a game you need two panels
Here on a button event, use the setvisible method on the JPanel you have the buttons on if you get an error youll need to instead switch the panel first than set its visibility
but i cant copy pasta it
its an image
so i cant try it out locally to tell u whats wrong
ur making it harder for people to help u than necessary
and it also wouldnt cost u anything to provide the full code, including main and everything
which makes it even easier for helpers
You dont need setVisible on a JPanal
@naive fossil you dont need to set the size of the JPanel, when only one panel it will automatically do the full size of the frame
And do setResizable before setVisible, that could be the issue
Because after its visible it maybe updates and getting messed up, but im on phone and cant check
Closed the thread due to inactivity.
If your question was not resolved yet, feel free to just post a message to reopen it, or create a new thread. But try to improve the quality of your question to make it easier to help you 👍