problem with repaint()
i have a class testPanel which extends JPanel and have over ridden paintComponent. it takes 2 Arraylists as arguments.
after that, i called this in a method using the following code:
but when i call p1.repaint(), it isnt working. is there any corrections? or i need to use other method to call paintComponent?
JFrame Myframe1 = new JFrame();
testPanel p1 = new testPanel(reactions,species);
What is happening? Errors, nothing, etc? Be more specific. You haven't provided much information. Whats the panels code look like? Try adding @Override above the paintComponent method to make sure you overrode it correctly.
Are you saying you've given your paintComponent method two parameters?
Originally Posted by ankit1801
Then you haven't overridden paintComponent, you've simply written another method.