UI Swing turorial online.
Related page:
http://java.sun.com/docs/books/tutorial/uiswing/layout/spring.html
source code:
http://java.sun.com/docs/books/tutorial/uiswing/layout/examples/SpringDemo2.javaMy question is about this line:
SpringLayout layout = new SpringLayout();As we know, class SpringLayout is implemented the interface LayoutManger, so this SpringLayout-to-LayoutManager is is-a relation. But when I replace it by:
LayoutManager layout = new SpringLayout();
Problem occurs, the IDE indicates that methods cannot be found.Jeff Yan说过依赖于抽象的依赖反转原则DIP,这里怎么没有效果呢?我错哪里了?
Related page:
http://java.sun.com/docs/books/tutorial/uiswing/layout/spring.html
source code:
http://java.sun.com/docs/books/tutorial/uiswing/layout/examples/SpringDemo2.javaMy question is about this line:
SpringLayout layout = new SpringLayout();As we know, class SpringLayout is implemented the interface LayoutManger, so this SpringLayout-to-LayoutManager is is-a relation. But when I replace it by:
LayoutManager layout = new SpringLayout();
Problem occurs, the IDE indicates that methods cannot be found.Jeff Yan说过依赖于抽象的依赖反转原则DIP,这里怎么没有效果呢?我错哪里了?
解决方案 »
- freeMemory返回的是heap上还未使用的空间吗?
- 一个合并字冠的问题,估计没有描述清楚……,进贴看详细描述
- Java中的那些控件如何才能更好的控制啊?(比如说,JLabel,JButton, 文体框等啊)急啊!
- 关于接口中成员的问题
- 联系XML和JAVA需要什么机子装写什么?
- 什么是DLL,.NET,COM在JAVA 中有什么与之对应?
- 我新开了一个QQ群,叫近来兴JAVA,欢迎大家加进去讨论,号码是10973032
- 如果用JAVA监听80或其它的端口以截取所有访问者的信息
- help me
- Hello world程序简单问题??
- 学习JAVA的好地方(群号23539326)
- log4j配置问题
迪米特法则(law of Detemetr)说的是一个对象对其他对象的了解度应该是最少。而DIP说的依赖于抽象(比如接口)进行编程。比如ArrayList的建立:
List al = new ArrayList();而不是ArrayList al = new ArrayList();
http://www.javaworld.com.tw/jute/post/view?bid=29&id=167399&tpg=1&ppg=1&sty=1#167498