小编Dan*_*mer的帖子

为拉撒路增加单位?

我想知道如何将单位添加到拉撒路,例如(crt,sysutils)特别是翼翼.我已经搜索过互联网,但我没有找到任何东西,所以有人可以启发我吗?

pascal lazarus uses

4
推荐指数
1
解决办法
1934
查看次数

为什么我的while循环不能在paintComponent中工作?

当我运行此代码时,我只看到一个空白(白色)面板,我想知道原因.

这是我的代码:

Graph.java

public class Graph extends JPanel {
    private static final long serialVersionUID = -397959590385297067L;
    int screen=-1;
    int x=10;
    int y=10;
    int dx=1;
    int dy=1;       
    boolean shouldrun=true;
    imageStream imget=new imageStream();

        protected void Loader(Graphics g){

            g.setColor(Color.black);
            g.fillRect(0,0,x,y);
            x=x+1;
            y=y+2;

        }


        @Override
        protected void paintComponent(Graphics g){
            super.paintComponent(g);
                while(shouldrun){
                    Loader(g);   
                    try {
                        Thread.sleep(200);
                    } catch (InterruptedException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                    }    
                }   
        }
}
Run Code Online (Sandbox Code Playgroud)

java swing jpanel paintcomponent

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

标签 统计

java ×1

jpanel ×1

lazarus ×1

paintcomponent ×1

pascal ×1

swing ×1

uses ×1