Article View: borland.public.jbuilder.java.swing
Article #8678Re: How to use JScrollPane
From: Tor Iver Wilhelmsen
Date: Mon, 31 Jul 2000 00:00
Date: Mon, 31 Jul 2000 00:00
15 lines
1064 bytes
1064 bytes
"Scott Yaung" <hypnex@163.net> writes: > I am trying to build a list with an Icon on the left of each > item ,so I like it to scrollable and I think JScrollPane is suitable > so where should I rewrite the paint(Graphics g) procedure > in a subclass of ScrollPane or a subclass from JViewPort .and what else > should I do for that . You're making too much work for yourself: Just do JList myList = new JList(); JScrollPane pane = new JScrollPane(myList); You then need to implement your own renderer to set the icon on each line - see the JDK docs for javax.swing.JList for an example.
Technical Details
Message-ID:
<uaeeyimpv.fsf@sds.no>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<8m3jmu$h1c4@bornews.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,91b3c31e091d5875 X-Google-Attributes: gid111d45,public From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> Subject: Re: How to use JScrollPane Date: 2000/07/31 Message-ID: <uaeeyimpv.fsf@sds.no> X-Deja-AN: 652718891 Sender: towi@SDSA1761 References: <8m3jmu$h1c4@bornews.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing