Re: New line in a JTextArea (student learning here)



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.
.



Relevant Pages

  • Re: touchpad doesnt work under 2.6.0-test1-ac2
    ... >> for full support, including gesture recongition. ... gpm support is on the way. ... This is the sale for digitizers, except a cursor is ... Touchpads are completely different - the finger ...
    (Linux-Kernel)
  • Re: RDB limitations
    ... skip-sequentially process a series of records. ... your updates are applied immediately with no waiting on deferred COMMITs. ... off and update some related records, you can lose your cursor very ... Ah, yes, support... ...
    (comp.lang.cobol)
  • Re: CR/LF Control With WRITEs to Console
    ... I did try other tab values and the effect was as anticipated (relative to the current cursor position following the previous write). ... I meant ignored in the sense that it didn't reposition the cursor relative to the physical record. ... The left tab limit is set to the current position with each write. ... Support the Original G95 Project: http://www.g95.org ...
    (comp.lang.fortran)
  • Re: why USB mouse cant work??
    ... Also make sure that you have Mouse and Cursor support included. ... after migrating MIPSII BSP ce5.00 to ce6.00. ... Add support for USB host, your BSP USB host driver and HID for mouse ...
    (microsoft.public.windowsce.platbuilder)
  • RE: DataGridView editable combobox Left Right Arrow keys
    ... correct an error they can not move the cursor from character to character ... the arrow keys, is the cell in edit mode? ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.general)