JAVA分别利用不同颜色和不同字体输出一个你所喜欢的图案,图案下面输出一个包涵你的班级,学号,和姓
JAVA分别利用不同颜色和不同字体输出一个你所喜欢的图案,图案下面输出一个包涵你的班级,学号,和姓名的字符串,编程实现其功能...
JAVA分别利用不同颜色和不同字体输出一个你所喜欢的图案,图案下面输出一个包涵你的班级,学号,和姓名的字符串,编程实现其功能
展开
1个回答
展开全部
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Test456 extends JFrame{
public Test456(){
this.setTitle("");
this.setSize(800, 400);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e) {
JOptionPane.showMessageDialog(Test456.this, "逗你玩^_^");
}
});
this.setVisible(true);
}
@Override
public void paint(Graphics gg) {
Graphics2D g = (Graphics2D)gg;
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setColor(new Color(171,144,199));
g.fillOval(50, 50, 150, 150);
g.setColor(new Color(93,69,165));
g.fillOval(102, 102, 46, 46);
g.setColor(Color.BLACK);
g.drawOval(102, 102, 46, 46);
g.drawOval(79, 79, 96, 96);
g.drawString("轮回眼", 108, 225);
}
public static void main(String[] str){
new Test456();
}
}
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class Test456 extends JFrame{
public Test456(){
this.setTitle("");
this.setSize(800, 400);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent e) {
JOptionPane.showMessageDialog(Test456.this, "逗你玩^_^");
}
});
this.setVisible(true);
}
@Override
public void paint(Graphics gg) {
Graphics2D g = (Graphics2D)gg;
g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setColor(new Color(171,144,199));
g.fillOval(50, 50, 150, 150);
g.setColor(new Color(93,69,165));
g.fillOval(102, 102, 46, 46);
g.setColor(Color.BLACK);
g.drawOval(102, 102, 46, 46);
g.drawOval(79, 79, 96, 96);
g.drawString("轮回眼", 108, 225);
}
public static void main(String[] str){
new Test456();
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询