πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #8905

Re: JScrollPane and JtextPane

#8905
From: JPBallet
Date: Fri, 23 Jun 2000 00:00
41 lines
1743 bytes
Ok thank you
JP Ballet
Paul Furbacher [TeamB] a οΏ½crit dans le message
<395132B3.12610EB6@home.com>...
>JPBallet wrote:
>
>> Who says me how can i show the first line of my text in a JTextPane with
a
>> JSCrollPane.
>> When i insert all text from a text file, only the last lines  appear and
i
>> am obliged to scroll up.
>> I wish that the first line appear and then scolling down.
>
>You can try getting the scroll pane's viewport and asking
>it to "setViewPosition(new Point(0,0))".
>
>You might also try to set the caret position of the text pane.
>
>> An other question. How can i justify my text because:
>>
>>   DefaultStyledDocument doc = new  DefaultStyledDocument();
>>   ...
>>   textPane.setStyledDocument(doc);
>>   SimpleAttributeSet attr = new SimpleAttributeSet();
>>   ...
>>
>>   StyleConstants.setAlignment(
>>      attr,StyleConstants.ParagraphConstants.ALIGN_CENTER);
>>
>> don't work.
>
>Just wondering, do you add the style to the document somewhere?
>I haven't worked with styles, so this is just a guess.
>
>A thorough reference for this type of document manipulation is
>Keith Topley's "Core Swing: Advanced Programming", chapter 2
>and following.
>
>
>Paul Furbacher (TeamB)
Technical Details
Message-ID: <8ivp5b$ehe5@bornews.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8iqj34$i377@bornews.borland.com> <395132B3.12610EB6@home.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 111d45,fd03c856ba6f12e6
X-Google-Attributes: gid111d45,public
From: "JPBallet" <jean-pierre.ballet@meteo.fr>
Subject: Re: JScrollPane and JtextPane
Date: 2000/06/23
Message-ID: <8ivp5b$ehe5@bornews.borland.com>
X-Deja-AN: 638051547
References: <8iqj34$i377@bornews.borland.com> <395132B3.12610EB6@home.com>
Organization: METEO-FRANCE
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing