SlideShare a Scribd company logo
import java.awt.*; // victimisation AWT's Graphics and Color
import java.awt.event.*; // victimisation AWT event categories and perceiver interfaces
import javax.swing.*; // victimisation Swing's parts and containers
/** Custom Drawing Code templet */
// A Swing application extends javax.swing.JFrame
public category CGTemplate extends JFrame outline constants
public static final int CANVAS_WIDTH = 640;
public static final int CANVAS_HEIGHT = 480;
// Declare AN instance of the drawing canvas,
// that is AN inner category known as DrawCanvas extending javax.swing.JPanel.
personal DrawCanvas canvas;
// builder to line up the graphical user interface parts and event handlers
public CGTemplate() because the JFrame's content-pane
instrumentation cp = getContentPane();
cp.add(canvas);
// or "setContentPane(canvas);"
setDefaultCloseOperation(EXIT_ON_CLOSE); // Handle the shut button
pack(); // Either pack() the components; or setSize()
setTitle("......"); // "super" JFrame sets the title
setVisible(true); // "super" JFrame show
}
/**
* outline inner category DrawCanvas, that could be a JPanel used for custom drawing.
*/
personal category DrawCanvas extends JPanel for instance,
// Drawing primitive shapes
g.setColor(Color.YELLOW); // set the drawing color
g.drawLine(30, 40, 100, 200);
g.drawOval(150, 180, 10, 10);
g.drawRect(200, 210, 20, 30);
g.setColor(Color.RED); // modification the drawing color
g.fillOval(300, 310, 30, 50);
g.fillRect(400, 350, 60, 50);
// Printing texts
g.setColor(Color.WHITE);
g.setFont(new Font("Monospaced", Font.PLAIN, 12));
g.drawString("Testing custom drawing ...", 10, 20);
}
}
// The entry main methodology
public static void main(String[] args) {
// Run the graphical user interface codes on the Event-Dispatching thread for thread safety
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new CGTemplate(); // Let the builder do the duty
}
});
}
}
Solution
import java.awt.*; // victimisation AWT's Graphics and Color
import java.awt.event.*; // victimisation AWT event categories and perceiver interfaces
import javax.swing.*; // victimisation Swing's parts and containers
/** Custom Drawing Code templet */
// A Swing application extends javax.swing.JFrame
public category CGTemplate extends JFrame outline constants
public static final int CANVAS_WIDTH = 640;
public static final int CANVAS_HEIGHT = 480;
// Declare AN instance of the drawing canvas,
// that is AN inner category known as DrawCanvas extending javax.swing.JPanel.
personal DrawCanvas canvas;
// builder to line up the graphical user interface parts and event handlers
public CGTemplate() because the JFrame's content-pane
instrumentation cp = getContentPane();
cp.add(canvas);
// or "setContentPane(canvas);"
setDefaultCloseOperation(EXIT_ON_CLOSE); // Handle the shut button
pack(); // Either pack() the components; or setSize()
setTitle("......"); // "super" JFrame sets the title
setVisible(true); // "super" JFrame show
}
/**
* outline inner category DrawCanvas, that could be a JPanel used for custom drawing.
*/
personal category DrawCanvas extends JPanel for instance,
// Drawing primitive shapes
g.setColor(Color.YELLOW); // set the drawing color
g.drawLine(30, 40, 100, 200);
g.drawOval(150, 180, 10, 10);
g.drawRect(200, 210, 20, 30);
g.setColor(Color.RED); // modification the drawing color
g.fillOval(300, 310, 30, 50);
g.fillRect(400, 350, 60, 50);
// Printing texts
g.setColor(Color.WHITE);
g.setFont(new Font("Monospaced", Font.PLAIN, 12));
g.drawString("Testing custom drawing ...", 10, 20);
}
}
// The entry main methodology
public static void main(String[] args) {
// Run the graphical user interface codes on the Event-Dispatching thread for thread safety
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new CGTemplate(); // Let the builder do the duty
}
});
}
}

More Related Content

Similar to import java.awt.; victimisation AWTs Graphics and Color impo.pdf

Applet progming
Applet progmingApplet progming
Applet progming
VIKRANTHMALLIKARJUN
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
shanmuga rajan
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
jbarciauskas
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
Shehrevar Davierwala
 
