JApplet ,JScrollPane, JPanel

Hi,

I have a class Test which extends JPanel, I have added a button to this class and overriden the paint method to draw some lines,

In my JApplet, i create instance of Test class and add to the JSCrollPane, I add this JScrollPane to my JApplet content pane, the problem is i dont see the JButton on the screen , but when i click on some where i have added the JButton , i get the action performed event triggered,

My layout for Test class is BorderLayout and i add the button to north,

So what is the problem ..how can i solve it,

Answere ASAP

Ashish

[603 byte] By [kulkarni_ash] at [2007-9-26 7:44:13]
# 1

Do not override the drawing for your main container JPanel. Instead place another JPanel instance into the layout of your containing JPanel and draw with that. That will contain the drawing of that panel to just the area contained in that sub panel, and then it won't mess up the drawing of the other items contained within the main panel.

gweedo at 2007-7-1 17:51:21 > top of Java-index,Archived Forums,Swing...