Forums Register Login

Unable to remove panels from a frame

+Pie Number of slices to send: Send
I would like to switch between screens so I thought switching btw panels is a good idea but I am not really able to remove panels and put new panels into the frame. I appreciate any kind of help in this context....thanks

the code which does this in my program is...



This is the full working program:

+Pie Number of slices to send: Send
Try to post small code samples. Most people will see more than 20 lines of code and move on to the next question.
You can solve your problem with a Card Layout
+Pie Number of slices to send: Send
I can not change layout again. Already I had problems with sizing in GridLayout so I chose GridBagLayout, now you are asking me to change to Card layout and that requires work.
1. Could you tell me what exactly is the problem why does not it work???

2. I just want to know how you guys switch btw screens or do you change frames or panels or remove/add components in panels

You commented to put short codes, if you see the post again, I have the given the piece of code which does not work and have given the whole program for users to run and see how it works and where the problem is....hope you do understand me...
+Pie Number of slices to send: Send
I have solved the problem. The problem was because of the absence of pack() statement after I remove/add panels to the frame.
+Pie Number of slices to send: Send
you should use the panel.validate() also if you have the chance this will help you.
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1451 times.
Similar Threads
panel and image problem
Layout Managers and preferred size
Swing: Unable to bring down the size of JPanel
JList model elements pre exist, updating of vector does not change model
How to Align JCheckBox
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 01:24:57.