All source code in Java/ Javascript Ask a Java/ Javascript Pro Discussion Forum Categories All jobs in Java/ Javascript
draws,Zigzag,Graphics,Computer,screen,through
   Code/Articles � |  Newest/Best � |  Community � |  Jobs � |  Other � |  Goto � | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Java/ Javascript Stats

 Code: 485,860. lines
 Jobs: 197. postings

 How to support the site

 
Sponsored by:
Quick Search for:  in language:    
You are in:
 
Login





Latest postings for Java/ Javascript.
Click here to see a screenshot of this code!automated glossary 2010 beta psychology 200 forced learning and memory restorer! rodlewis2010 beta!
By ROD LEWIS on 3/7

(Screen Shot)

Mouseover_3Imag e_Fader_Nav
By Mark Acuna on 3/7


Click here to see a screenshot of this code!NLabs' Folder Tree Generator
By nagesh borate on 2/28

(Screen Shot)

AI-TicTacToe
By Masood Fallahpoor on 3/4


Click here to see a screenshot of this code!Function
By Mr. SNMP Simamora on 3/4

(Screen Shot)

Click here to see a screenshot of this code!Median Number
By Mr. SNMP Simamora on 3/4

(Screen Shot)

Click here to see a screenshot of this code!Simple ppt viewer
By Rio Purwanggono on 3/3

(Screen Shot)

Click here to see a screenshot of this code!rain or snow your name or anything you want rod lewis2010 BETA
By ROD LEWIS on 3/1

(Screen Shot)

Click here to see a screenshot of this code!Simple jQuery Slideshow
By Bardhyl on 2/27

(Screen Shot)

Click here to see a screenshot of this code!Java JDBC Connection with SQL Server using Jtds Driver
By Nor Samsiah Sani on 2/24

(Screen Shot)

Click here to see a screenshot of this code!The Web Browser
By snowboardr on 2/24

(Screen Shot)

Click here to see a screenshot of this code!Font special effects filter for Adobe photo's + flash, dreamweaver MS editors beta producer 2010
By ROD LEWIS on 2/22

(Screen Shot)

Click here to see a screenshot of this code!new year
By highfinddale on 2/21

(Screen Shot)

Convex Hull
By Atishay Jain on 2/21


Click here to see a screenshot of this code!Java Upload Applet With Resume Facility
By Amit Kumar Gaur on 2/11

(Screen Shot)

Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!



 
 
   

Beautiful Graphics applet

Print
Email
 
VB icon
Submitted on: 2/4/2010 9:06:05 AM
By: Tejas Jayantilal Gandhi  
Level: Intermediate
User Rating: Unrated
Compatibility:Java (JDK 1.2)

Users have accessed this code 621 times.
 
 
     It draws Zigzag Graphics on Computer screen through mouse.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//     
// Name: Beautiful Graphics applet
// Description:It draws Zigzag Graphics 
//     on Computer screen through mouse.
// By: Tejas Jayantilal Gandhi
//
// Inputs:Nothing
//
// Returns:Graphics on Computer Screen
//
// Assumes:Nothing
//
// Side Effects:No Side Effects
//
//This code is copyrighted and has// limited warranties.Please see http://
//     www.Planet-Source-Code.com/vb/scripts/Sh
//     owCode.asp?txtCodeId=6570&lngWId=2//for details.//**************************************
//     

/*<HTML>
<APPLET
code = dauber4
width = 400
height = 240>
</APPLET>
</HTML>*/
import java.awt.Graphics;
import java.awt.*;
import java.awt.event.*;
import java.lang.Math;
import java.applet.Applet;
public class dauber4 extends Applet implements ActionListener, MouseListener, MouseMotionListener


    {
    	Button buttonzigzag;
    	Point ptAnchor, ptTemp;
    	Point pts[] = new Point[10000];
    	Point pt[]=new Point[10000];
    	int loop_index=0,i=0;
    	int ptindex = 0;
    	// The flags are set according to the button clicked
    	boolean bzigzagFlag=false;
    		public void init() 


        {
        		buttonzigzag=new Button("zigzag");
        		add(buttonzigzag);
        		buttonzigzag.addActionListener(this);
        		addMouseListener(this);
        		addMouseMotionListener(this);
    }

public void mouseClicked(MouseEvent pe) { if(bzigzagFlag) { ptAnchor=new Point(pe.getX(),pe.getY()); bzigzagFlag=!bzigzagFlag; }
if((!bzigzagFlag)&&(ptindex >0)) { ptTemp=new Point(pts[ptindex-1].x,pts[ptindex-1].y); while(loop_index<=ptindex) { if(loop_index==(ptindex-1)) { pt[i]=pts[ptindex-1]; i++; } loop_index++; } } repaint(); }
public void mouseMoved(MouseEvent me) { showStatus("mouse mooved"); pts[ptindex] = new Point(me.getX(),me.getY()); ptindex++; }
public void mousePressed(MouseEvent e){} public void mouseReleased(MouseEvent e){} public void mouseDragged(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){} public void paint(Graphics g) { if((!bzigzagFlag)&&(ptindex>0)) // if((ptAnchor instanceof Point)&&(ptTemp instanceof Point)) { for(i=0;i<Ptindex-1;i++) { g.drawLine(ptAnchor.x,ptAnchor.y,pt[i].x,pt[i].y); //g.drawLine(ptAnchor.x,ptAnchor.y,ptTemp.x,ptTemp.y); } }
}
public void actionPerformed(ActionEvent e) { if(e.getSource() == buttonzigzag) { bzigzagFlag=!bzigzagFlag; } }
}


Other 1 submission(s) by this author

 

 
 Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author from the email account you registered on the site, so you can correspond directly.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
To post feedback, first please login.


 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Games | Feedback | Customize | Java/ Javascript Home | Site Home | Other Sites | Open Letter from Moderators | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright� 1997-2010 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.   Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Exhedra solutions has no affiliation with Sun Microsystems, Inc.. Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.