私はスイングから質問があります。2 つのフォームがあります。最初のフォームは MDI 用で、2 番目のフォームはログイン用です。ユーザーがパスワードとユーザー名を正しく入力すると、ユーザーは MDI のフォームにログインできるようになります。の MDI フォームの使用 jform
と のログイン フォームの使用、これにログインjinternalframe
を定義して追加しますが、 (MDI フォーム) でJDesktopPane
ボタンを使用したいのですが、ボタンを に追加すると、追加できますが、ボタンの場所を設定できません。ボタンとボタンの位置を設定する方法を教えてください。jframe
JDesktopPane
jinternalframe
これは私のコードです:
Login frame = new Login();
frame.setVisible(true);
desktop=new JDesktopPane();
desktop.add(frame,BorderLayout.CENTER);
setContentPane(desktop);
frame.setSelected(true);
frame.setLocation(500, 200);
FlowLayout flo = new FlowLayout();
desktop.setLayout(flo);
JButton buttonSaveCustumer = new JButton("Create Customer");
buttonSaveCustumer.setLocation(70, 80);
this.add(buttonSaveCustumer);
よろしくお願いします