Re: New line in a JTextArea (student learning here)
- From: Wojtek Bok <wb@xxxxxxxxxx>
- Date: Tue, 30 Jan 2007 14:39:12 GMT
Andrew Thompson wrote:
OTOH, using System.getProperty("line.separator"),
is 'forward compatible' in the sense that if any new
OS architectures were to become support, or either
Win/*nix to suddenly change the line separator
(my bet would be Windows), the code would adapt.
Actually *nix should change. The action of moving the cursor to the beginning of a new line is in fact two operations:
- move the cursor down one line
- move the cursor to the beginning of the line
So the original DOS specification of CRLF is correct, whereas the professor at Berkley probably wanted to save a few bytes (at a time when storage was expensive).
And this separation can be used by command line apps when displaying status:
for (some loop)
- do work
- print status to the console and append a carriage return (note NO line feed)
So the status is displayed on a single line and is updated only on that line.
.
- Follow-Ups:
- Re: New line in a JTextArea (student learning here)
- From: RedGrittyBrick
- Re: New line in a JTextArea (student learning here)
- References:
- New line in a JTextArea (student learning here)
- From: Sandy
- Re: New line in a JTextArea (student learning here)
- From: Knute Johnson
- Re: New line in a JTextArea (student learning here)
- From: Sandy
- Re: New line in a JTextArea (student learning here)
- From: Farcus Pottysqirt
- Re: New line in a JTextArea (student learning here)
- From: Andrew Thompson
- Re: New line in a JTextArea (student learning here)
- From: Knute Johnson
- Re: New line in a JTextArea (student learning here)
- From: Andrew Thompson
- New line in a JTextArea (student learning here)
- Prev by Date: Re: Is there an easy way to find the right class?
- Next by Date: Re: Is this recursion?
- Previous by thread: Re: New line in a JTextArea (student learning here)
- Next by thread: Re: New line in a JTextArea (student learning here)
- Index(es):
Relevant Pages
|