这是JDK中的包吗?
应该不是吧,可能是第三方提供的。
应该不是吧,可能是第三方提供的。
解决方案 »
- 我把jScrollPane拖到JFrame窗体里之后该如何对它进行设置?
- 孙子类继承问题
- String 的疑惑。String a = "abc" 和String a = new String("abc")不同?
- JTable中如何实现如下功能?麻烦!
- 进度条怎么用?
- JAVA读取SQL2000数据的问题!
- 在swing下,如何控制Jbutton等元素的大小和位置。
- 200 读取数据库类型问题 ^_^ 走过路过千万别错过
- 麻烦大家帮我看看!:)感谢!
- 各位朋友:有没有当年毕业设计没有过的。
- 小妹请教一个问题?
- ####用过JBuilder的大侠都知道--关于CLASSPATH的问题--急!急!急!!!
其实里面就一个Console.java文件,给你贴一下吧
//: com:bruceeckel:swing:Console.java
// Tool for running Swing demos from the
// console, both applets and JFrames.
package com.bruceeckel.swing;
import javax.swing.*;
import java.awt.event.*;public class Console {
// Create a title string from the class name:
public static String title(Object o) {
String t = o.getClass().toString();
// Remove the word "class":
if(t.indexOf("class") != -1)
t = t.substring(6);
return t;
}
public static void setupClosing(JFrame frame) {
// The JDK 1.2 Solution as an
// anonymous inner class:
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
// The improved solution in JDK 1.3:
// frame.setDefaultCloseOperation(
// EXIT_ON_CLOSE);
}
public static void
run(JFrame frame, int width, int height) {
setupClosing(frame);
frame.setSize(width, height);
frame.setVisible(true);
}
public static void
run(JApplet applet, int width, int height) {
JFrame frame = new JFrame(title(applet));
setupClosing(frame);
frame.getContentPane().add(applet);
frame.setSize(width, height);
applet.init();
applet.start();
frame.setVisible(true);
}
public static void
run(JPanel panel, int width, int height) {
JFrame frame = new JFrame(title(panel));
setupClosing(frame);
frame.getContentPane().add(panel);
frame.setSize(width, height);
frame.setVisible(true);
}
} ///:~
或到www.bruceeckel.com下载《thinking in java》的code包