java 板


LINE

-------------------------------------------------------------------------------- http://www.neshkov.com/dj.html 用以上的decompiler将以下网页的class档反编译 http://ngsir.netfirms.com/englishhtm/RLC.htm (有RLC.class和circuit.class和signal.class三个类别档) 我有疑问的是,这三个档被decompile出来後的source code例如RLC.java : -- <code> import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.EventObject; public class RLC extends Applet implements AdjustmentListener, ActionListener { public RLC() { } public void init() { setBackground(Color.white); setBounds(0, 0, 750, 500); mt = new MediaTracker(this); rcl = getImage(getCodeBase(), "rcl2.gif"); formula = getImage(getCodeBase(), "formula.gif"); formula2 = getImage(getCodeBase(), "formula2.gif"); formula3 = getImage(getCodeBase(), "formula3.gif"); mt.addImage(rcl, 1); mt.addImage(formula, 2); mt.addImage(formula2, 3); mt.addImage(formula3, 4); for(int i = 1; i <= 4; i++) { try { mt.waitForID; } catch(InterruptedException interruptedexception) { } if(mt.isErrorID) return; } amplitudeScrollbar = new Scrollbar(0, 8, 0, 2, 11); frequencyScrollbar = new Scrollbar(0, 346, 0, 100, 660); RScrollbar = new Scrollbar(0, 16, 0, 10, 100); CScrollbar = new Scrollbar(0, 260, 0, 50, 500); LScrollbar = new Scrollbar(0, 250, 0, 50, 500); pause = new Button("Pause"); step = new Button("Step"); amplitudeLabel = new Label("Vo = " + String.valueOf(amplitudeScrollbar.getValue()) + " V", 2); frequencyLabel = new Label("f = " + String.valueOf(0.10000000000000001D * (double)frequencyScrollbar.getValue()) + " Hz", 2); resistanceLabel = new Label("R = " + String.valueOf(0.10000000000000001D * (double)RScrollbar.getValue()) + " Ohm", 2); capacitanceLabel = new Label("C = " + String.valueOf(2 * CScrollbar.getValue()) + " microF", 2); inductanceLabel = new Label("L = " + String.valueOf((double)Math.round(2000D * (double)LScrollbar.getValue()) / 10000D) + " mH", 2); dummy = new Label(" "); offimg = createImage(getSize().width, getSize().height); offg = offimg.getGraphics(); circuit = new Circuit(offg, offimg, rcl, formula, formula2, formula3); circuit.Vo = amplitudeScrollbar.getValue(); circuit.omega = 0.62831999999999999D * (double)frequencyScrollbar.getValue(); circuit.R = 0.10000000000000001D * (double)RScrollbar.getValue(); circuit.C = 1.9999999999999999E-006D * (double)CScrollbar.getValue(); circuit.L = 0.00020000000000000001D * (double)LScrollbar.getValue(); amplitudeScrollbar.addAdjustmentListener(this); frequencyScrollbar.addAdjustmentListener(this); RScrollbar.addAdjustmentListener(this); CScrollbar.addAdjustmentListener(this); LScrollbar.addAdjustmentListener(this); pause.addActionListener(this); step.addActionListener(this); signal = new Signal(circuit); Panel panel = new Panel(); GBC = new GridBagConstraints(); GB = new GridBagLayout(); panel.setLayout(G; GBC.fill = 2; GBC.insets = new Insets(3, 3, 3, 3); GBC.ipadx = 10; GBC.gridx = 0; GBC.gridy = 0; GB.setConstraints(amplitudeLabel, GBC); panel.add(amplitudeLabel); GBC.ipadx = 30; GBC.gridx = 1; GB.setConstraints(amplitudeScrollbar, GBC); panel.add(amplitudeScrollbar); GBC.ipadx = 30; GBC.gridx = 2; GB.setConstraints(frequencyLabel, GBC); panel.add(frequencyLabel); GBC.ipadx = 30; GBC.gridx = 3; GB.setConstraints(frequencyScrollbar, GBC); panel.add(frequencyScrollbar); GBC.ipadx = 10; GBC.gridx = 4; GB.setConstraints(pause, GBC); panel.add(pause); GBC.gridx = 5; GB.setConstraints(step, GBC); panel.add(step); GBC.gridx = 0; GBC.gridy = 1; GB.setConstraints(resistanceLabel, GBC); panel.add(resistanceLabel); GBC.gridx = 1; GB.setConstraints(RScrollbar, GBC); panel.add(RScrollbar); GBC.gridx = 2; GB.setConstraints(capacitanceLabel, GBC); panel.add(capacitanceLabel); GBC.gridx = 3; GB.setConstraints(CScrollbar, GBC); panel.add(CScrollbar); GBC.gridx = 4; GB.setConstraints(inductanceLabel, GBC); panel.add(inductanceLabel); GBC.ipadx = 30; GBC.gridx = 5; GB.setConstraints(LScrollbar, GBC); panel.add(LScrollbar); setLayout(new BorderLayout()); add(circuit, "Center"); add(panel, "South"); circuit.calculate(); signal.start(); } public void actionPerformed(ActionEvent actionevent) { if(actionevent.getSource() == pause) { circuit.pause = !circuit.pause; if(circuit.pause) { pause.setLabel("Continue"); } else { pause.setLabel("Pause"); circuit.step = false; } } if(actionevent.getSource() == step) { circuit.step = true; circuit.pause = true; pause.setLabel("Continue"); } } public void adjustmentValueChanged(AdjustmentEvent adjustmentevent) { if(adjustmentevent.getSource() == amplitudeScrollbar) { amplitudeLabel.setText("Vo = " + String.valueOf(amplitudeScrollbar.getValue()) + " V"); circuit.Vo = amplitudeScrollbar.getValue(); } if(adjustmentevent.getSource() == frequencyScrollbar) { frequencyLabel.setText("f = " + String.valueOf((1.0D * (double)frequencyScrollbar.getValue()) / 10D) + " Hz"); double d = circuit.omega; circuit.omega = 0.62831999999999999D * (double)frequencyScrollbar.getValue(); circuit.t = (d * circuit.t) / circuit.omega; } if(adjustmentevent.getSource() == RScrollbar) { resistanceLabel.setText("R = " + String.valueOf((1.0D * (double)RScrollbar.getValue()) / 10D) + " Ohm"); circuit.R = 0.10000000000000001D * (double)RScrollbar.getValue(); } if(adjustmentevent.getSource() == CScrollbar) { capacitanceLabel.setText("C = " + String.valueOf(2 * CScrollbar.getValue()) + " microF"); circuit.C = 1.9999999999999999E-006D * (double)CScrollbar.getValue(); } if(adjustmentevent.getSource() == LScrollbar) { inductanceLabel.setText("L = " + String.valueOf((double)Math.round(2000D * (double)LScrollbar.getValue()) / 10000D) + " mH"); circuit.L = 0.00020000000000000001D * (double)LScrollbar.getValue(); } circuit.calculate(); circuit.repaint(); } int xx; int yy; Label amplitudeLabel; Label frequencyLabel; Label resistanceLabel; Label capacitanceLabel; Label inductanceLabel; Label dummy; Scrollbar amplitudeScrollbar; Scrollbar frequencyScrollbar; Scrollbar RScrollbar; Scrollbar CScrollbar; Scrollbar LScrollbar; Button pause; Button step; Circuit circuit; Signal signal; Graphics offg; Image offimg; Image rcl; Image formula; Image formula2; Image formula3; MediaTracker mt; GridBagLayout GB; GridBagConstraints GBC; } </code> -- 里头的circuit物件应该是属於circuit类别档的成员,但是一开始import部分却没有看到 ? 是不是这个decompiler有问题,还是某种javac允许编译过程某些物件暂时未宣告继承来 源? --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 114.44.115.138
2F:→ serveto:感谢楼上大大。我的问题是,单独将RLC.java作编译 09/23 09:26
3F:→ serveto:javac显示circuit无效的type(因为没有import) 09/23 09:27
4F:→ tkcn:我只是告诉你,那个档案是存在的,至於为什麽不用写 import 09/23 09:34
5F:→ tkcn:你可以再多想一下 09/23 09:36
6F:→ serveto:不好意思我是新手。现在事实上就是我用javac去执行 09/23 09:41
7F:→ serveto:作不出来 09/23 09:43
8F:推 nvidia:找个applet的文件来看 09/23 09:50







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:iOS站内搜寻

TOP