I have several different classes and they have graphics in them. I told java to repaint in a class class called LongitudinalWaveGraphics, but it repaints a class called ResistorCCGraphics. Why is this? Thanks for the help. if you need any codes then I can post them.
sirlink99
56
Practically a Master Poster
Recommended Answers
Jump to Postjust looking at your latest code, there's nowhere you add the LWG object to the main JFrame. Since it isn't part of any visible window, it's paintComponent won't be called
Jump to Postsee, LongitudinalWaveProgram is your frame. you have this extending JFrame, right? that just means it is the frame. then, your LongitudinalWaveGraphics is your panel, because it extends JPanel, right? I don;t see why do you need line 13 in your LongitudinalWaveProgram file. And, I might be wrong, but I think …
Jump to Postthis line clears everything in the pane
Since the OP has coded something like that and its not working, the OP should take a closer look at his code to see why it isn't working.
Jump to Post:$ my bad. haven't looked at the code, just assumed he didn't put it in. I beg your pardon.
Jump to PostPlease copy and paste here the full text of the error message. It has info that you did not include in your post.
All 28 Replies
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
bibiki
18
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
bibiki
18
Posting Whiz
sirlink99
56
Practically a Master Poster
bibiki
18
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
bibiki
18
Posting Whiz
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
mKorbel
274
Veteran Poster
NormR1
563
Posting Sage
Team Colleague
bibiki
18
Posting Whiz
NormR1
563
Posting Sage
Team Colleague
sirlink99
56
Practically a Master Poster
bibiki
18
Posting Whiz
sirlink99
56
Practically a Master Poster
NormR1
563
Posting Sage
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.