Working with the Calculator program Once imported run the.pdf
Working with the Calculator program Once imported  run the.pdfWorking with the Calculator program Once imported  run the.pdf
Working with the Calculator program Once imported run the.pdf
iconsystemsslm
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
amitksaha
 
Chap1 1 1
Chap1 1 1Chap1 1 1
Chap1 1 1
Hemo Chella
 
Chap1 1.1
Chap1 1.1Chap1 1.1
Chap1 1.1
Hemo Chella
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
Publicis Sapient Engineering
 
Program imageviewer
Program imageviewerProgram imageviewer
Program imageviewer
Fajar Baskoro
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
Stephen Chin
 
Task Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdfTask Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdf
cronkwurphyb44502
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
Kavitha713564
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
Yiguang Hu
 
Java applet
Java appletJava applet
Java applet
GaneshKumarKanthiah
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
RutvaThakkar1
 
Rcp by example
Rcp by exampleRcp by example
Rcp by example
tsubramanian80
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
Yuichi Sakuraba
 
OpenWF 1.0 Composition Reference Card
OpenWF 1.0 Composition Reference CardOpenWF 1.0 Composition Reference Card
OpenWF 1.0 Composition Reference Card
The Khronos Group Inc.
 

Similar to import java.awt.; victimisation AWTs Graphics and Color impo.pdf (20)

Applet progming
Applet progmingApplet progming
Applet progming
 
JAVA AWT
JAVA AWTJAVA AWT
JAVA AWT
 
DWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A TutorialDWR, Hibernate and Dojo.E - A Tutorial
DWR, Hibernate and Dojo.E - A Tutorial
 
Awt and swing in java
Awt and swing in javaAwt and swing in java
Awt and swing in java
 
Working with the Calculator program Once imported run the.pdf
Working with the Calculator program Once imported  run the.pdfWorking with the Calculator program Once imported  run the.pdf
Working with the Calculator program Once imported run the.pdf
 
Applet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java AppletsApplet Architecture - Introducing Java Applets
Applet Architecture - Introducing Java Applets
 
Chap1 1 1
Chap1 1 1Chap1 1 1
Chap1 1 1
 
Chap1 1.1
Chap1 1.1Chap1 1.1
Chap1 1.1
 
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
XebiCon'17 : Faites chauffer les neurones de votre Smartphone avec du Deep Le...
 
Lecture9 oopj
Lecture9 oopjLecture9 oopj
Lecture9 oopj
 
Program imageviewer
Program imageviewerProgram imageviewer
Program imageviewer
 
Intro to JavaFX & Widget FX
Intro to JavaFX & Widget FXIntro to JavaFX & Widget FX
Intro to JavaFX & Widget FX
 
Task Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdfTask Write a Java program to implement a simple graphics editor tha.pdf
Task Write a Java program to implement a simple graphics editor tha.pdf
 
Applet in java new
Applet in java newApplet in java new
Applet in java new
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Java applet
Java appletJava applet
Java applet
 
Abstract Window Toolkit
Abstract Window ToolkitAbstract Window Toolkit
Abstract Window Toolkit
 
Rcp by example
Rcp by exampleRcp by example
Rcp by example
 
From Swing to JavaFX
From Swing to JavaFXFrom Swing to JavaFX
From Swing to JavaFX
 
OpenWF 1.0 Composition Reference Card
OpenWF 1.0 Composition Reference CardOpenWF 1.0 Composition Reference Card
OpenWF 1.0 Composition Reference Card
 

More from apexjaipur

[PDF]Solution [PDF].pdf
 [PDF]Solution [PDF].pdf [PDF]Solution [PDF].pdf
[PDF]Solution [PDF].pdf
apexjaipur
 
The key here is that the relative rates of appearancedisappearance .pdf
  The key here is that the relative rates of appearancedisappearance .pdf  The key here is that the relative rates of appearancedisappearance .pdf
The key here is that the relative rates of appearancedisappearance .pdf
apexjaipur
 
the molar ratio of C with O = 11, However, the a.pdf
                     the molar ratio of C with O = 11, However, the a.pdf                     the molar ratio of C with O = 11, However, the a.pdf
the molar ratio of C with O = 11, However, the a.pdf
apexjaipur
 
pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
                     pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf                     pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
apexjaipur
 
