问答题

阅读下面程序,画出程序运行后的布局设计。
import java. awt. *;
import javax. swing. *;
public class Class3501
{
public static void main(String[]args)
{
JFrame myWin=new JFrame("Class3501");
myWin. setDefaultCloseOperation(JFrame. EXIT_ON_CLOSE);
Container con=myWin.getContentPane();
con.setLayout(new GridLayout(1,3));
JTextArea textA=new JTextArea("TextArea",3,5);
JScrollPane jsp=new JScrollPane(textA);
con.add(jsp);
JPanel jP=new JPanel();
Jp. setLayoutf new GridLayout(2,1));
JLabel label=new JLabel("JLabel");
JTextField text=new JTextField("Text");
jp.add(label);jp.add(text);
con.add(jp);
JButton button=new JButton("JButton");
con.add(button);
myWin.pack();
myWin.setVisible(true);
}
}

【参考答案】

程序运行后的布局设计为: