Results 1 to 3 of 3
Thread: problem with repaint()
- 03-29-2011, 08:00 AM #1
Member
- Join Date
- Mar 2011
- Posts
- 20
- Rep Power
- 0
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?Java Code:JFrame Myframe1 = new JFrame(); Myframe1.setLayout(null); Myframe1. setSize(900,900); Myframe1.setVisible(true); testPanel p1 = new testPanel(reactions,species); Myframe1.add(p1); Myframe1.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); p1.repaint();
- 03-29-2011, 08:22 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
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.
- 03-29-2011, 09:26 AM #3
Moderator
- Join Date
- Apr 2009
- Posts
- 10,438
- Rep Power
- 16
Similar Threads
-
Repaint problem
By citizenXL in forum New To JavaReplies: 4Last Post: 10-28-2009, 03:02 PM -
repaint problem
By amith in forum Java 2DReplies: 2Last Post: 07-01-2008, 12:10 AM -
Problem in repaint
By Preethi in forum AWT / SwingReplies: 16Last Post: 03-18-2008, 08:10 PM -
Repaint problem
By swimberl in forum Java 2DReplies: 1Last Post: 02-16-2008, 09:12 PM -
Repaint problem
By swimberl in forum Java 2DReplies: 0Last Post: 01-06-2008, 03:28 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks