سؤال

add(Panel1, BorderLayout.NORTH); add(Panel2, BorderLayout.CENTER);

I know one way to do it is like above. But the way I want to layout the panels is so that both are set on North, but Panel2 is below the Panel1. How will I do that?

هل كانت مفيدة؟

المحلول

Alternatively, don't use BorderLayout, but use some other layout manager instead, like GridBagLayout.

نصائح أخرى

Put the panel within a panel... within your top-level component (which might also be a panel). Three levels of layout managers.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top