在Application中如何用Graphics的drawImage方法? 似乎是用继承自JComponent的getGraphics()方法,可否这样用?在一个panel的subclass中加如下代码:getGraphics().drawImage(......); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Image globe; Toolkit tk = Toolkit.getDefaultToolkit(); globe = tk.getImage("Globe.gif"); try { MediaTracker mt = new MediaTracker(this); mt.addImage(globe,0); mt.waitForID(0); } catch(Exception e) { e.printStackTrace(); } Insets insets = getInsets(); Dimension scrnsz = tk.getScreenSize(); Dimension globesz = new Dimension(globe.getWidth(this),globe.getHeight(this)); setBounds((scrnsz.width / 2) - (globesz.width / 2), (scrnsz.height / 2) - (globesz.height / 2), globesz.width + insets.left + insets.right, globesz.height + insets.top + insets.bottom); java 断点调试 停住了 不能动 关于Rmi远程访问的问题 请各位高手帮忙! 二维数组有什么比较实用的用例 关于spring与log4j的问题???????? public static void main(String args [] ) ,String args []的作用是什么? java 大哥大姐谢谢了,我是新手 Tomcat5.5怎么不能下了? Arias(永恒之道),deadphenix(deadphenix),stonegump(龙飞虎)老兄进来接分! 从jdbc2看sun的本来面目!!! 如何控制线程的多少 求教:远程操作文件
Toolkit tk = Toolkit.getDefaultToolkit();
globe = tk.getImage("Globe.gif");
try
{
MediaTracker mt = new MediaTracker(this);
mt.addImage(globe,0);
mt.waitForID(0);
}
catch(Exception e)
{
e.printStackTrace();
}
Insets insets = getInsets();
Dimension scrnsz = tk.getScreenSize();
Dimension globesz = new Dimension(globe.getWidth(this),globe.getHeight(this)); setBounds((scrnsz.width / 2) - (globesz.width / 2),
(scrnsz.height / 2) - (globesz.height / 2),
globesz.width + insets.left + insets.right,
globesz.height + insets.top + insets.bottom);