Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to catch a awt. List adjusting  RSS feed

 
Allan Sorenson
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Writing AWT code (no swing allowed).
I needed to know when the instance of awt.List is adjusted (i.e. scroll bar used).

Is this possible?
or do I need to write my own scrolling list class?
[ October 31, 2008: Message edited by: Allan Sorenson ]
 
Campbell Ritchie
Sheriff
Posts: 53742
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Odd that you aren't allowed Swing.

Go through the List API documentation (preferably not java.util.List; someone else confused the two earlier this week!) and you should find all sorts of addXXXListener methods. Go through the Listeners and see which is most appropriate.
 
Brian Cole
Author
Ranch Hand
Posts: 932
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Allan Sorenson:
Writing AWT code (no swing allowed).
I needed to know when the instance of awt.List is adjusted (i.e. scroll bar used).

Is this possible?
or do I need to write my own scrolling list class?


I guess you need to write your own scrolling list class, because I don't think it can be done.

Keep in mind that AWT uses native peers. How scrolling works and which elements are visible are determined by the native peer, and there's no real API no interact with the peer.

If you're going to write your own, you may want to do it sort of like swing's JList does, by which I mean JList doesn't handle scrolling itself but presumes it may be placed inside a JScrollPane.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!