一个APPLET程序的代码看不懂,求救 downloadhttp://www.bodytag.org/nav.php?u=grid2/grid2.jar, and decompile it to view source code. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 sorry, i don't know how to decompile it. i decompreeed it ,and get some class files. i want to get java source code. How to do it?thanks indeed download jad from http://kpdus.tripod.com/jad/winnt/jadnt158.zipuse command jad -sjava *.class to decomplie classes in grid2.jar;after decompile, open those java files in jbuilder, and jbuilder will report errors; modify two methods of BGraphics.java public byte[] loadBytes(String s) { try { ByteArrayOutputStream bytearrayoutputstream; InputStream inputstream = loadStream(s); BufferedInputStream bufferedinputstream = new BufferedInputStream( inputstream); bytearrayoutputstream = new ByteArrayOutputStream(); for (int i = bufferedinputstream.read(); i != -1; i = bufferedinputstream.read()) bytearrayoutputstream.write(i); return bytearrayoutputstream.toByteArray(); } catch( IOException ioexception) { ioexception.printStackTrace(); } return null; } public String[] loadStrings(String s) { String as[]; int i; try { BufferedReader bufferedreader = new BufferedReader(new InputStreamReader( loadStream(s))); as = new String[100]; i = 0; for (String s1 = null; (s1 = bufferedreader.readLine()) != null; ) { if (i == as.length) { String as1[] = new String[i << 1]; System.arraycopy(as, 0, as1, 0, i); as = as1; } as[i++] = s1; } bufferedreader.close(); if (i == as.length) return as; String as2[]; as2 = new String[i]; System.arraycopy(as, 0, as2, 0, i); return as2; } catch( IOException ioexception) {// ioexception; ioexception.printStackTrace(); } return null; }modify BApplet.java public static void main(String args[]) { if(args.length != 1) { System.err.println("error: BApplet <appletname>"); System.exit(1); } try { Frame frame = new Frame(); Class class1 = Class.forName(args[0]); BApplet bapplet = (BApplet)class1.newInstance(); bapplet.init(); bapplet.start(); Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); frame.setLayout(new BorderLayout()); frame.add(bapplet, "Center"); frame.pack(); frame.setLocation((dimension.width - bapplet.g.width) / 2, (dimension.height - bapplet.g.height) / 2); frame.show(); bapplet.requestFocus(); frame.addWindowListener(bapplet.new _cls1());//change new to bapplet.new } catch(Exception exception) { exception.printStackTrace(); System.exit(1); } }Then you are able to compile them error free 计算浮点数4.78的整数部分和小数部分 一道Java题,三个问题 刚学 JAVA 见了好几次人们说 正则表达式 什么意思了? JCS如何配置ceche.ccf SQL SERVER 乱码问题,急!!!(新手) >>>jsp页面中调用dll文件的问题,救命啊<<< 如何利用sax对xml文件内容进行循环读取? Port到byte的转换,捆扰我几天的问题了? David 的求职历程(全程报道长达16天的求职过程) 如何把JAVA应用程序窗口上的咖啡杯图标换掉?(记得有人提过这个问题的,但是找不到了) 哪位仁兄有JAVA五子棋原代码 one.addItemListener(this); 什么意思
thanks indeed
use command jad -sjava *.class to decomplie classes in grid2.jar;
after decompile, open those java files in jbuilder, and jbuilder will report errors;
modify two methods of BGraphics.java
public byte[] loadBytes(String s)
{
try
{
ByteArrayOutputStream bytearrayoutputstream;
InputStream inputstream = loadStream(s);
BufferedInputStream bufferedinputstream = new BufferedInputStream(
inputstream);
bytearrayoutputstream = new ByteArrayOutputStream();
for (int i = bufferedinputstream.read(); i != -1;
i = bufferedinputstream.read())
bytearrayoutputstream.write(i); return bytearrayoutputstream.toByteArray();
}
catch( IOException ioexception)
{ ioexception.printStackTrace();
}
return null;
} public String[] loadStrings(String s)
{
String as[];
int i;
try
{
BufferedReader bufferedreader = new BufferedReader(new InputStreamReader(
loadStream(s)));
as = new String[100];
i = 0;
for (String s1 = null; (s1 = bufferedreader.readLine()) != null; ) {
if (i == as.length) {
String as1[] = new String[i << 1];
System.arraycopy(as, 0, as1, 0, i);
as = as1;
}
as[i++] = s1;
} bufferedreader.close();
if (i == as.length)
return as;
String as2[];
as2 = new String[i];
System.arraycopy(as, 0, as2, 0, i);
return as2;
}
catch( IOException ioexception)
{
// ioexception;
ioexception.printStackTrace();
}
return null;
}
modify BApplet.java
public static void main(String args[])
{
if(args.length != 1)
{
System.err.println("error: BApplet <appletname>");
System.exit(1);
}
try
{
Frame frame = new Frame();
Class class1 = Class.forName(args[0]);
BApplet bapplet = (BApplet)class1.newInstance();
bapplet.init();
bapplet.start();
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLayout(new BorderLayout());
frame.add(bapplet, "Center");
frame.pack();
frame.setLocation((dimension.width - bapplet.g.width) / 2, (dimension.height - bapplet.g.height) / 2);
frame.show();
bapplet.requestFocus();
frame.addWindowListener(bapplet.new _cls1());//change new to bapplet.new
}
catch(Exception exception)
{
exception.printStackTrace();
System.exit(1);
}
}
Then you are able to compile them error free