• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing TextArea M.I.A.  RSS feed

 
Naziru Gelajo
Ranch Hand
Posts: 175
1
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,

It's your friendly neighborhood Naziru Gelajo. I'm attempting to add a TextArea to an application I'm creating, but for some reason, my TextArea is Missing in Action. I don't know what kind of war it went through to be missing from my Frame. I even assigned and gave it its own very special Pane, In any case, Here is the code:

 
Piet Souris
Master Rancher
Posts: 2044
75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is a pity that the Plant class is missing, so I cannot run your program. However, at first glance, you put this TextArea in a JScrollPane, so it is this scrollpane that you should add to your panel:

By the way: plantPanel4 should have a BorderLayout if you want to add the TextArea to the South, but as it is now you only give it the default FlowLayout (but I could have missed this relevant code).
 
Naziru Gelajo
Ranch Hand
Posts: 175
1
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piet Souris wrote:It is a pity that the Plant class is missing, so I cannot run your program. However, at first glance, you put this TextArea in a JScrollPane, so it is this scrollpane that you should add to your panel:

By the way: plantPanel4 should have a BorderLayout if you want to add the TextArea to the South, but as it is now you only give it the default FlowLayout (but I could have missed this relevant code).


Let's say for instance that I leave it as a FlowLayout (everything that is), nothing shows up. Here is the Plant Class that you are requesting:

 
Piet Souris
Master Rancher
Posts: 2044
75
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give your TextArea some initial size, for instance this code gives me a nice TextArea:
 
Naziru Gelajo
Ranch Hand
Posts: 175
1
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piet Souris wrote:Give your TextArea some initial size, for instance this code gives me a nice TextArea:



Excellent, Thanks! That's what I was looking for!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!