浪漫告白程序(Java)
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。
精品 import java.awt.*; import javax.swing.*; public class ILoveYou { } class MyPanel extends JPanel implements Runnable{ final int len=400; public void paint(Graphics g){ g.setColor(Color.WHITE); public static void main(String args[]){ } JFrame w=new JFrame(); w.setSize(1366,768); w.setBackground(Color.BLACK); MyPanel mp=new MyPanel(); mp.setBackground(Color.BLACK); w.add(mp); Thread t=new Thread(mp); t.start(); w.show(); -可编辑- 精品 for(int i=0;i }
g.setColor(Color.BLACK);
Font f=new Font("宋体",Font.BOLD,40); g.setFont(f);
g.drawString("我爱你,不是说说而已",450,600);
int x1[]={800,770,850,750,830}; int y1[]={60,160,100,100,160}; g.setColor(Color.BLACK); g.fillPolygon(x1, y1, x1.length);
int x2[]={600,570,650,550,630}; int y2[]={300,400,340,340,400}; g.setColor(Color.BLACK); g.fillPolygon(x2, y2, x2.length);
int x3[]={60,30,110,10,90}; int y3[]={60,160,100,100,160}; g.setColor(Color.BLACK); g.fillPolygon(x3, y3, x3.length);
int x4[]={1300,1270,1350,1250,1330};
g.drawString("*",(int)(Math.random()*1366),(int)(Math.random()*768));
-可编辑-
精品
}
}
int y4[]={300,400,340,340,400}; g.setColor(Color.BLACK); g.fillPolygon(x4, y4, x4.length);
@Override public void run() { }
// TODO Auto-generated method stub while(true){ }
try{Thread.sleep(40);} catch(Exception e){}
repaint();
-可编辑-
本文来源:https://www.wddqw.com/doc/14b76740f38583d049649b6648d7c1c708a10b80.html