Discussion Locked

JScrollPane not working...

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi Friends,
I was trying to put my panel which is extends from panel into object of scrollpane, during the process i was not getting any error, but i was not getting what i was expected, that is my image
( created using fillRect was to learge to view in single view)was not scrolling at all.
What could be possible reason behind this?
Below is some snippets of the code.

I created object of my class which is extends from Panel
then i created object of JScrollPane to this constructor I passed object of mypanels object.
add then add this object of JScrollPane to my frame object in the constructor of myframe.

3 replies

by okujava

do u have your class extends Panel or JPanel? u shouldn't mix awt and swing, and the object passed to JScrollPane should be javax.swing.Scrollable

regards

s.okujava

This discussion is closed to new replies.