香港三國志 · 版規 | 說明 搜尋 會員 聲望 日曆 統計 |
歡迎訪客 ( 登入 | 註冊 ) | 重寄認證電子郵件 |
死魚 |
發表於: Oct 27 2010, 04:53
|
七品官 發表數: 389 所屬群組: 一般 註冊日期: 8-29-2008 活躍:6 聲望:54 |
我現在正在用bluej來學java, 沒想到幾個星期便有一些東西做不到了
不知道如何寫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= =" 外加... 我知道如何令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. |
耒戈氏 |
發表於: Oct 27 2010, 07:16
|
反潮流才是王道!! 發表數: 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 編輯過 |
高長恭 |
發表於: Oct 28 2010, 16:50
|
∼('▽'*) 發表數: 1,054 所屬群組: 太守 註冊日期: 9-18-2003 活躍:10 聲望:435 |
http://download.oracle.com/javase/6/docs/a...t/Graphics.html
setColor, drawOval, drawString, drawLine, drawPolyline 自己睇 -------------------- |
死魚 |
發表於: Oct 29 2010, 01:23
|
七品官 發表數: 389 所屬群組: 一般 註冊日期: 8-29-2008 活躍:6 聲望:54 |
問題做到了
多謝各人的幫助 當然, 日後可能有更多問題>_<(跪) |