문제

I am creating a Java application. I have 2 Forms, one is JFRAME FORM, which contains left and right JPanel; and JPANEL FORM which contains the contents..

I am having trouble of putting the JPanel Form and its contents to the right JPanel of the JFRame form using card layout.

도움이 되었습니까?

해결책

If you've already added the necessary space, for the right JPanel of the frame form, it's just a matter of hand coding the addition of your JPanel form. something like this

public FrameForm extends JFrame {
    private PanelForm pForm = new PanelForm();

    public FrameForm() {
        initComponents();
        CardLayout card = new CardLayout();
        rightPanel.setLayout(card);

        rightPanel.add(pForm, "pForm");
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top