PanelTest.java
Dosyayı İndir
import java.awt.*;
import javax.swing.*;
public class PanelTest {
public static void main(String[] args){
JFrame f=new JFrame();
f.setBounds(10,10,200,100);
JPanel topP=new JPanel();
JTextField tf=new JTextField(12);
topP.add(tf);
JPanel centerP=new JPanel();
centerP.setLayout(new GridLayout(1,2));
JButton b1=new JButton("button 1");
JButton b2=new JButton("button 2");
centerP.add(b1);
centerP.add(b2);
f.getContentPane().setLayout(new BorderLayout());
f.getContentPane().add(topP,BorderLayout.NORTH);
f.getContentPane().add(centerP,BorderLayout.CENTER);
f.setVisible(true);
}
}
Dosyayı İndir