How to dynamically resize JPanel at runtime?

Hello Sir:

I met a problem, I need to resize a small JPanel called panel within a main Control JPanel (with null Layout) if I click the mouse then I can Drag and Resize this small JPanel Border to the size I need at runtime, I know I can use panel.setSize() or panel.setPreferredSize() methods at design time,

But I have no idea how to do it even I search this famous fourm,

How to dynamically resize JPanel at runtime?

Can any guru throw some light or good example?

Thanks

[510 byte] By [sunnymanmana] at [2007-11-27 7:55:15]
# 1
Why are you using a null layout? Wouldn't having a layout manager help you in this situation?
petes1234a at 2007-7-12 19:36:35 > top of Java-index,Desktop,Core GUI APIs...