Skip to main content

paintComponent call in the recursive function

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
onor1
Offline
Joined: 2012-04-26

Hello,

I would like to drow some points by an function recursive and I have a problem.
The recursive function is changing the valus of the points which shud be drawn however it enter in the function set_list() but not in the function paintComponent and enter in that function only after the recursive calls is over. Could you tell me how can I do that?

drow d;
function(){
set_list()
sleep(1000);

function()

}
public class drow extends JPanel {
...........
    @Override
    public void paintComponent(Graphics g) {
       
        Graphics2D g2 =(Graphics2D) g;
super.paintComponent(g);

       
    }
    public void set_list(LinkedList <point> p){
        Points =p;     
        super.repaint();
        super.revalidate();
    }