Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38270
| X-Received | by 2002:a37:374b:: with SMTP id e72-v6mr41808qka.41.1527022724992; Tue, 22 May 2018 13:58:44 -0700 (PDT) |
|---|---|
| X-Received | by 2002:a1f:2b46:: with SMTP id r67-v6mr14839vkr.4.1527022724828; Tue, 22 May 2018 13:58:44 -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-v6no12219qto.0!news-out.google.com!p41-v6ni11qtp.1!nntp.google.com!x25-v6no12212qto.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.programmer |
| Date | Tue, 22 May 2018 13:58:44 -0700 (PDT) |
| In-Reply-To | <pe1vmo$trt$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> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <a663fea4-e31f-4ec3-952d-ff24c2ba3180@googlegroups.com> (permalink) |
| Subject | Re: how do you block the GUI repaints? |
| From | Eric Douglas <e.d.programmer@gmail.com> |
| Injection-Date | Tue, 22 May 2018 20:58:44 +0000 |
| Content-Type | text/plain; charset="UTF-8" |
| Content-Transfer-Encoding | quoted-printable |
| Lines | 34 |
| Xref | csiph.com comp.lang.java.programmer:38270 |
Show key headers only | View raw
On Tuesday, May 22, 2018 at 4:48:33 PM UTC-4, Daniele Futtorovic wrote: > On 2018-05-22 22:20, Eric Douglas wrote: > > JTextArea is my next big control. Normally we just do one insert, as we just use it to display about a dozen lines of text at a time. Now I'm trying to make a file viewer. I tried loading a text file into any number of text file editors but they just crash because it's too big (email dump). I wanted to see if I can load the whole thing at once into a JTextArea. If not I want to get as much as possible, then I can remove text if necessary to add more, with first/previous/next/last buttons to scroll through the file. I have no problem reading multiple chunks from any point in the file, but I can't call the JTextArea insert multiple times in a row without locking up the EDT because it wants to repaint every time. > > > > You'll obviously need to page through the file. Check out > java.io.RandomAccessFile. > > -- > DF. I'm not specifically referencing RandomAccessFile, would that help anything? I just read it like File f = new File(inpFileName.getText()); FileInputStream fis = new FileInputStream(f); FileChannel ch = fis.getChannel(); long fileSize = ch.size(); fis.close(); ByteBuffer buf = ByteBuffer.allocate((int)Math.min(64000,fileSize)); FileInputStream fisb = new FileInputStream(f); FileChannel ch = fisb.getChannel(); int startPoint = 0; ch.read(buf, startPoint); fisb.close(); Then to see what's at the end of the file, just startPoint = fileSize - amountToRead.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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