Ne and F2 are both uncharged molecules so there c.pdf
                     Ne and F2 are both uncharged molecules so there c.pdf                     Ne and F2 are both uncharged molecules so there c.pdf
Ne and F2 are both uncharged molecules so there c.pdf
apexjaipur
 
x = 10 + (1p^2) Elasticity , E = (dxdp)(px) .pdf
                     x = 10 + (1p^2)  Elasticity , E = (dxdp)(px) .pdf                     x = 10 + (1p^2)  Elasticity , E = (dxdp)(px) .pdf
x = 10 + (1p^2) Elasticity , E = (dxdp)(px) .pdf
apexjaipur
 
The second phenol can resonance stabilize once th.pdf
                     The second phenol can resonance stabilize once th.pdf                     The second phenol can resonance stabilize once th.pdf
The second phenol can resonance stabilize once th.pdf
apexjaipur
 
Value of the stock = Dividend Required returnValue of the stock .pdf
Value of the stock = Dividend  Required returnValue of the stock .pdfValue of the stock = Dividend  Required returnValue of the stock .pdf
Value of the stock = Dividend Required returnValue of the stock .pdf
apexjaipur
 
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdfThe phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
apexjaipur
 
H3PO3 Phosphorous acid H3AsO4 Arsenic acid HC.pdf
                     H3PO3 Phosphorous acid  H3AsO4 Arsenic acid  HC.pdf                     H3PO3 Phosphorous acid  H3AsO4 Arsenic acid  HC.pdf
H3PO3 Phosphorous acid H3AsO4 Arsenic acid HC.pdf
apexjaipur
 
The active transport of sodium chloride by the ascending loop of Hen.pdf
The active transport of sodium chloride by the ascending loop of Hen.pdfThe active transport of sodium chloride by the ascending loop of Hen.pdf
The active transport of sodium chloride by the ascending loop of Hen.pdf
apexjaipur
 
dy = -2.4 .pdf
                     dy = -2.4                                      .pdf                     dy = -2.4                                      .pdf
dy = -2.4 .pdf
apexjaipur
 
ENTROPY INCEREASES for liquid to gas solid to g.pdf
                     ENTROPY INCEREASES for  liquid to gas  solid to g.pdf                     ENTROPY INCEREASES for  liquid to gas  solid to g.pdf
ENTROPY INCEREASES for liquid to gas solid to g.pdf
apexjaipur
 
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdfSolution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
apexjaipur
 
d) More hydrogen bonds will form with water due t.pdf
                     d) More hydrogen bonds will form with water due t.pdf                     d) More hydrogen bonds will form with water due t.pdf
d) More hydrogen bonds will form with water due t.pdf
apexjaipur
 
Plant is a dicot showing dichotomous branching.Growth form The p.pdf
Plant is a dicot showing dichotomous branching.Growth form  The p.pdfPlant is a dicot showing dichotomous branching.Growth form  The p.pdf
Plant is a dicot showing dichotomous branching.Growth form The p.pdf
apexjaipur
 
Please observe the the code and validations of user inputs.import .pdf
Please observe the the code and validations of user inputs.import .pdfPlease observe the the code and validations of user inputs.import .pdf
Please observe the the code and validations of user inputs.import .pdf
apexjaipur
 
Non-accountant means financial statements in order to understand the.pdf
Non-accountant means financial statements in order to understand the.pdfNon-accountant means financial statements in order to understand the.pdf
Non-accountant means financial statements in order to understand the.pdf
apexjaipur
 
Cerium exhibits three oxidation states, +2, +3 an.pdf
                     Cerium exhibits three oxidation states, +2, +3 an.pdf                     Cerium exhibits three oxidation states, +2, +3 an.pdf
Cerium exhibits three oxidation states, +2, +3 an.pdf
apexjaipur
 
Federated identity management is mainly used by security leaders. It.pdf
Federated identity management is mainly used by security leaders. It.pdfFederated identity management is mainly used by security leaders. It.pdf
Federated identity management is mainly used by security leaders. It.pdf
apexjaipur
 

More from apexjaipur (20)

[PDF]Solution [PDF].pdf
 [PDF]Solution [PDF].pdf [PDF]Solution [PDF].pdf
[PDF]Solution [PDF].pdf
 
