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 Postpublic void graphicsComponent (Graphics g){
looks odd to me, are you sure you don't mean
public void paintComponent (Graphics g){
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 PostpainComponent(Graphics g){..} instead of paint(Graphics g){..)
and if you want to really painting something ...
thenif (SwingUtilities.isEventDispatchThread()) { paintImmediately(int x, int y, int w, int h) // or Rectangle r } else { Runnable doRun = new Runnable() { @Override public void run() { repaint(long …
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 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.