Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 )
allenlee





发贴: 24
积分: 0
于 2004-08-26 14:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
{ 请尽量用准确的文字描述作为标题 }

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class WelcomeText{
public static void main(String args[])
{WelcomeFrame frame=new WelcomeFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}
class WelcomeFrame extends JFrame
{public WelcomeFrame()
{setTitle("LOGIN");
setSize(DEFAULT_WIDTH,DEFAULT_HEIGTH);
WelcomePanel panel=new WelcomePanel();
Container contentPane=getContentPane();
contentPane.add(panel);
}
public static final int DEFAULT_WIDTH=300;
public static final int DEFAULT_HEIGTH=200;
}
class WelcomePanel extends JPanel
{public WelcomePanel()
{JLabel prompt=new JLabel("请输入你的名字:");
final JTextField input=new JTextField(10);
final JTextField output=new JTextField(25);
JButton btnn=new JButton("login");
add(prompt);
add(input);
add(output);
add(btnn);
btnn.addActionListener(new
ActionListener()
{
public void actionPerformed(ActionEvent event)
{String s=input.getText();
output.setText("hello! "+s+" 欢迎加入我们的行列");
}
});
}
}
为什么程序执行后中文变成乱码??
需要什么转换吗??请指教.


why edited on 2004-08-26 19:06


话题树型展开
人气 标题 作者 字数 发贴时间
7961 求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 1131 2004-08-26 14:49
6819 Re:求助!!!高手指点. yangmin9702 29 2004-08-26 14:59
6597 Re:求助!!!高手指点. helloworld 29 2004-08-26 15:12
6957 Re:求助!!!高手指点. allenlee 42 2004-08-26 18:56
7005 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 29 2004-08-26 19:06
6732 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) 烂泥 9 2004-08-28 11:14
6922 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 41 2004-08-28 15:35
6625 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) nothing 81 2004-08-28 15:54
6866 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 20 2004-08-28 22:51
6858 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 14 2004-08-28 23:49
6825 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) yangmin9702 58 2004-08-30 09:11
6854 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 13 2004-08-30 16:45
7158 Re:求助!!!高手指点. (中文变成乱码:中文XP Prof+写字板 ) allenlee 40 2004-08-31 10:39

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923