Article View: be.comp.programming
Article #8780Re: java JEditorPane
From: timvw
Date: Sun, 16 Jun 2002 03:01
Date: Sun, 16 Jun 2002 03:01
37 lines
2398 bytes
2398 bytes
"Gunther" <warlock@nospamme@belgacom.net> schreef in bericht news:3d0a5b87$0$8163$ba620e4c@news.skynet.be... > "timvw" <timvw@tetrinet.be> wrote in message > news:aedjrq$630sa$1@ID-104709.news.dfncis.de... > > hallo, > > > > [knip] > > iemand die weet hoe ik de scrollPane kan laten meescrollen? > > heb al wat gezocht en geexperimenteerd met > > setCaretPosition(pane.getText().length()) > > maar dit geeft steeds arrayOutOfBoundsExceptions :/ > Vergeet niet dat posities in JEditorPane beginnen op 0,0 dus probeert is > setCaretPosition(pane.getText().length() - 1); en zie is of dat werkt. Als > dat nt werkt een alternatieve oplossing is met een document en > documentluisteraar werken dus: genereert dus nog altijd outOfBoundsExceptions... (had er zelf ook al mee gespeeld) > Nu zout ge ook gewoon tekst kunnen toevoegen via insertString methode van > klasse document ipv altijd volledige tekst opnieuw via setText zetten, kans > is dan dat de scrollPane wel meescrollt maar ben nt zeker, ik heb die > document listener ook nt getest dus laat weten als het marcheert :) helaas, JEditorPane blijft referentie naar oude Document behouden... Maar ik heb ook iets dat wel werkt (thx mysth) JScrollBar sb = editorPane.getVerticalScrollBar(); sb.setValue(sb.getMaximum()); (ps: ook voor lujan, http://tetrinet.be/~timvw/webstart/jspectator.jnlp)
Technical Details
Message-ID:
<aeeao9$6g87l$1@ID-104709.news.dfncis.de>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.infoave.net!newsfeed.frii.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!cable-195-162-211-16.upc.chello.BE!not-for-mailReferences:
<aedjrq$630sa$1@ID-104709.news.dfncis.de> <3d0a5b87$0$8163$ba620e4c@news.skynet.be>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,6f7f83f55f029fd4 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2002-06-14 20:02:47 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!supernews.com!news.infoave.net!newsfeed.frii.net!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!cable-195-162-211-16.upc.chello.BE!not-for-mail From: "timvw" <timvw@tetrinet.be> Newsgroups: be.comp.programming Subject: Re: java JEditorPane Date: Sun, 16 Jun 2002 05:01:58 +0200 Lines: 40 Message-ID: <aeeao9$6g87l$1@ID-104709.news.dfncis.de> References: <aedjrq$630sa$1@ID-104709.news.dfncis.de> <3d0a5b87$0$8163$ba620e4c@news.skynet.be> NNTP-Posting-Host: cable-195-162-211-16.upc.chello.be (195.162.211.16) X-Trace: fu-berlin.de 1024110153 6824181 195.162.211.16 (16 [104709]) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000