|
|
|
могу положить тестовый прокет 2 класса
|
|||
|---|---|---|---|
|
#18+
вот проект для теста, и если его запустить то видно как моргает именно перерисовка, а если нагрузить еще чемнибудь, то вообще заметно что от setsize приходит clearrect class mp extends Panel { //вот переопределены репаинты public void repaint() {} public void repaint( long tm ) {} public void repaint( int x, int y, int width, int height ) {} public void repaint( long tm, int x, int y, int width, int height ) {} public void paint(Graphics ga) { // super нету Image im = this.createImage(getSize().width,getSize().height); Graphics g = im.getGraphics(); g.drawRect(0,0,getSize().width-1,getSize().height-1); g.fillRect(20,20,40,40); g.drawString("Hello",1,10); ga.drawImage(im,0,0,null); } } class th extends Thread { Applet1 par; public void run() { for (int a=0;a<140;a++) { par.m.setSize(par.m.getSize().width-1,par.m.getSize().height-1); try {this.sleep(50);}catch(Exception ee){} } for (int a=0;a<140;a++) { par.m.setSize(par.m.getSize().width+1,par.m.getSize().height+1); try{this.sleep(50);}catch(Exception ee){} } } } public class Applet1 extends Applet { mp m = new mp(); Button bt = new Button("start refresh"); public void init() { setLayout(null); m.setSize(200,200); m.setLocation(50,10); m.setBackground(Color.yellow); add(m); bt.setSize(30,30); bt.setLocation(1,1); add(bt); } public boolean action(Event ev,Object ob) { th thh= new th(); thh.par=this; thh.start(); return true; } } ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 06.12.2006, 21:27:57 |
|
||
|
|

start [/forum/topic.php?fid=59&msg=34181665&tid=2147274]: |
0ms |
get settings: |
7ms |
get forum list: |
15ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
196ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
29ms |
get tp. blocked users: |
1ms |
| others: | 189ms |
| total: | 454ms |

| 0 / 0 |
