When setting up a JScrollPane, do you have to invoke both of the methods setHorizontalScrollBarPolicy and setVerticalScrollBarPolicy?  In Display 18.7, we listed the constructor for JScrollPane as...


When setting up a JScrollPane, do you have to invoke both of the methods


setHorizontalScrollBarPolicy and setVerticalScrollBarPolicy?


 In Display 18.7, we listed the constructor for JScrollPane as follows:


public JScrollPane(Component objectToBeScrolled)


This indicates that the argument to the constructor must be of type Component.


But we used the constructor with an argument of type JTextArea. Isn’t this


some sort of type violation?



May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here