java如何实现几张图片从左到右滚动? 可以把图片做成gif的动画来显示。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 to:skyyoung(路人甲)怎样改?能具体说说吗?谢谢! 安装java web start , 看看里面的Swing set demo.程序片段:ImageIcon icon[] = new ImageIcon[6];icon[0] = createImageIcon("tabbedpane/ewan.gif", getString("TabbedPaneDemo.ewan")); icon[1] = createImageIcon("tabbedpane/stephen.gif", getString("TabbedPaneDemo.stephen")); icon[2] = createImageIcon("tabbedpane/david.gif", getString("TabbedPaneDemo.david")); icon[3] = createImageIcon("tabbedpane/matthew.gif", getString("TabbedPaneDemo.matthew")); icon[4] = createImageIcon("tabbedpane/blake.gif", getString("TabbedPaneDemo.blake")); icon[5] = createImageIcon("tabbedpane/brooke.gif", getString("TabbedPaneDemo.brooke"));public void paint(Graphics g) { g.setColor(getBackground()); g.fillRect(0, 0, getWidth(), getHeight()); for(int i = 0; i < numImages; i++) { if(x[i] > 3*i) { nudge(i); squish(g, icon[i], xh[i], yh[i], scale[i]); } else { x[i] += .05; y[i] += .05; } } }public void squish(Graphics g, ImageIcon icon, int x, int y, double scale) { if(isVisible()) { g.drawImage(icon.getImage(), x, y, (int) (icon.getIconWidth()*scale), (int) (icon.getIconHeight()*scale), this); } } 在线等。方法的重载和重写的区别 剪刀石头布的游戏,哪个高手帮帮看能优化不?? jar文件转换为exe Java中的Properties类保存丢失信息?! 问个eclipse和Matlab连接的问题 在access中如何用jdbc取出超长的字符串啊 请问一下如何模拟"ctrl"键???????????? 高手解答,何为并发?有分相送 该用什么编译器啊????? 怎么判断TextField里面没有内容? 往Vector里循环封装字符串数组的问题 关于垃圾收集器 finalize是每个类都必须有的吗
怎样改?能具体说说吗?谢谢!
程序片段:
ImageIcon icon[] = new ImageIcon[6];
icon[0] = createImageIcon("tabbedpane/ewan.gif", getString("TabbedPaneDemo.ewan"));
icon[1] = createImageIcon("tabbedpane/stephen.gif", getString("TabbedPaneDemo.stephen"));
icon[2] = createImageIcon("tabbedpane/david.gif", getString("TabbedPaneDemo.david"));
icon[3] = createImageIcon("tabbedpane/matthew.gif", getString("TabbedPaneDemo.matthew"));
icon[4] = createImageIcon("tabbedpane/blake.gif", getString("TabbedPaneDemo.blake"));
icon[5] = createImageIcon("tabbedpane/brooke.gif", getString("TabbedPaneDemo.brooke"));public void paint(Graphics g) {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight()); for(int i = 0; i < numImages; i++) {
if(x[i] > 3*i) {
nudge(i);
squish(g, icon[i], xh[i], yh[i], scale[i]);
} else {
x[i] += .05;
y[i] += .05;
}
}
}public void squish(Graphics g, ImageIcon icon, int x, int y, double scale) {
if(isVisible()) {
g.drawImage(icon.getImage(), x, y,
(int) (icon.getIconWidth()*scale),
(int) (icon.getIconHeight()*scale),
this);
}
}