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
Thankyou.Code:import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Serverside1 extends JFrame { private JFrame window; public Serverside1() { 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(); } }
[ArchAngel added CODE tags]


Reply With Quote


Bookmarks