xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 2KB
    文件類型: .java
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-06-07
  • 語言: Java
  • 標簽:

資源簡介

用java畫出任意八邊形,次代碼可以修改畫出任意多邊形,希望對java初學者有幫助!

資源截圖

代碼片段和文件信息

import?javax.swing.*;
import?java.awt.*;
import??java.awt.Graphics;
import?java.awt.Polygon;

public?class?P138?extends?Jframe{

public?P138(){
add(new?q());

}

public?static?void?main(String?[]args){
P138?frame=new?P138();
frame.settitle(“RRRRRR“);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
frame.setSize(400400);
frame.setVisible(true);

}
}

?class?q?extends?JPanel{
?
public?q(){
???super();
}

public?void?paintComponent(Graphics?g){
super.paintComponent(g);
int?width=getWidth()/2;
int?height=getHeight()/2;
int?radius=(int)(Math.min(getWidth()getHeight())*0.4);
????
Polygon?polygon=new?Polygon();

polygon.addPoint(width+radiusheight);

polygon.addPoint((int)(width+radius*Math.cos(2*Math.PI/8))(int)(height-radius*Math.sin(2*Math.PI/8)));

polygon.addPoint((int)(width+radius*Math.cos(

評論

共有 條評論

相關(guān)資源