• Post Reply Bookmark Topic Watch Topic
  • New Topic

Resizing the JPanel

 
Padmavati Rowthula
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's Swing, not Swings.
 
Padmavati Rowthula
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok ..I apologize. That was a typo. I don't know how to edit my post.
 
Fred Kleinschmidt
Bartender
Posts: 451
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try
 
Padmavati Rowthula
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fred Kleinschmidt wrote:Try


That did work!! Thankyou so much
 
Campbell Ritchie
Marshal
Posts: 52516
118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch

Are you going to use that original code as an example of how not to make code legible ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!