Results 1 to 3 of 3
Thread: JScrollPane
- 11-14-2011, 02:07 PM #1
Member
- Join Date
- Jun 2011
- Posts
- 59
- Rep Power
- 0
JScrollPane
Hi everybody.....
I want to draw something over the JPanel. Suppose the jpanel have the size 500,500 width and height respectively and added to a jscrollpane.
now if I add 40 buttons to the jpanel, then the scrollbar appears.
But now my problem is, if I draw something over the jpanel, that would be capture more space or size than jpanel(suppose 700,700), then scrollbar not appearing, and the drawing shows only the portion, that cover within jpanel's size, and rest part of the drawing hides.
So what should I do?
Please help
Thanks....
- 11-14-2011, 06:38 PM #2
Senior Member
- Join Date
- Jul 2009
- Posts
- 1,236
- Rep Power
- 13
Re: JScrollPane
Scrollbars are based on the preferred size of the panel added to the scrollpane.
If you are doing custom painting of the panel, then you need to override the getPreferredSize() method of the panel to return the preferred size of the custom painting.
- 11-15-2011, 04:20 PM #3
Member
- Join Date
- Jun 2011
- Posts
- 59
- Rep Power
- 0
Similar Threads
-
JScrollPane Help
By Huskies in forum AWT / SwingReplies: 2Last Post: 08-06-2011, 07:06 PM -
need jscrollpane
By aambhi in forum Advanced JavaReplies: 1Last Post: 04-29-2011, 10:38 AM -
Need Help With JScrollPane Please
By MemorableSmile in forum New To JavaReplies: 4Last Post: 01-31-2011, 03:39 AM -
JScrollPane
By UJJAL DHAR in forum New To JavaReplies: 12Last Post: 08-17-2010, 07:47 PM -
jscrollpane
By kaemonsaionji in forum New To JavaReplies: 3Last Post: 02-25-2009, 09:39 AM
Bookmarks