Hi guys - quick question
I have created a class that creates an array of JButtons and places them onto the panel. That all works well but what I want is for the panel, placed on a frame container, to resize to fit the amount of buttons added.

The total number of buttons can be specified by the user.
Any ideas?

Call doLayout() on the contentPane of the Frame, and then repaint() (just to be sure).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.