Re: JTexPane: Cross-platform chaos



Wired Earp wrote:
I've extended a JTextPane to preserve tabindex and implement block-
indentation. It is supposed to work much like a code editor. Check out the resulting applet, rigged up for Firefox only, over at:


    <url:http://www.wunderbyte.com/editorapplet>

I realize you may not have multuple operating systems running simultaniously, so you have to trust me on this: It works perfectly on Linux but fails on Windows. Things get calculated weirdly and unpredictably and I have absolutely no idea where to start looking:

- does Java on Windows not use '\n' and '\t' characters?

You have to use the platform specific line separator (\n on unix, \r\n for windows, \r for MAC). Use System.getProperty("line.separator") to obtain the correct value. Some things tolerate any of these line separators, while other code only functions correctly with the platform separator string.


Mark Thornton
.



Relevant Pages

  • Re: Can REALBasic Handle MP3s and Video? Nope.
    ... There are all kinds of format converters out there, but even if you find one that works, it takes a long time to convert one large movie. ... A serious movie collector needs a Windows box - there is a Windows version of QuickTime, but no Mac versoin of Windows Media Player. ... the RB 5 and below versions had a code editor based on a canvas! ...
    (comp.lang.basic.realbasic)
  • Re: Delphi 2007 Help
    ... screenshot with the error message + code editor in the background if ... What language is your Windows in? ... There's also the possibility of the translation ...
    (borland.public.delphi.non-technical)
  • Re: Delphi 2007 Help
    ... screenshot with the error message + code editor in the background if ... What language is your Windows in? ... There's also the possibility of the translation ... I'm running English version of everything, ...
    (borland.public.delphi.non-technical)
  • Re: BindingNavigator Location
    ... View> Other Windows> Document Window. ... VS won't change the code in the InitializeComponent method back unless ... It is recommended not to modify the code in the InitializeComponent method ... in the method using the code editor, VS could not open the form in the ...
    (microsoft.public.dotnet.framework.windowsforms)