Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4714
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!x16g2000prd.googlegroups.com!not-for-mail |
|---|---|
| From | kk <kcool.99x@gmail.com> |
| Newsgroups | comp.lang.java.gui |
| Subject | pls hlep, can't get output |
| Date | Mon, 17 Oct 2011 21:07:09 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 84 |
| Message-ID | <33f44292-1f4f-4084-acee-259e633dbb59@x16g2000prd.googlegroups.com> (permalink) |
| NNTP-Posting-Host | 115.244.47.105 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1318910829 32169 127.0.0.1 (18 Oct 2011 04:07:09 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Tue, 18 Oct 2011 04:07:09 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | x16g2000prd.googlegroups.com; posting-host=115.244.47.105; posting-account=eDS6_goAAACB-2zI3NNFrSeYASMhXaDs |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-Header-Order | ARLUEHNKC |
| X-HTTP-UserAgent | Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0),gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.gui:4714 |
Show key headers only | View raw
This is program.But problem is that there is no output.I faded to
catch the problem.
import java.awt.*;
import javax.swing.*;
import java.util.Calendar;
class ClockDemo extends Canvas{
int xmou=200; //set the center of circle
int ymou=200; //set the center of circle
double theta=-0.1047; //theta for second's hand
int x=xmou; //x position of Second's hand
int y=ymou; //y position of second's hand
int p,b;
int h;
boolean flag=true;
/*ClockDemo(){
//super();
setSize(500,500);
setBackground(Color.PINK);
setVisible(true);
}*/
public void paint(Graphics g){
DrawLine(g,xmou,ymou,x,y);
}
public void DrawLine(Graphics g,int startX,int
startY,int endX,int
endY){
h=80;
System.out.println("h:"+h);
//g.drawLine(200,200,165,248);
while(true){
g.drawLine(startX,startY,endX,endY);
newpoint();
//
this.repaint(startX,startY,endX,endY);
try{
Thread.sleep(1000);
}catch(Exception e){}
}
}
public void newpoint(){
Calendar now = Calendar.getInstance(); //creating a Calendar
variable for getting current time
//for second hand
//h=60;
x=xmou;
y=ymou;
theta=-0.1047;
theta=theta*now.get(Calendar.SECOND);
System.out.println("theta:"+theta);
p= (int) (Math.sin(theta) * h);
b= (int) (Math.cos(theta) * h);
System.out.println("p:"+p+" "+"b:"+b);
x=x-p;
y=y-b;
}
For veiwing
import javax.swing.*;
import java.awt.*;
class ClockDemoViewer {
public static void main(String... arg){
ClockDemo comp=new ClockDemo();
JFrame jf=new JFrame("Clock Demo");
jf.add(comp);
jf.setSize(500,500);
jf.setVisible(true);
jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
}
Back to comp.lang.java.gui | Previous | Next — Next in thread | Find similar
pls hlep, can't get output kk <kcool.99x@gmail.com> - 2011-10-17 21:07 -0700 Re: pls hlep, can't get output Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-10-18 09:25 -0700 Re: pls hlep, can't get output Roedy Green <see_website@mindprod.com.invalid> - 2011-10-30 20:17 -0700 Re: pls hlep, can't get output Knute Johnson <nospam@knutejohnson.com> - 2011-10-30 20:28 -0700 Re: pls hlep, can't get output Roedy Green <see_website@mindprod.com.invalid> - 2011-10-30 22:21 -0700
csiph-web