Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38288

Re: how do you block the GUI repaints?

X-Received by 2002:a37:7e83:: with SMTP id z125-v6mr1990279qkc.16.1527097897246; Wed, 23 May 2018 10:51:37 -0700 (PDT)
X-Received by 2002:a1f:88d2:: with SMTP id k201-v6mr512758vkd.9.1527097897012; Wed, 23 May 2018 10:51:37 -0700 (PDT)
Path csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!x25-v6no446929qto.0!news-out.google.com!k3-v6ni208qtj.0!nntp.google.com!x25-v6no446921qto.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.programmer
Date Wed, 23 May 2018 10:51:36 -0700 (PDT)
In-Reply-To <pe45ua$600$1@dont-email.me>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=50.78.95.177; posting-account=2czF5goAAAD4GBMPIGV4KcD2K4PhoB_H
NNTP-Posting-Host 50.78.95.177
References <2ddef1c1-ac37-4384-a3a5-f9b94a1fcbf6@googlegroups.com> <pe1obt$8p6$1@dont-email.me> <6762ff5e-8846-4ea7-be57-7518f2d7ff42@googlegroups.com> <pe1vmo$trt$1@dont-email.me> <a663fea4-e31f-4ec3-952d-ff24c2ba3180@googlegroups.com> <pe2jq7$ah5$1@dont-email.me> <bdb5f760-afe9-474b-ac32-d846e0300b13@googlegroups.com> <pe3s4h$b7i$1@dont-email.me> <593f7f26-0f96-4869-9f55-12917ff65574@googlegroups.com> <pe3tv0$m86$1@dont-email.me> <dc7c06c5-d19f-406d-9ef2-39afd210c18a@googlegroups.com> <pe45ua$600$1@dont-email.me>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <29c0196d-8d2e-489c-ab8a-e99fab3012ad@googlegroups.com> (permalink)
Subject Re: how do you block the GUI repaints?
From Eric Douglas <e.d.programmer@gmail.com>
Injection-Date Wed, 23 May 2018 17:51:37 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 29
Xref csiph.com comp.lang.java.programmer:38288

Show key headers only | View raw


On Wednesday, May 23, 2018 at 12:47:17 PM UTC-4, Daniele Futtorovic wrote:
> You'll have to know beforehand what encoding your text file is in. There
> is, to my knowledge, no general-purpose, reliable way of determining the
> encoding of an arbitrary file (including whether it's text or not).
> 
> Elsethreads, you talk about "JTextArea's character encoding". JTextArea
> does not have a character encoding. Once a String is in the Java
> runtime, it's a String, period. No character encoding. Character
> encoding has to happen at the boundary of the Java runtime, so to speak,
> when you are reading external data in (in this case, your file).
> 
> I would suggest using java.nio.charset.CharsetDecoder-s in combination
> with the java.nio.channels.FileChannel instance you can obtain from the
> RandomAccessFile instance (because both work with
> java.nio.ByteBuffer-s). If you're unfamiliar with character
> (en|de)coding or Java NIO buffers, I would strongly suggest you look up
> a tutorial on those.
> 
> -- 
> DF.

Yes, I am or was confused.  I'm thinking a String is just a collection of characters which are just collections of bytes, and once the String is created it should hold anything a byte array can hold and the control needs to know how to display it.  Apparently it's the font that needs to know how to display it.  So, I don't know how Notepad++ comes up with their codes to show what non-displayable characters look like, but if the Font has a method to say the character can't be displayed I'll just go with displaying a placeholder, most likely a dot (".") and show the value of the position in hex.  I have code here somewhere to convert bytes to hex.

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-22 10:59 -0700
  Re: how do you block the GUI repaints? Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-05-22 13:22 -0500
    Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-22 13:00 -0700
      Re: how do you block the GUI repaints? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-22 16:29 -0400
        Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-22 13:51 -0700
          Re: how do you block the GUI repaints? Martin Gregorie <martin@mydomain.invalid> - 2018-05-22 21:41 +0000
          Re: how do you block the GUI repaints? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-22 18:03 -0400
            Re: how do you block the GUI repaints? Andreas Leitgeb <avl@logic.at> - 2018-05-22 22:22 +0000
              Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 07:55 -0700
                Re: how do you block the GUI repaints? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-23 11:06 -0400
                Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 08:19 -0700
  Re: how do you block the GUI repaints? Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-05-22 14:43 -0400
    Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-22 13:20 -0700
      Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-22 22:47 +0200
        Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-22 13:58 -0700
          Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-23 04:30 +0200
            Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 05:54 -0700
              Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-23 15:58 +0200
                Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 07:26 -0700
                Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-23 16:30 +0200
                Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 07:48 -0700
                Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-23 18:46 +0200
                Re: how do you block the GUI repaints? Eric Douglas <e.d.programmer@gmail.com> - 2018-05-23 10:51 -0700
                Re: how do you block the GUI repaints? Daniele Futtorovic <da.futt.news@laposte.net> - 2018-05-23 22:35 +0200

csiph-web