Forums Register Login

Resizing the JPanel

+Pie Number of slices to send: Send
Hi All,
I am trying to fix a piece of code thats been built by another developer. I am completely new to Swings. So I am mostly googling and trying to fix the bug. Please help me
I have a main screen on which theres a 'New' button. Once the user clicks on this 'New' button, a new JPanel pops up with some fields to be entered by the user. There is an option to Save/ Cancel the details entered by the user.
Now the issue is, the new Panel that pops up is occupying my full screen. Though I have scroll bars to scroll down and look at all the fields to be entered, I cannot see the Save/Cancel button, until I resize the Panel manually.
Below is the code for the new Panel that pops up. There is a base panel, button panel (for Save/Cancel buttons) and then the Control panel- which has all the fields to be entered by the user. The control panel and the button panel are added to the base panel. Below is the code:

I tried using resize(), setDimensions() functions on the basePanel, but thats not working. Please advise on what else I can try.

+Pie Number of slices to send: Send
It's Swing, not Swings.
+Pie Number of slices to send: Send
Ok ..I apologize. That was a typo. I don't know how to edit my post.
+Pie Number of slices to send: Send
Try
+Pie Number of slices to send: Send
 

Fred Kleinschmidt wrote:Try



That did work!! Thankyou so much
+Pie Number of slices to send: Send
And welcome to the Ranch

Are you going to use that original code as an example of how not to make code legible ?
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 493 times.
Similar Threads
Which Layout
FlowLayout Horizontal gap setting NOT working
Help writting to file
Problems with Swing dialogbox
Sun java tutorial swing addActionListener code
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 15, 2024 23:57:17.