The key here is that the relative rates of appearancedisappearance .pdf
  The key here is that the relative rates of appearancedisappearance .pdf  The key here is that the relative rates of appearancedisappearance .pdf
The key here is that the relative rates of appearancedisappearance .pdf
 
the molar ratio of C with O = 11, However, the a.pdf
                     the molar ratio of C with O = 11, However, the a.pdf                     the molar ratio of C with O = 11, However, the a.pdf
the molar ratio of C with O = 11, However, the a.pdf
 
pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
                     pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf                     pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
pOH = -log[OH-] = -log(0.061) = 1.21 pH = 14 - pO.pdf
 
Ne and F2 are both uncharged molecules so there c.pdf
                     Ne and F2 are both uncharged molecules so there c.pdf                     Ne and F2 are both uncharged molecules so there c.pdf
Ne and F2 are both uncharged molecules so there c.pdf
 
x = 10 + (1p^2) Elasticity , E = (dxdp)(px) .pdf
                     x = 10 + (1p^2)  Elasticity , E = (dxdp)(px) .pdf                     x = 10 + (1p^2)  Elasticity , E = (dxdp)(px) .pdf
x = 10 + (1p^2) Elasticity , E = (dxdp)(px) .pdf
 
The second phenol can resonance stabilize once th.pdf
                     The second phenol can resonance stabilize once th.pdf                     The second phenol can resonance stabilize once th.pdf
The second phenol can resonance stabilize once th.pdf
 
Value of the stock = Dividend Required returnValue of the stock .pdf
Value of the stock = Dividend  Required returnValue of the stock .pdfValue of the stock = Dividend  Required returnValue of the stock .pdf
Value of the stock = Dividend Required returnValue of the stock .pdf
 
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdfThe phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
The phenotypes of parental arePPSS - purple smoothppss - yellow.pdf
 
H3PO3 Phosphorous acid H3AsO4 Arsenic acid HC.pdf
                     H3PO3 Phosphorous acid  H3AsO4 Arsenic acid  HC.pdf                     H3PO3 Phosphorous acid  H3AsO4 Arsenic acid  HC.pdf
H3PO3 Phosphorous acid H3AsO4 Arsenic acid HC.pdf
 
The active transport of sodium chloride by the ascending loop of Hen.pdf
The active transport of sodium chloride by the ascending loop of Hen.pdfThe active transport of sodium chloride by the ascending loop of Hen.pdf
The active transport of sodium chloride by the ascending loop of Hen.pdf
 
dy = -2.4 .pdf
                     dy = -2.4                                      .pdf                     dy = -2.4                                      .pdf
dy = -2.4 .pdf
 
ENTROPY INCEREASES for liquid to gas solid to g.pdf
                     ENTROPY INCEREASES for  liquid to gas  solid to g.pdf                     ENTROPY INCEREASES for  liquid to gas  solid to g.pdf
ENTROPY INCEREASES for liquid to gas solid to g.pdf
 
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdfSolution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
Solution - Debt to assets ratio = 0.60Weight of debt in capital s.pdf
 
d) More hydrogen bonds will form with water due t.pdf
                     d) More hydrogen bonds will form with water due t.pdf                     d) More hydrogen bonds will form with water due t.pdf
d) More hydrogen bonds will form with water due t.pdf
 
Plant is a dicot showing dichotomous branching.Growth form The p.pdf
Plant is a dicot showing dichotomous branching.Growth form  The p.pdfPlant is a dicot showing dichotomous branching.Growth form  The p.pdf
Plant is a dicot showing dichotomous branching.Growth form The p.pdf
 
Please observe the the code and validations of user inputs.import .pdf
Please observe the the code and validations of user inputs.import .pdfPlease observe the the code and validations of user inputs.import .pdf
Please observe the the code and validations of user inputs.import .pdf
 
Non-accountant means financial statements in order to understand the.pdf
Non-accountant means financial statements in order to understand the.pdfNon-accountant means financial statements in order to understand the.pdf
Non-accountant means financial statements in order to understand the.pdf
 
Cerium exhibits three oxidation states, +2, +3 an.pdf
                     Cerium exhibits three oxidation states, +2, +3 an.pdf                     Cerium exhibits three oxidation states, +2, +3 an.pdf
