1 Star 0 Fork 0

沈涛/Graphics

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
TrafficLightComponent.java 536 Bytes
Copy Edit Raw Blame History
沈涛 authored 2020-04-04 20:23 . add TrafficLightComponent.java.
import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.Ellipse2D;
public class TrafficLightComponent extends JComponent
{
public void paintComponent(Graphics g)
{
Graphics2D g2 = (Graphics2D) g;
g2.setColor(Color.red);
g2.fillArc(10,10,40,40,0,360);
g2.setColor(Color.yellow);
g2.fillArc(10,60,40,40,0,360);
g2.setColor(Color.green);
g2.fillArc(10,110,40,40,0,360);
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/chen_pi_pi_pi_pi/Graphics.git
git@gitee.com:chen_pi_pi_pi_pi/Graphics.git
chen_pi_pi_pi_pi
Graphics
Graphics
master

Search