JAppletの作成2つのテキストフィールド、ボタン、およびテキスト領域があります。
private JPanel addressEntryPanel = new JPanel(new GridLayout(1,3));
private JPanel outputPanel = new JPanel(new GridLayout(1,1));
private JTextField serverTf = new JTextField("");
private JTextField pageTf = new JTextField("");
private JTextArea outputTa = new JTextArea();
private JButton connectBt = new JButton("Connect");
private JScrollPane outputSp = new JScrollPane(outputTa);
public void init()
{
setSize(500,500);
setLayout(new GridLayout(3,1));
add(addressEntryPanel);
addressEntryPanel.add(serverTf);
addressEntryPanel.add(pageTf);
addressEntryPanel.add(connectBt);
addressEntryPanel.setPreferredSize(new Dimension(50,50));
addressEntryPanel.setMaximumSize(addressEntryPanel.getPreferredSize());
addressEntryPanel.setMinimumSize(addressEntryPanel.getPreferredSize());
add(outputPanel);
outputPanel.add(outputSp);
outputTa.setLineWrap(true);
connectBt.addActionListener(this);
問題は、デバッグしてページに配置するときに、アプレットのサイズに応じてコンポーネント/パネルのサイズが変更されることです。これは欲しくない。テキストフィールドを特定のサイズにし、テキスト領域を特定のサイズにします。サイズを設定するためにそこに何かを入れましたが、機能していません。コンポーネントまたはJPanelのいずれかに厳密なサイズを実際に設定するにはどうすればよいですか。