1

パネルがあり、2つのフォームがあります。最初のフォームにはボタンがあります。フォーム1のボタンをクリックすると、フォーム2が表示されます。

ボタンのハンドラー関数を作成しましたvara= Ext.getCmp('mainpanel'); //パネルのIDですa.setActiveItem(Ext.getCmp('subform2')); //これは2番目の形式のIDです

私を助けてください

4

1 に答える 1

0

レイヤード パネルを作成してから、それに 2 つのパネルを追加してみてください

private JLayeredPane mainPanel = new JLayeredPane();
private JPanel form1Panel = new JPanel();
private JPanel form2Panel = new JPanel();

//other settings on the panel ...
//your form...

//on form1 button
JButton button1 = new JButton("go to form 2");
button.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e){
           form1Panel.setVisible(false);
           form2Panel.setVisible(true);
    }
});
form1Panel.add(button1);


mainPanel.add(form1Panel);
mainPanel.add(form2Panel);
于 2012-10-31T13:22:27.160 に答える