Reply to this topicStart new topicStart Poll

> Java的小問題
死魚
發表於: Oct 27 2010, 04:53  
Quote Post


七品官
******

發表數: 389
所屬群組: 一般
註冊日期: 8-29-2008

活躍:6
聲望:54


我現在正在用bluej來學java, 沒想到幾個星期便有一些東西做不到了 wacko.gif

user posted image

不知道如何寫circle= ="

import java.awt.*;
import javax.swing.*;

public class Ring extends JPanel
{
// instance variables - replace the example below with your own
private int myWindowWidth = 300;
private int myWindowHeight = 400;


public Ring()
{
// initialise instance variables
JFrame myFrame = new JFrame();
myFrame.setSize(myWindowWidth, myWindowHeight);
myFrame.add(this);
myFrame.setVisible(true);

}

public void paintComponent(Graphics g)
{


}
}

我現有的code= ="

外加...

user posted image

我知道如何令java理用string來print out....但是不知道如何用坐標寫 (囧)





這是提示= ="

Hint: you might consider creating a drawCircle method to make your job easier. Consider what arguments you need to draw a circle, and how you would translate those into a call to drawOval.
PMEmail Poster
Top
耒戈氏
發表於: Oct 27 2010, 07:16  
Quote Post


反潮流才是王道!!
************

發表數: 6,255
所屬群組: 太守
註冊日期: 7-15-2007

活躍:23
聲望:1540


自學java?(另,這樣的帖應該在新野發)

直接在google上面打"java 相關名稱"就好~.~ 沒有人會記java api的,要用時才會上網找

http://www.roseindia.net/java/example/java...e-in-java.shtml

用string來print out < 不太明白,你想是寫字?你是否想用label? http://download.oracle.com/javase/1.4.2/do.../awt/Label.html

本篇文章已被 耒戈氏 於 Oct 27 2010, 07:17 編輯過
PM
Top
高長恭
發表於: Oct 28 2010, 16:50  
Quote Post


∼('▽'*)
*********

發表數: 1,054
所屬群組: 太守
註冊日期: 9-18-2003

活躍:10
聲望:435


http://download.oracle.com/javase/6/docs/a...t/Graphics.html

setColor, drawOval, drawString, drawLine, drawPolyline

自己睇


--------------------
user posted image
PMEmail PosterUsers WebsiteIntegrity Messenger IM
Top
死魚
發表於: Oct 29 2010, 01:23  
Quote Post


七品官
******

發表數: 389
所屬群組: 一般
註冊日期: 8-29-2008

活躍:6
聲望:54


問題做到了

多謝各人的幫助

當然, 日後可能有更多問題>_<(跪)
PMEmail Poster
Top
1 位使用者正在閱讀本主題 (1 位訪客及 0 位匿名使用者)
0 位會員:

Topic Options Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0189 ]   [ 12 queries used ]   [ GZIP 啟用 ]