Cerium exhibits three oxidation states, +2, +3 an.pdf
 
Federated identity management is mainly used by security leaders. It.pdf
Federated identity management is mainly used by security leaders. It.pdfFederated identity management is mainly used by security leaders. It.pdf
Federated identity management is mainly used by security leaders. It.pdf
 

Recently uploaded

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 

Recently uploaded (20)

Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 

import java.awt.; victimisation AWTs Graphics and Color impo.pdf

  • 1. import java.awt.*; // victimisation AWT's Graphics and Color import java.awt.event.*; // victimisation AWT event categories and perceiver interfaces import javax.swing.*; // victimisation Swing's parts and containers /** Custom Drawing Code templet */ // A Swing application extends javax.swing.JFrame public category CGTemplate extends JFrame outline constants public static final int CANVAS_WIDTH = 640; public static final int CANVAS_HEIGHT = 480; // Declare AN instance of the drawing canvas, // that is AN inner category known as DrawCanvas extending javax.swing.JPanel. personal DrawCanvas canvas; // builder to line up the graphical user interface parts and event handlers public CGTemplate() because the JFrame's content-pane instrumentation cp = getContentPane(); cp.add(canvas); // or "setContentPane(canvas);" setDefaultCloseOperation(EXIT_ON_CLOSE); // Handle the shut button pack(); // Either pack() the components; or setSize() setTitle("......"); // "super" JFrame sets the title setVisible(true); // "super" JFrame show } /** * outline inner category DrawCanvas, that could be a JPanel used for custom drawing. */ personal category DrawCanvas extends JPanel for instance, // Drawing primitive shapes g.setColor(Color.YELLOW); // set the drawing color g.drawLine(30, 40, 100, 200); g.drawOval(150, 180, 10, 10); g.drawRect(200, 210, 20, 30);
  • 2. g.setColor(Color.RED); // modification the drawing color g.fillOval(300, 310, 30, 50); g.fillRect(400, 350, 60, 50); // Printing texts g.setColor(Color.WHITE); g.setFont(new Font("Monospaced", Font.PLAIN, 12)); g.drawString("Testing custom drawing ...", 10, 20); } } // The entry main methodology public static void main(String[] args) { // Run the graphical user interface codes on the Event-Dispatching thread for thread safety SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new CGTemplate(); // Let the builder do the duty } }); } } Solution import java.awt.*; // victimisation AWT's Graphics and Color import java.awt.event.*; // victimisation AWT event categories and perceiver interfaces import javax.swing.*; // victimisation Swing's parts and containers /** Custom Drawing Code templet */ // A Swing application extends javax.swing.JFrame public category CGTemplate extends JFrame outline constants public static final int CANVAS_WIDTH = 640; public static final int CANVAS_HEIGHT = 480; // Declare AN instance of the drawing canvas, // that is AN inner category known as DrawCanvas extending javax.swing.JPanel.
  • 3. personal DrawCanvas canvas; // builder to line up the graphical user interface parts and event handlers public CGTemplate() because the JFrame's content-pane instrumentation cp = getContentPane(); cp.add(canvas); // or "setContentPane(canvas);" setDefaultCloseOperation(EXIT_ON_CLOSE); // Handle the shut button pack(); // Either pack() the components; or setSize() setTitle("......"); // "super" JFrame sets the title setVisible(true); // "super" JFrame show } /** * outline inner category DrawCanvas, that could be a JPanel used for custom drawing. */ personal category DrawCanvas extends JPanel for instance, // Drawing primitive shapes g.setColor(Color.YELLOW); // set the drawing color g.drawLine(30, 40, 100, 200); g.drawOval(150, 180, 10, 10); g.drawRect(200, 210, 20, 30); g.setColor(Color.RED); // modification the drawing color g.fillOval(300, 310, 30, 50); g.fillRect(400, 350, 60, 50); // Printing texts g.setColor(Color.WHITE); g.setFont(new Font("Monospaced", Font.PLAIN, 12)); g.drawString("Testing custom drawing ...", 10, 20); } } // The entry main methodology public static void main(String[] args) { // Run the graphical user interface codes on the Event-Dispatching thread for thread safety
  • 4. SwingUtilities.invokeLater(new Runnable() { @Override public void run() { new CGTemplate(); // Let the builder do the duty } }); } }