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



On Jan 30, 12:35 pm, Knute Johnson <nos...@xxxxxxxxxxxxxxxxxxxxxxx>
wrote:
Andrew Thompson wrote:
On Jan 29, 11:12 am, Farcus Pottysqirt <where_is_my_...@xxxxxxxxxx>
wrote:
...
..Is the new-line
character represented differently on a different platform?

Sure is. Best to initilaise the line feed character as..
System.getProperty( "line.separator" );
....
Do you know an OS that uses a different line feed that runs Java?

AFAIU, JRE's on windows did historically return \n\r,
whereas *nix variatns use only \n.

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.

Andrew T.

.



Relevant Pages

  • Re: client -server interaction over XML supporting multiple protocols
    ... > analyzing various models to develop the server. ... The Windows WinInet at just the socket layer is also very ... expected to be different for each platform. ... will the XML size constraints significantly hinder the request ...
    (comp.lang.cpp)
  • Re: It is almost certain now, INTEL will have 64bit x86 !!
    ... >>IA64 boxes, and then support them on the 8086, on to of the original ... Its difficult to see what future the Windows on IPF port has ... Windows on Itanium was always more of a marketing exercise allowing ... But the introduction of Windows on AMD64 and Intels new platform ...
    (comp.os.vms)
  • Re: Checking for Modification to a Set of Files
    ... use .NET on anything other than Windows for production use. ... production applications, but I may have missed your point. ... platform for anything but a Windows system. ...
    (comp.programming)
  • RE: HP announces new Integrity servers
    ... Customers move to platforms like Windows, ... Every platform has strengths and weakneses and challenges. ... IBM's X3 systems may actually support 128-core configurations ...
    (comp.os.vms)
  • Re: Borlands linux strategy ?
    ... Sorry, it's the general mentality of Borland, and reinforced by users who ... believe that Delphi should just remain a windows platform tool. ...
    (borland.public.delphi.non-technical)