运行时出现 at java.io.DataInputStream.readFully(Unknown Source),求解决, 20
服务器已打开java.io.EOFExceptionatjava.io.DataInputStream.readFully(UnknownSource)atjava.io...
服务器已打开
java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
kkkkkkkkkkk
at com.hisoft.client.Client1.client(Client1.java:26)
at com.hisoft.frame.FlightFrame.main(FlightFrame.java:298)
字数限制 ,有些代码没弄
public class KeFu implements ActionListener{
public Box vbox52;
JButton button51;
JTextField jtf;
public static JTextArea jta;
public void kefu() {
JLabel jlb51 = new JLabel("欢迎您来到国航订票系统,如您遇到问题请在下面提问!");
System.out.println("服务器已打开");
jta = new JTextArea(15, 40);
jta.setEditable(true);
JScrollPane jsp51 = new JScrollPane(jta);
JLabel jlb52 = new JLabel("请输入:");
jtf = new JTextField(15);
button51 = new JButton("发送");
Box hbox51 = Box.createHorizontalBox();
hbox51.add(jlb52);
hbox51.add(jtf);
hbox51.add(button51);
vbox52 = Box.createVerticalBox();
vbox52.add(Box.createVerticalStrut(10));
vbox52.add(jlb51);
vbox52.add(Box.createVerticalStrut(10));
vbox52.add(jsp51);
vbox52.add(Box.createVerticalStrut(20));
vbox52.add(hbox51);
button51.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(button51)) {
// 和服务器咨询
String s = jtf.getText();
jtf.setText("");
System.out.println(s);
Client1 ct=new Client1();
try {
ct.out.writeUTF(s);//向服务器端输入咨询
jta.append(("\n" +"您:"+ s));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
其中涉及到三个类 展开
java.io.EOFException
at java.io.DataInputStream.readFully(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
at java.io.DataInputStream.readUTF(Unknown Source)
kkkkkkkkkkk
at com.hisoft.client.Client1.client(Client1.java:26)
at com.hisoft.frame.FlightFrame.main(FlightFrame.java:298)
字数限制 ,有些代码没弄
public class KeFu implements ActionListener{
public Box vbox52;
JButton button51;
JTextField jtf;
public static JTextArea jta;
public void kefu() {
JLabel jlb51 = new JLabel("欢迎您来到国航订票系统,如您遇到问题请在下面提问!");
System.out.println("服务器已打开");
jta = new JTextArea(15, 40);
jta.setEditable(true);
JScrollPane jsp51 = new JScrollPane(jta);
JLabel jlb52 = new JLabel("请输入:");
jtf = new JTextField(15);
button51 = new JButton("发送");
Box hbox51 = Box.createHorizontalBox();
hbox51.add(jlb52);
hbox51.add(jtf);
hbox51.add(button51);
vbox52 = Box.createVerticalBox();
vbox52.add(Box.createVerticalStrut(10));
vbox52.add(jlb51);
vbox52.add(Box.createVerticalStrut(10));
vbox52.add(jsp51);
vbox52.add(Box.createVerticalStrut(20));
vbox52.add(hbox51);
button51.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if (e.getSource().equals(button51)) {
// 和服务器咨询
String s = jtf.getText();
jtf.setText("");
System.out.println(s);
Client1 ct=new Client1();
try {
ct.out.writeUTF(s);//向服务器端输入咨询
jta.append(("\n" +"您:"+ s));
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
}
其中涉及到三个类 展开
2个回答
2013-07-19
展开全部
这样的通讯,一样是按行发、按行读
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询