小编nov*_*var的帖子

paintComponent正在执行两次

这困扰我,我的代码工作和运行但是当我去运行它时,它似乎循环我的for循环两次,任何人都可以帮助我的逻辑?谢谢...

package pkgcirc;
import java.util.Random;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.*;

/*
* Notes:
* Draw 20 circles
* radius/location (x/y/r) all random
* if (circle) is between radii pt (step thru loop) of all values, if its within ,
*  draw it cyan if it overlaps, else black
*  
*/
public class Main extends JPanel {
    int[] radius = new int [3];
    int[] xArray = new int [3];
    int[] yArray = new int [3];

    public Main()
    {       
        Random g …
Run Code Online (Sandbox Code Playgroud)

java loops for-loop

2
推荐指数
1
解决办法
2919
查看次数

标签 统计

for-loop ×1

java ×1

loops ×1