• Post Reply Bookmark Topic Watch Topic
  • New Topic

JScrollPane  RSS feed

 
Manoj Tare
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application
JFrame holdes JScrollPane called P1 .JFrame have BorderLayout .
P1 Scrollpane holdes Jpanel P2
Panel P2 holdes image .
When i add zoom effect to image ,that time panel should get Scroll bar but it doesn't showing it.
Some time it shows scrollbar but with out knob
class showZoomImage extends JPanel
{
Image img;
public void paint(Graphics g){
this.setPreferredSize(img.getWidth(),img.getHeight());
g.drawImage(img,width, height,this);
}
}
 
Chantal Ackermann
Ranch Hand
Posts: 508
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
try to change the preferred size of the viewport of the scrollpane (scrollPane.getViewport()) whenever the preferred size of the zoomimage changes.
chantal
 
Manoj Tare
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thanxs man..
It is working .....
manoj
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!