trying to make a better version
This commit is contained in:
30
DemoProjects/src/game/minitennis1/Game2.java
Normal file
30
DemoProjects/src/game/minitennis1/Game2.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package minitennis1;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.geom.Ellipse2D;
|
||||||
|
|
||||||
|
public class Game2 extends JPanel {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Graphics g) {
|
||||||
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
|
g2d.setColor(Color.RED);
|
||||||
|
g2d.fillOval(0, 0, 30, 30);
|
||||||
|
g2d.drawOval(0, 50, 30, 30);
|
||||||
|
g2d.fillRect(50, 0, 30, 30);
|
||||||
|
g2d.drawRect(50, 50, 30, 30);
|
||||||
|
|
||||||
|
g2d.draw(new Ellipse2D.Double(0, 100, 30, 30));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JFrame frame = new JFrame("Mini Tennis");
|
||||||
|
frame.add(new Game2());
|
||||||
|
frame.setSize(300, 300);
|
||||||
|
frame.setVisible(true);
|
||||||
|
frame.setLocationRelativeTo(null);
|
||||||
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
4
DemoProjects/src/game/minitennis2/Game.java
Normal file
4
DemoProjects/src/game/minitennis2/Game.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package game.minitennis2;
|
||||||
|
|
||||||
|
public class Game {
|
||||||
|
}
|
||||||
4
TicTacToe_MinMax/src/Player.java
Normal file
4
TicTacToe_MinMax/src/Player.java
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
package PACKAGE_NAME;
|
||||||
|
|
||||||
|
public class Player {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user