重金寻求答案 请详细一些可以吗?在哪里调用repait()? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 import java.awt.*;import java.applet.*;import java.awt.event.*;import javax.swing.*;/*<applet code=FirstTabbedPane.class width=400 height=200> <param name=string value="400"></applet>*/public class FirstTabbedPane extends JApplet{ public void init() { DisplayWithScrollbar intime= new DisplayWithScrollbar("P0000102.jpg"); DisplayWithScrollbar replay= new DisplayWithScrollbar("575.jpg"); DisplayWithScrollbar history= new DisplayWithScrollbar("575.jpg"); Container content = getContentPane(); JTabbedPane li = new JTabbedPane(); li.addTab("IntimeRecorder",intime); li.addTab("Replay",replay); li.addTab("HistoryRecorder",history); li.setTabPlacement(JTabbedPane.BOTTOM); content.setLayout(new BorderLayout()); content.add(li); }}import java.awt.*;import java.applet.*;import java.awt.event.*;import javax.swing.*;public class DisplayWithScrollbar extends Panel implements AdjustmentListener{ Scrollbar hScroll; textPanel t1; String Imgurl; public DisplayWithScrollbar(String url) { Imgurl=url; init(); } public void init() { setLayout(new BorderLayout()); hScroll=new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,100); add("South",hScroll); hScroll.setValue(100); hScroll.addAdjustmentListener(this); t1=new textPanel(); add("Center",t1); } public void adjustmentValueChanged(AdjustmentEvent e) { t1.x=(int)(t1.location*(float)hScroll.getValue()/100); t1.x*=-1;// t1.y=(int)(getSize().height*(float)vScroll1.getValue()/100); t1.repaint(); } class textPanel extends Panel { // ImageIcon icon=new ImageIcon(Imgurl); Image image =icon.getImage(); int i=400; int j=icon.getIconWidth(); int x=i-j-4; int location=j-i+4; public textPanel() { } public void paint(Graphics g) { g.clearRect(0,0,800,500); g.drawImage(image,x,0,this);// g.drawString(String.valueOf(j),50,50);// g.drawString(String.valueOf(i),50,80); } } } 在APPLETVIEWER中通过,在IE中需要授权。数字签名后,在IE中只显示控件,不显示图象。请大家帮忙。多谢。 你先看看JAVA 控制台里有没有错误输出 jboss5.1下面部署war包 为啥不能自动解压呢! 很多球,红的,蓝的,绿的……,不定时增加,如何随时知道某种颜色球的数目?给个最简单的方案。 求一算数题 讨论介绍下学习struts书籍 想实现这样一种功能,好像很难的样子... eclipse+lomboz+jboss运行EJB出错!!请教高手!!! tomcat怎样设置才能使提交表单后进入程序? 关于JBOSS的问题 开发web server的环境,请大人执教! 什么情况下使用安全队列?ConcurrentLinkedQueue 调用ejb出错了 !!求救! 敬请J2ee架构高手不吝赐教
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
/*
<applet
code=FirstTabbedPane.class
width=400
height=200>
<param name=string value="400">
</applet>
*/
public class FirstTabbedPane extends JApplet
{
public void init()
{
DisplayWithScrollbar intime= new DisplayWithScrollbar("P0000102.jpg");
DisplayWithScrollbar replay= new DisplayWithScrollbar("575.jpg");
DisplayWithScrollbar history= new DisplayWithScrollbar("575.jpg");
Container content = getContentPane();
JTabbedPane li = new JTabbedPane();
li.addTab("IntimeRecorder",intime);
li.addTab("Replay",replay);
li.addTab("HistoryRecorder",history);
li.setTabPlacement(JTabbedPane.BOTTOM);
content.setLayout(new BorderLayout());
content.add(li);
}
}import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
public class DisplayWithScrollbar extends Panel implements AdjustmentListener
{
Scrollbar hScroll;
textPanel t1;
String Imgurl;
public DisplayWithScrollbar(String url)
{
Imgurl=url;
init();
}
public void init()
{
setLayout(new BorderLayout());
hScroll=new Scrollbar(Scrollbar.HORIZONTAL,0,0,0,100);
add("South",hScroll);
hScroll.setValue(100);
hScroll.addAdjustmentListener(this); t1=new textPanel();
add("Center",t1);
} public void adjustmentValueChanged(AdjustmentEvent e)
{
t1.x=(int)(t1.location*(float)hScroll.getValue()/100);
t1.x*=-1;
// t1.y=(int)(getSize().height*(float)vScroll1.getValue()/100);
t1.repaint();
}
class textPanel extends Panel
{
//
ImageIcon icon=new ImageIcon(Imgurl);
Image image =icon.getImage();
int i=400;
int j=icon.getIconWidth();
int x=i-j-4;
int location=j-i+4;
public textPanel()
{
}
public void paint(Graphics g)
{
g.clearRect(0,0,800,500);
g.drawImage(image,x,0,this);
// g.drawString(String.valueOf(j),50,50);
// g.drawString(String.valueOf(i),50,80);
} }
}
请大家帮忙。多谢。