netbeans - Java NetBeans 显示消息发送时间
问题描述
我制作了 Time 和 Date 类,以便在实际消息旁边显示消息发送的时间。
**类时间 { public static void Timu(String[] args){
LocalTime time = LocalTime.now();
System.out.println(time);
}
}**
**try{
s = new Socket("127.0.0.1",8189);
din = new DataInputStream(s.getInputStream());
dout = new DataOutputStream(s.getOutputStream());
String msgin="";
while(!msgin.equals("exit")){
msgin=din.readUTF();
Time a = new Time();
jTextArea1.setText(a.toString()+jTextArea1.getText().trim()+"\nServer:\t" + msgin);
}**
它不断给我类似 Chat.Time@100fc185 的结果,而不是实际的 LocaTime。
任何帮助将不胜感激。
解决方案
推荐阅读
- typescript - 如何在打字稿中以安全的方式从 WindowEventMap 引用 dom 事件名称?
- node.js - 如何使用 react/node 和 multer 上传多个文件
- typescript - 打字稿 - “X”类型的参数不能分配给“Y”类型的参数
- python - django模块'appname'没有属性'models'
- google-apps-script - Rhino Runtime 和 V8 在一起?
- r - R中矩阵的递归
- webkit - WebKit2.WebView(和 Gnome 浏览器)不播放 YouTube 视频
- react-native - 找不到函数`visibleFeatures`
- python - 在 windows10 上安装 pytorch/tensorflow 时访问被拒绝
- google-apps-script - 如何在 google appscripts 中自动更新代码更改