cambeme
Giới tính : Cung : Con giáp : Bài gửi : 174 Điểm : 5273 Thanks : 0 Sinh nhật : 05/12/1991 Ngày gia nhập : 25/03/2011 Tuổi : 32 Đến từ : Thành phố Hồ Chí minh Nghề nghiệp/ước mơ : IT Tâm trạng : Hưng phắn Châm ngôn sống : Không có gì quý hơn hột vịt thịt kho!
Cao nhân tắt thở vô phương trị!
| Tiêu đề: Assignment 05 – Imazing 29/3/2011, 18:59 | |
| | 29/3/2011, 18:59 Assignment 05 – Imazing | | | Bài 1: - Code:
-
import javax.swing.*; import java.awt.*;
/* * @author Trinh Thai Anh * T094054 */ @SuppressWarnings("serial") public class cAss05Pro01_10CirclesA_T094054 extends JFrame { // constructor public cAss05Pro01_10CirclesA_T094054() { // set size width=300, height= 300 setSize(300, 300); // set background color setBackground(Color.white); // set title setTitle("10 Circles - A"); }
// paint function public void paint(Graphics g) { int a = 20; for (int i = 200; i >= a; i = i - 20) {// use for to draw circles g.drawOval(50, 50, i, i); }// end for }// end paint
/** * @paramargs */ public static void main(String[] args) { // TODOAuto-generated method stub // declare the window cAss05Pro01_10CirclesA_T094054 mainWindow = new cAss05Pro01_10CirclesA_T094054(); // set status as closing mainWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); // show the window mainWindow.setVisible(true); }// end main function }// end class Bài 2: - Code:
-
import javax.swing.*; import java.awt.*;
/* * @author Trinh Thai Anh * T094054 */ @SuppressWarnings("serial") public class cAss05Pro02_10CirclesB_T094054 extends JFrame { // constructor public cAss05Pro02_10CirclesB_T094054() { // set size width=300, height= 300 setSize(300, 300); // set background color setBackground(Color.white); // set title setTitle("10 Circles - B"); }
// paint function public void paint(Graphics g) { int a = 10; int d = 0; for (int i = 200; i >= a; i = i - 20) {// use for to draw circles g.drawOval(50 + d, 50, i, i); d = d + 10; }// end for }// end paint
/** * @paramargs */ public static void main(String[] args) { // TODOAuto-generated method stub // declare the window cAss05Pro02_10CirclesB_T094054 mainWindow = new cAss05Pro02_10CirclesB_T094054(); // set status as closing mainWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); // show the window mainWindow.setVisible(true); }// end main function }// end class Bài 3: - Code:
-
import javax.swing.*; import java.awt.*;
/* * @author Trinh Thai Anh * T094054 */ @SuppressWarnings("serial") public class cAss05Pro03_10CirclesC_T094054 extends JFrame { // constructor public cAss05Pro03_10CirclesC_T094054() { // set size width=300, height= 300 setSize(300, 300); // set background color setBackground(Color.white); // set title setTitle("10 Circles - C"); }
// paint function public void paint(Graphics g) { int a = 10; int d = 0; for (int i = 200; i >= a; i = i - 20) {// use for to paint circles g.drawOval(50, 50 + d, i, i); d = d + 10; }// end for }// end paint
/** * @paramargs */ public static void main(String[] args) { // TODOAuto-generated method stub // declare the window cAss05Pro03_10CirclesC_T094054 mainWindow = new cAss05Pro03_10CirclesC_T094054(); // set status as closing mainWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); // show the window mainWindow.setVisible(true); }// end main function }// end class Bài 4: - Code:
-
import javax.swing.*; import java.awt.*;
/* * @author Trinh Thai Anh * T094054 */ @SuppressWarnings("serial") public class cAss05Pro04_10CirclesD_T094054 extends JFrame { // constructor public cAss05Pro04_10CirclesD_T094054() { // set size width=300, height= 300 setSize(300, 300); // set background color setBackground(Color.white); // set title setTitle("10 Circles - D"); }
// paint function public void paint(Graphics g) { int a = 10; int d = 0; for (int i = 200; i >= a; i = i - 20) {// use for to draw circles g.drawOval(50 + d, 50 + d, i, i); d = d + 10; }// end for }// end paint
/** * @paramargs */ public static void main(String[] args) { // TODOAuto-generated method stub // declare the window cAss05Pro04_10CirclesD_T094054 mainWindow = new cAss05Pro04_10CirclesD_T094054(); // set status as closing mainWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); // show the window mainWindow.setVisible(true); }// end main function }// end class Bài 5: - Code:
-
import javax.swing.*; import java.awt.*;
/* * @author Trinh Thai Anh * T094054 */ @SuppressWarnings("serial") public class cAss05Pro05_10Squares_T094054 extends JFrame { // constructor public cAss05Pro05_10Squares_T094054() { // set size width=300, height= 300 setSize(300, 300); // set background color setBackground(Color.white); // set title setTitle("10 Squares"); }// end class // paint function
public void paint(Graphics g) { int a = 10; int d = 0; for (int i = 200; i >= a; i = i - 20) {// use for to draw rectangles g.drawRect(50 + d, 50 + d, i, i); d = d + 10; }// end for }// end paint
/** * @paramargs */ public static void main(String[] args) { // TODOAuto-generated method stub // declare the window cAss05Pro05_10Squares_T094054 mainWindow = new cAss05Pro05_10Squares_T094054(); // set status as closing mainWindow.setDefaultCloseOperation(EXIT_ON_CLOSE); // show the window mainWindow.setVisible(true); }// end main function }// end class
| | | | | |
|