帮我看看这段程序吧?我快急死了。!!!!!!!!!:(__ 不会java只能显示几百k的图片吧??我要显示的图片可有几十m的。该怎么办呀? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我现在改成不用vector了。我还是报错!!我婚import javax.swing.*;import java.awt.*;import java.util.*;import java.io.*;public class test extends JFrame{ public static void main(String args[]) {int big=1000*1000;byte[] buffer=new byte[big]; Vector v=new Vector(); try{ BufferedInputStream in = new BufferedInputStream(new FileInputStream("xdtext.jpg"));int ii;int i=0;while((ii=in.read())!=-1 && i<(big)){ buffer[i++]=(byte)ii;}}catch(IOException e){}System.out.println("OK!!!!");System.out.println("buf.size="+buffer.length);final Image map = Toolkit.getDefaultToolkit().createImage(buffer); JPanel myP=new JPanel(){ public void paintComponent(Graphics g) { super.paintComponent(g); g.drawImage(map,0,0,null); g.drawLine(0,0,100,100); } }; test t=new test(); t.getContentPane().add(myP); t.setBounds(100,100,200,200); t.show(); }} 不会吧?我的大图是用photo该的。大伙帮帮忙!!谢了先 selector 诡异的问题 刚刚看了关于JAVA的一本书,遇到点问题,请教!!! 怎样写个程序实现把n张JPG格式的图片制作成一个 gif 文件 最近玩RoboCode觉得很有意思!我想应该有不少人在玩吧,也许你也写出了非常不错的robot!如果有兴趣,欢迎在这讨论:) 用jubilder 编写的.java和.class,好像不能直接用java.exe 运行 可以这样理解Container吗? 事件监听器的问题 一个关于字符串比较的问题。 菜鸟问题 急!请解释一下QueryDescriptor类!在线等待。 高手帮忙,怎么写一个SQL语句? 如何加入CheckBox?很急
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.io.*;public class test extends JFrame
{
public static void main(String args[])
{
int big=1000*1000;
byte[] buffer=new byte[big];
Vector v=new Vector();
try{
BufferedInputStream in = new BufferedInputStream(new FileInputStream("xdtext.jpg"));
int ii;
int i=0;
while((ii=in.read())!=-1 && i<(big))
{
buffer[i++]=(byte)ii;
}
}catch(IOException e){}
System.out.println("OK!!!!");
System.out.println("buf.size="+buffer.length);
final Image map = Toolkit.getDefaultToolkit().createImage(buffer);
JPanel myP=new JPanel(){
public void paintComponent(Graphics g)
{
super.paintComponent(g);
g.drawImage(map,0,0,null);
g.drawLine(0,0,100,100);
}
}; test t=new test();
t.getContentPane().add(myP);
t.setBounds(100,100,200,200);
t.show();
}
}