当前位置: 技术问答>java相关
请问Console.run()这条语句是出自那一个类库里面的??
来源: 互联网 发布时间:2015-07-28
本文导语: 大家看看下面的程序是错在什么地方? import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; import com.*; public class ShowHTML extends JApplet { JButton send = new JButton("Go"); JLabel l = new...
大家看看下面的程序是错在什么地方?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import com.*;
public class ShowHTML extends JApplet {
JButton send = new JButton("Go");
JLabel l = new JLabel();
public void init() {
Container cp = getContentPane();
cp.setLayout(new FlowLayout());
send.addActionListener(new Al());
cp.add(send);
cp.add(l);
}
class Al implements ActionListener {
public void actionPerformed(ActionEvent ae) {
try {
// This could be a CGI program instead of
// an HTML page.
URL u = new URL(getDocumentBase(),
"FetcherFrame.html");
// Display the output of the URL using
// the Web browser, as an ordinary page:
getAppletContext().showDocument(u);
} catch(Exception e) {
l.setText(e.toString());
}
}
}
public static void main(String[] args) {
Console.run(new ShowHTML(), 100, 50);
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.net.*;
import java.io.*;
import com.*;
public class ShowHTML extends JApplet {
JButton send = new JButton("Go");
JLabel l = new JLabel();
public void init() {
Container cp = getContentPane();
cp.setLayout(new FlowLayout());
send.addActionListener(new Al());
cp.add(send);
cp.add(l);
}
class Al implements ActionListener {
public void actionPerformed(ActionEvent ae) {
try {
// This could be a CGI program instead of
// an HTML page.
URL u = new URL(getDocumentBase(),
"FetcherFrame.html");
// Display the output of the URL using
// the Web browser, as an ordinary page:
getAppletContext().showDocument(u);
} catch(Exception e) {
l.setText(e.toString());
}
}
}
public static void main(String[] args) {
Console.run(new ShowHTML(), 100, 50);
}
}
|
是从thinking in java来搞来的?
应该是
import com.bruceeckel.swing.*;
或者是
import com.bruceeckel.util.*;
记不清楚了
应该是
import com.bruceeckel.swing.*;
或者是
import com.bruceeckel.util.*;
记不清楚了
|
老大, Console是Bruce Eckel自己为了方便调时小程序写的一个类,
路径...combruceeckelswingConsole.java
路径...combruceeckelswingConsole.java