// initialise all the other lines for ( int i = 1; i < LINES; i++ ) { x1[i] = x1[0]; y1[i] = y1[0]; x2[i] = x2[0]; y2[i] = y2[0]; } image = createImage(width, height); graphics = image.getGraphics(); } public void start(){
// user visits the page, create a new thread if(thread == null){ thread = new Thread( this ); thread.start(); } } public void stop() { // user leaves the page, stop the thread if(thread != null && thread.isAlive()) thread.stop(); thread = null; } public void run() { while (thread != null) { repaint(); try { Thread.sleep(20); } catch(InterruptedException e ){ System.out.println(e); } } } public void paint(Graphics g) { update(g); }
public void update(Graphics g) { // clear the background to white graphics.setColor( Color.white ); graphics.fillRect( 0, 0, width, height );
// draw the lines graphics.setColor( Color.red ); int line = first; for ( int i = 0; i < LINES; i++ ) { graphics.drawLine( x1[line], y1[line], x2[line], y2[line] ); line++; if ( line == LINES ) line = 0; } line = first; first--; if ( first < 0 ) first = LINES - 1; x1[first] = x1[line]; y1[first] = y1[line]; x2[first] = x2[line]; y2[first] = y2[line];
// copy buffer to screen g.drawImage( image, 0, 0, this ); } }
Related Pages:
MISTAKES CORRECTION - Java Beginners MISTAKES CORRECTION Dear Sir,
As you Advised, without compiling, I run the programee with the undermentioned HTML codes in Internet....
Please correct my mistakes and help me please.
Thanking you
MISTAKES CORRECTION - Java Beginners MISTAKES CORRECTION Dear Sir,
The under mentioned Java Sleep programe was received through your favor. But when I compiled..., this );
}
}
Kindly help me to correct my mistakes
Mistakes To Be Avoided While Writing Articles Mistakes To Be Avoided While Writing Articles
 ... your website.
7 mistakes which must be avoided in order to make your article....
Avoid these 7 mistakes for increasing your article's success probabilities
GPS Map
GPS Map
The
GPS Map 76
The GPSMAP- 76 is designed to provide precise GPS positioning using correction data obtained from the Wide Area Augmentation System
rEPLY - Java Beginners
rEPLY hi,
This is session code
i am calling admin_home1.jsp then data will be not displaying
its urgent requirement please send me correction
Thanks
Hi friend,
To display the session
java
.
Do correction: System.out.println("No of items:"+tooa1Item);
After
java
of all your for statement is not correct.
Do correction: for(double index=0.1;index
java
named count.
2)Do correction: System.out.println("No of items:"+tooa1Item);
After
Techniques to Improve GPS Accuracy correction to their readings.
This civilian system works parallel... the required correction. The correction message is then relayed to GPS receivers... Augmentation System
Local Area Augmentation System or LAAS uses similar correction
What is WAAS?
, gather data from the other stations and create the correction message. The correction takes into account the clock and orbit errors as well as delays caused
Greatest Ideas in Human Resource Management mistakes and faults of an employee privately does not make the person feel... find serious mistakes
Even when someone finds faults or mistakes he should make
SCJP Module-4 Question-17
; method.
3. By increasing the number of arguments.
4. Correction is not needed
SCJP Module-4 Question-20
; calling book(2)
from it at line 18
4. No correction needed.
Answer:
(1) ,(2
ajax code with jsp - Ajax
ajax code with jsp hi ,
Sorry for insufficient data.i m making some correction on question.
I have to perform some calculation on my jsp page.
i want to do it automatically (using ajax in jsp).
problem is -
i hv two
SCJP Module-6 Question-3
. No need for correction
4. by removing line 3
Answer :
(1)
Explanation
SCJP Module-6 Question-10
}
How can we correct the above code :
1. No need of correction.
2. By placing
SCJP Module-6 Question-15
;Exception");
16 }}}
How can we correct the above code ?
1. No need of correction.
2
program - Java Beginners
program write a program to print the following pattern:
*
**
***
****
*****
****
***
**
*
sir i have tried it out...u just make some corrections about my mistakes...i have got half the pattern but full
Checking elsewhere with correctly blocked code and question
Checking elsewhere with correctly blocked code and question Hi I have already posted this question but realised I had made a few mistakes. So firstly the problem again!.
I have a textarea box for user comments which will return
Question of apatten
are the mistakes ? We have modified your code.
public class
Open Source Billing System
about the pros and cons of the business, generally do lots of mistakes... Source billing system enables those new comers to avoid such mistakes and help them
Damn Small Linux 2.3 RC2 has been released now
; updated .xinitrc with another correction for better German keyboard support... .xinitrc with another correction for better German keyboard support