2 Replies Latest reply: Feb 14, 2013 1:36 AM by 978140 RSS

    Resizing a JTextArea

      Hi. Cant find out why my textarea messes up the JFrame size. Can anyone help?
      import javax.swing.JFrame;
      import javax.swing.JPanel;
      import javax.swing.JTextArea;
      public class TestTextArea {
           public static void main(String[] args){
                JFrame frame = new JFrame("test");
                // CREATE TEXT AREA
                JTextArea desc = new JTextArea(4,25);
                // ADD TEXT TO TEXTAREA
                desc.setText("A lot of text here that automaticaly will go down lines but of some reason changes the frame size when rezising window");
                // ADD TEXTAREA O A PANEL
                JPanel panel = new JPanel();
                // ADD THE PANEL TO THE FRAME
      When I resize the JFrame with the mouse the JFrame gets huge. Any tips on how to make the JFrame behave more as expected?