private void createLineFeeds( JTextPane x, int pixel ) {
StringBuffer sb = new StringBuffer( x.getText( ));
FontMetrics fm = x.getFontMetrics( x.getFont());
int start=0;
for ( int i = 0; i < sb.length(); i++ ) {
int len = fm.stringWidth( sb.substring(start, i) );
if ( len >= pixel ) {
start = i - 1;
sb.insert( start, "\n" );
}
}
x.setText( sb.toString( ));
}