• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing the Panel size dyanamically  RSS feed

 
sanjay hande
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to change the size of a JPanel at runtime, say by clicking one of the four radio buttons inside the panel, the Panel size will vary depending on how many components are added to the Parent Panel?
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add Listeners to JRadioButtons; I think it is the ActionListener you are thinking of. Then resize the JFrame in the Listeners.

Such resizing seems strange behaviour, however.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!