人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當前位置:蘿卜系統下載站 > 技術開發教程 > 詳細頁面

如何制作透明組件。

如何制作透明組件。

更新時間:2022-10-10 文章作者:未知 信息來源:網絡 閱讀次數:

懶得寫說明了,大家應該能看懂。這是一個透明面板的例子,可仿此法制作其它透明組件。有問題給我來信。8-)

希望與大家分享經驗。

package com.borland.samples.welcome;

import java.awt.*;
public class MyPanel extends Panel {
private Image bi; // offscreen image
private Graphics big; // Graphics for the offscreen image
public void update(Graphics g) {
paint(g);
}
public void paint(Graphics g) {
if (bi == null) { // you can't do this from the constructor
bi = createImage(getSize().width,getSize().height);
big = bi.getGraphics();
}
Rectangle area = g.getClipBounds(); // this is the area that needs to be (re)painted (no need to repaint everything)
big.setClip(area);
big.clearRect(area.x, area.y, area.width, area.height); // fills the area with the background color// the next statement will call the paint methods for the other panels/components you have added to this panel// and draw them to the offscreen image
super.paint(big);// now draw the offscreen image to the panel
g.drawImage(bi,area.x, area.y, area.x+area.width, area.y+area.height,area.x, area.y, area.x+area.width, area.y+area.height,this);
}
}

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

網站地圖xml | 網站地圖html
主站蜘蛛池模板: 枣庄市| 满洲里市| 曲麻莱县| 凭祥市| 即墨市| 苏尼特右旗| 林周县| 白水县| 天柱县| 遵义市| 无极县| 昌黎县| 边坝县| 邵阳县| 蚌埠市| 历史| 定边县| 涪陵区| 屯留县| 子洲县| 新蔡县| 阿图什市| 金沙县| 和林格尔县| 广元市| 南和县| 张家口市| 封开县| 隆子县| 股票| 惠水县| 福泉市| 方城县| 盐边县| 雷山县| 龙游县| 右玉县| 万源市| 格尔木市| 茂名市| 丽江市|