kontrarian
kontrarian

Reputation: 568

Implementing a drop down form in Java Swing

I basically want to have a form that can toggle between a simple and a detailed mode.

Whats the best way to go about implementing this in Swing?

Many thanks

Upvotes: 1

Views: 299

Answers (1)

camickr
camickr

Reputation: 324207

Use a BorderLayout. Put the detail panel in the south and make it invisible. Then when you click the "Details" button you set the panel visible and pack() the frame. Or if you don't want the frame to change size then you would need to revalidate() and repaint() the parent container.

Upvotes: 3

Related Questions