Jump to content
johntheripper

Java Programming - Jom Blaja Wat Garisan Lurus...,

Recommended Posts

cara2 wat garisan lurus...

create new file.. GarisLurus.java

dlm tu letak benda alah ni..

public class GarisLurus {

public static void main(String arg[]){

System.out.println("----------------");

}

}

pas tu compile dulu baru bole run...

compile..yg akan menghasilkan fail GarisLurus.class

javac GarisLurus.java

pas tu run la..

java GarisLurus

tapi ni buruk nye garis lurus...klu nk wat cantek2 sket dlm applet camne arr...any idea

thanx.. :)

thanx in advance. ..

Share this post


Link to post
Share on other sites

Guna package java.awt.geom.* untuk draw 2D lines and objects. Tgk di sini:

http://java.sun.com/j2se/1.3/docs/api/java...ge-summary.html

dalam banyak2 classes tu, mayb ko nak tgk Line2D, Point2D. Try lukis satu rectangle guna satu lagi class Rectangle2D. :D

Share this post


Link to post
Share on other sites

ok..dapat..thanx 4 ur help. really appreciate it..

tapi 1 g problem..skang camne nk buat graf dlm java plak..

import java.applet.*

import java.awt.*

public class DrawLineExample extends Applet{

public void paint(Graphics g){

g.drawLine(0,0,500,500);

}

}

Share this post


Link to post
Share on other sites

thanx...aku tau yg ni...tapi yg ni xde input output..

mmg ade byk graf....tapi camne klu aku nk masukkan certain data..pas tu jadila graf

Aku pun tak pernah code complex graphs, but suppose the idea is, buat class untuk ambil input dari user (untuk dijadikan koordinat x,y ) and then store semua input dalam variables and then pass to the respective classes in the packages.

Share this post


Link to post
Share on other sites

ok cmni la, ko install tomcat dl..

pstu, ko dload jfreechart + cewolf

nnt dlm cewolf nyer folder ada .war file

copy paste msuk tomcat, run

ctu ada demo

alternatif ln, pki javascript tuh (aku ada bt utk klien :D )

p/s: mmg jfreechart dbuat utk input output le, kalo x wtpe die bt package tuh :lol:

Edited by unexistance

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...