java - Scrollable in JTextArea -


i have class extending jframe , jtextarea configuration below. reason scroll doesn not appear. can't figure out why.

     jtextarea ta=new jtextarea();          ...              ta.settext(out);             jscrollpane scrollframe = new jscrollpane(ta);             //ta.setautoscrolls(true);             scrollframe.setverticalscrollbarpolicy(scrollpaneconstants.vertical_scrollbar_always);             scrollframe.sethorizontalscrollbarpolicy(jscrollpane.horizontal_scrollbar_always);             add(scrollframe);             add(ta);             setsize(300, 300);             setresizable(false);             setdefaultcloseoperation(windowconstants.hide_on_close);             setvisible(true); 

for example, adding scrollable jtextarea (java)

just add scrollframe , not jtextarea

 add(scrollframe); // add(ta); 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -