This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am writing a little program that draws circles inside a JPanel. I put the Jpanel inside a JScrollPane, but when the circles are bigger than the area, it wont scroll. Why is this happening? thanks cardwell
Hi Cardwell, The JScrollPane asks the JPanel what size it would prefer to be and uses that size. Your circles are not objects that need to be managed therefore the JPanel layout doesn't use them to give its' preferred size. You need to set the JPanel preferred size so that the JScrollPane knows that it is not the same size as its child (JPanel). Regards, Manfred.