-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager"> | ||
<output url="file://$MODULE_DIR$/out/production/" /> | ||
<output-test url="file://$MODULE_DIR$/../out/test/48-2DGraphics" /> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class Frame extends JFrame { | ||
|
||
Panel panel; | ||
Frame() { | ||
|
||
panel = new Panel(); | ||
|
||
this.setDefaultCloseOperation(EXIT_ON_CLOSE); | ||
this.add(panel); | ||
this.pack(); | ||
this.setLocationRelativeTo(null); | ||
this.setVisible(true); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public class Main { | ||
public static void main(String[] args) { | ||
|
||
|
||
new Frame(); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import javax.swing.*; | ||
import java.awt.*; | ||
|
||
public class Panel extends JPanel { | ||
|
||
Image image; | ||
Panel() { | ||
image = new ImageIcon("Sky.png").getImage(); | ||
this.setPreferredSize(new Dimension(500, 500)); | ||
} | ||
|
||
//This method is invoked automatically, there is no need to call it!!! | ||
public void paint(Graphics g) { | ||
|
||
Graphics2D g2D = (Graphics2D) g; | ||
|
||
g2D.setPaint(Color.red); | ||
//g2D.setStroke(new BasicStroke(5)); | ||
//g2D.drawLine(0, 0, 500, 500); | ||
//g2D.drawRect(0,0, 100, 200); | ||
//g2D.fillRect(0, 0, 100, 200); | ||
//g2D.drawOval(100, 100 , 200, 200); | ||
//g2D.fillOval(100, 100 , 200, 200); | ||
//g2D.drawArc(0, 0, 100, 100, 0, 180); | ||
//g2D.fillArc(0, 0, 100, 100, 0, 180); | ||
//g2D.setPaint(Color.white); | ||
//g2D.fillArc(0, 0, 100, 100, 180, 180); | ||
//int[] xPoints = {150, 250, 350}; | ||
//int[] yPoints = {300, 150, 300}; | ||
//g2D.drawPolygon(xPoints, yPoints, 3); | ||
//g2D.fillPolygon(xPoints, yPoints, 3); | ||
//g2D.setFont(new Font("MV Boli", Font.BOLD, 50)); | ||
//g2D.drawString("Text goes here", 50, 50); | ||
|
||
g2D.drawImage(image, 0, 0, null); | ||
|
||
} | ||
} |