Home arrow static arrow Java Programming [Archive] - Scroll bar problem !
Warning: Creating default object from empty value in /www/htdocs/w008deb8/wiki/components/com_staticxt/staticxt.php on line 51
Java Programming [Archive] - Scroll bar problem !
This topic has 2 replies on 1 page.

Posts:35
Registered: 7/16/04
Scroll bar problem !  
Aug 9, 2004 5:26 AM



 
// I have the following code :
..............................
boxCon =Box.createHorizontalBox();
ta1 = new JTextArea("I am hammer,\nShe is Kelly!",10,15) ;
ta1.setLineWrap(true );
JScrollPane scroll = new JScrollPane (ta1);
scroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
boxCon.add(ta1);
boxCon.add(scroll);
con= this.getContentPane();
con.setLayout(new FlowLayout());
con.add(boxCon);
........................

I want to get the scroll bar apears attatch to the JTextArea obj ta , But I can see none scroll bar !
why ?
 

Posts:10,972
Registered: 10/23/03
Re: Scroll bar problem !  
Aug 9, 2004 5:35 AM (reply 1 of 2)



 
boxCon.add(ta1); //remove this line
 

Posts:35
Registered: 7/16/04
Re: Scroll bar problem !  
Aug 9, 2004 6:31 AM (reply 2 of 2)



 
thanks ! I make it !
 
This topic has 2 replies on 1 page.