Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: TextArea Not Setting size?

  1. #1
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default TextArea Not Setting size?

    import java.awt.TextArea;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
     
    public class Class2 extends JFrame{
    	private TextArea textArea;
    	private JLabel copyright;
     
    	public Class2(){
     
    		super("");
     
    		copyright = new JLabel("CopyrightŪ 2012");
    		add(copyright);
     
    		textArea = new TextArea("", 15,50, TextArea.SCROLLBARS_VERTICAL_ONLY);
    		add(textArea);
    	}
    }


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: TextArea Not Setting size?

    Try a JTextArea as opposed to a TextArea. You should avoid mixing Swing and AWT components (see the following as to why: Mixing heavy and light components ).

  3. #3
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: TextArea Not Setting size?

    it matters what the name of you 'private JTextArea' Is? 0.0

  4. #4
    Member
    Join Date
    Jan 2012
    Posts
    107
    My Mood
    Grumpy
    Thanks
    6
    Thanked 2 Times in 1 Post

    Default Re: TextArea Not Setting size?

    Quote Originally Posted by copeg View Post
    Try a JTextArea as opposed to a TextArea. You should avoid mixing Swing and AWT components (see the following as to why: Mixing heavy and light components ).
    i changed it to display and it still fills the full screen. :\

  5. #5
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: TextArea Not Setting size?

    Quote Originally Posted by Java Programmer View Post
    i changed it to display and it still fills the full screen. :\
    I have no clue what you mean by this or your previous post. You've failed to provide your current code, what you mean by 'display', whether you are now using a JTextArea, and anything else you may have done

Similar Threads

  1. TextArea and Array Problem
    By slippery_one in forum What's Wrong With My Code?
    Replies: 0
    Last Post: November 28th, 2010, 07:11 AM
  2. Setting tab size for JEditorPane
    By helloworld922 in forum AWT / Java Swing
    Replies: 5
    Last Post: September 6th, 2010, 11:20 AM
  3. Setting JFrame maximum size that pack() can not violate
    By Javabeginner in forum AWT / Java Swing
    Replies: 3
    Last Post: September 3rd, 2010, 05:53 AM
  4. Limit File Size or Request Size
    By tarek.mostafa in forum Java Servlet
    Replies: 3
    Last Post: June 12th, 2010, 04:28 PM
  5. Limit File Size or Request Size
    By tarek.mostafa in forum JavaServer Pages: JSP & JSTL
    Replies: 3
    Last Post: June 11th, 2010, 07:21 AM