Click here to Skip to main content
15,895,370 members
Home / Discussions / Java
   

Java

 
Questionhow to close acceptandopen for streamconncetionnotifier Pin
manju23reddy2-Oct-08 18:16
manju23reddy2-Oct-08 18:16 
Questiontext twist game project help...... Pin
reanne_8830-Sep-08 21:20
reanne_8830-Sep-08 21:20 
AnswerRe: text twist game project help...... Pin
toxcct30-Sep-08 22:54
toxcct30-Sep-08 22:54 
GeneralRe: text twist game project help...... Pin
reanne_881-Oct-08 4:53
reanne_881-Oct-08 4:53 
Questionhi Pin
my data27-Sep-08 22:06
my data27-Sep-08 22:06 
AnswerRe: hi Pin
toxcct28-Sep-08 21:43
toxcct28-Sep-08 21:43 
QuestionKoch Snowflake Pin
vultron_322926-Sep-08 13:10
vultron_322926-Sep-08 13:10 
AnswerRe: Koch Snowflake Pin
douss8-Oct-08 4:40
douss8-Oct-08 4:40 
Hi vultron, I don't know if you really understand your code.
In your code, you clearly defined two points (only two), let's say point A and point B.
Coordinates of point A are given by :

int pointOne = 60;
int pointTwo = 120;


Coordinates of point B are given by :

int pointThree = 160;
int pointFour = 140;


Then you draw one side of the snowflake (the side A-B) by :

drawKochSide(g, level, pointOne, pointTwo, pointThree, pointFour);


What you have to do is to define a third point C and to draw the two other sides (B-C) and (A-C), so there's the final code of the paint method :

public void paint(Graphics g)
{
int pointOne = 50; //x coordinate of point A
int pointTwo = 100; //y coordinate of point A
int pointThree = 150; //x coordinate of point B
int pointFour = 100; //y coordinate of point B
int pointFive = 100; //x coordinate of point C
int pointSix = 14; //y coordinate of point C


drawKochSide(g, level, pointOne, pointTwo, pointThree, pointFour);
drawKochSide(g, level, pointFive, pointSix, pointOne, pointTwo);
drawKochSide(g, level, pointThree, pointFour, pointFive, pointSix);

}


Notice that in this example, the triangle ABC is not exactly equilateral because coordinates are integers.
Questionjava-linkedlist Pin
Bavirti25-Sep-08 1:00
Bavirti25-Sep-08 1:00 
AnswerRe: java-linkedlist Pin
toxcct25-Sep-08 2:19
toxcct25-Sep-08 2:19 
GeneralRe: java-linkedlist [modified] Pin
Bavirti25-Sep-08 2:46
Bavirti25-Sep-08 2:46 
GeneralRe: java-linkedlist Pin
toxcct25-Sep-08 2:49
toxcct25-Sep-08 2:49 
QuestionEquivalent to .net usercontrol Pin
Russell Jones22-Sep-08 22:33
Russell Jones22-Sep-08 22:33 
AnswerRe: Equivalent to .net usercontrol Pin
Russell Jones22-Sep-08 23:10
Russell Jones22-Sep-08 23:10 
QuestionOdd String/Vector behavior [solved] Pin
David Crow19-Sep-08 5:55
David Crow19-Sep-08 5:55 
AnswerRe: Odd String/Vector behavior Pin
toxcct19-Sep-08 7:07
toxcct19-Sep-08 7:07 
GeneralRe: Odd String/Vector behavior Pin
David Crow19-Sep-08 7:15
David Crow19-Sep-08 7:15 
Questionhow to send live recording audio Pin
manju23reddy17-Sep-08 21:17
manju23reddy17-Sep-08 21:17 
Questionsimple web cam chat application Pin
Matthew Dally17-Sep-08 17:12
Matthew Dally17-Sep-08 17:12 
QuestionDownloading Bank Account Info... Pin
bane7313-Sep-08 7:36
bane7313-Sep-08 7:36 
QuestionSwing:JDialog Pin
shwetabhas12-Sep-08 10:21
shwetabhas12-Sep-08 10:21 
AnswerRe: Swing:JDialog Pin
toxcct14-Sep-08 22:10
toxcct14-Sep-08 22:10 
QuestionSSN Validation Pin
Sudheer.kumarmatta9-Sep-08 20:16
Sudheer.kumarmatta9-Sep-08 20:16 
Questionproblem in bluetooth programming in java Pin
manju23reddy8-Sep-08 20:09
manju23reddy8-Sep-08 20:09 
QuestionAbstract Data Types Pin
Kevin Marois8-Sep-08 16:51
professionalKevin Marois8-Sep-08 16:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.