楼主: omencathay

[精华] Think in java读书笔记

[复制链接]
论坛徽章:
0
251#
发表于 2005-1-5 10:33 | 只看该作者
臧圩人:“Thinking in java  ”你看完了吗???

你觉得怎么运用这本书才能发挥作用呢??

使用道具 举报

回复
论坛徽章:
0
252#
发表于 2005-1-10 19:37 | 只看该作者
有没有的共享啊???????????Think in java

使用道具 举报

回复
论坛徽章:
0
253#
发表于 2005-1-10 20:44 | 只看该作者
public Destination dest(String s) {
class PDestination
implements Destination {
private String label;
private PDestination(String whereTo) {
label = whereTo;
}
public String readLabel() { return label; }
}
return new PDestination(s);
}



我是這樣認為的
return new PDestination(s);昰對PDestination(string s)進行實例化,對一個類實例的同時會執行這個類,也就是在這時調用public String readLabel() { return label; }的

使用道具 举报

回复
论坛徽章:
0
254#
发表于 2005-1-13 14:47 | 只看该作者

不会吧

看到这里就到头啦,,,:(

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
255#
发表于 2005-1-14 21:57 | 只看该作者
请问:
//: c13:TrackEvent.java
// Show events as they happen.
// <applet code=TrackEvent
// width=700 height=500></applet>
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;

public class TrackEvent extends JApplet {
HashMap h = new HashMap();
String[] event = {
"focusGained", "focusLost", "keyPressed",
"keyReleased", "keyTyped", "mouseClicked",
"mouseEntered", "mouseExited","mousePressed",
"mouseReleased", "mouseDragged", "mouseMoved"
};
MyButton
b1 = new MyButton(Color.green, "test1",
b2 = new MyButton(Color.red, "test2";
class MyButton extends JButton {
void report(String field, String msg) {
((JTextField)h.get(field)).setText(msg);
}
FocusListener fl = new FocusListener() {
public void focusGained(FocusEvent e) {
report("focusGained", e.paramString());
}
public void focusLost(FocusEvent e) {
report("focusLost", e.paramString());
}
};
KeyListener kl = new KeyListener() {
public void keyPressed(KeyEvent e) {
report("keyPressed", e.paramString());
}
public void keyReleased(KeyEvent e) {
        report("keyReleased", e.paramString());
}
public void keyTyped(KeyEvent e) {
report("keyTyped", e.paramString());
}
};
MouseListener ml = new MouseListener() {
public void mouseClicked(MouseEvent e) {
report("mouseClicked", e.paramString());
}
public void mouseEntered(MouseEvent e) {
report("mouseEntered", e.paramString());
}
public void mouseExited(MouseEvent e) {
report("mouseExited", e.paramString());
}
public void mousePressed(MouseEvent e) {
report("mousePressed", e.paramString());
}
public void mouseReleased(MouseEvent e) {
report("mouseReleased", e.paramString());
}
};
MouseMotionListener mml =
new MouseMotionListener() {
public void mouseDragged(MouseEvent e) {
report("mouseDragged", e.paramString());
}
public void mouseMoved(MouseEvent e) {
report("mouseMoved", e.paramString());
}
};
public MyButton(Color color, String label) {
super(label);
setBackground(color);
addFocusListener(fl);
addKeyListener(kl);
addMouseListener(ml);
addMouseMotionListener(mml);
}
}
public void init() {
Container c = getContentPane();
c.setLayout(new GridLayout(event.length+1,2));
for(int i = 0; i < event.length; i++) {
JTextField t = new JTextField();
t.setEditable(true);
c.add(new JLabel(event, JLabel.RIGHT));
c.add(t);
h.put(event, t);
}
c.add(b1);
c.add(b2);
}
public static void main(String[] args) {
Console.run(new TrackEvent(), 700, 500);
}
} ///:~
上面这段代码中,init()代码段中的(JTextField) t是什么时候和怎么被赋值的,谢谢

使用道具 举报

回复
论坛徽章:
0
256#
发表于 2005-1-14 23:54 | 只看该作者
请问有谁有thinkin java(3rd edition)的习题答案,能否发我一分,我才刚开始看书.

使用道具 举报

回复
论坛徽章:
9
生肖徽章:马
日期:2006-09-07 17:03:04会员2007贡献徽章
日期:2007-09-26 18:42:10ITPUB9周年纪念徽章
日期:2010-10-08 09:32:27
257#
发表于 2005-1-19 10:24 | 只看该作者
up

使用道具 举报

回复
论坛徽章:
0
258#
发表于 2005-1-19 10:55 | 只看该作者
希望楼主继续写下去

使用道具 举报

回复
论坛徽章:
1
授权会员
日期:2005-10-30 17:05:33
259#
发表于 2005-1-19 23:34 | 只看该作者
谁有think in java  的pdf版的发给我一份,谢谢。lyl19820219@yeah.net

使用道具 举报

回复
论坛徽章:
0
260#
发表于 2005-1-21 16:25 | 只看该作者
最初由 lyl19820219 发布
[B]谁有think in java  的pdf版的发给我一份,谢谢。lyl19820219@yeah.net [/B]


看看http://www.wgqqh.com/shhgs/tij.html
中文第三版,翻得还不错

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表