Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

what does this piece of code do

Status
Not open for further replies.

rohithere

Programmer
Oct 27, 2003
51
IN
hi,
what does this piece of code do:

Component cc = ((JScrollPane) c).getViewport().getView();




thanx
 
We can retreive JScrollPane’s main JViewport by calling its getViewport() method, or assign it a new one using setViewport(). We can replace the component in this viewport through JScrollPane’s setViewportView() method, but there is no getViewportView() counterpart. Instead we must first access its JScrollPane’s JViewport by calling getViewport(), and then call getView() on that (as discussed above). Typically, to access a JScrollPane’s main child component we would do the following:

Component myComponent = jsp.getViewport().getView();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top