Hello i am trying to produce a gui which with a textarea that takes over half the length of a frame and half its depth. I have produced this code and at present it only is setting the textarea to a third at most of the length of the frame. If anyone knows how to alter this behavior it would be appreciated. I am also looking at adding other components to the bottom half of the frame - is my approach the best way or is there a better approach. Heres my code so far
window = new JFrame("Network Packet Sniffer");
window.setSize(700,500);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
TextArea text = new TextArea("Network packets will he here",18, 30, TextArea.SCROLLBARS_NONE);
panel.add(text);
window.getContentPane().add(panel);
window.show();
}
public static void main(String[] args){
Serverside1 s = new Serverside1();
}
}
Thankyou.
[ArchAngel added CODE tags]
11-12-2003, 10:15 AM
ArchAngel
You haven't told Swing that you want it to be that size. How should it know?