Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

text area occupation  RSS feed

 
iyappan sankaran
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want a textarea should occupy the entire region of the panel.(not just center)
how is it possible
 
R.Joe
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
U want ur textarea is cover whole area of panel not at the center , so set the layout of the pane l Border and add the textarea then it covers whole panel, like this---
JPanel jp = new JPanel();
jp.setLayout(new BorderLayout());
JTextArea ta = new JTextArea();
jp.add(ta);
I hope this will solve ur problem
 
iyappan sankaran
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks lot RAVI
 
Terry McKee
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to put the JTextArea into a JScrollPane also:

Container c = getContentPane();
JPanel pnl = new JPanel();
pnl.setLayout(new BorderLayout());
JTextArea jta = new JTextArea();
pnl.add(jta,BorderLayout.CENTER);
c.add(new JScrollPane(jta),BorderLayout.CENTER);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!