麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 學院 > 開發設計 > 正文

Java中文問題集錦

2019-11-18 14:30:48
字體:
來源:轉載
供稿:網友

  解決java中文問題:
  針對applet和awt:
  1.
  Font f = new Font(UIResource.getString( "Default_font"),Font.PLAIN,12);
  UIManager.put("Label.font",f);
  UIManager.put("Label.foreground",Color.black);
  UIManager.put("Button.font",f);
  UIManager.put("Menu.font",f);
  UIManager.put("MenuItem.font",f);
  UIManager.put("List.font",f);
  UIManager.put("CheckBox.font",f);
  UIManager.put("RadioButton.font",f);
  UIManager.put("ComboBox.font",f);
  UIManager.put("TextArea.font",f);
  
  2.
  Font f = new Font("隸書",Font.PLAIN,15);
  UIManager.put("Button.font",font);
  UIManager.put("ToggleButton.font",font);
  UIManager.put("RadioButton.font",font);
  UIManager.put("CheckBox.font",font);
  UIManager.put("ColorChooser.font",font);
  UIManager.put("ToggleButton.font",font);
  UIManager.put("ComboBox.font",font);
  UIManager.put("ComboBoxItem.font",font);
  UIManager.put("InternalFrame.titleFont",font);
  UIManager.put("Label.font",font);
  UIManager.put("List.font",font);
  UIManager.put("MenuBar.font",font);
  UIManager.put("Menu.font",font);
  UIManager.put("MenuItem.font",font);
  UIManager.put("RadioButtonMenuItem.font",font);
  UIManager.put("CheckBoxMenuItem.font",font);
  UIManager.put("PopupMenu.font",font);
  UIManager.put("OptionPane.font",font);
  UIManager.put("Panel.font",font);
  UIManager.put("  UIManager.put("ScrollPane.font",font);
  UIManager.put("Viewport",font);
  UIManager.put("TabbedPane.font",font);
  UIManager.put("TableHeader.font",font);
  UIManager.put("TextField.font",font);
  UIManager.put("Pass
WordFiled.font",font);
  UIManager.put("TextArea.font",font);
  UIManager.put("TextPane.font",font);
  UIManager.put("EditorPane.font",font);
  UIManager.put("TitledBorder.font",font);
  UIManager.put("ToolBar.font",font);
  UIManager.put("ToolT  UIManager.put("Tree.font",font);
  
  3.針對
jsp和servlet:
  解決辦法:
  第一:
  1:在jsp頁面加入:
  <%@ page contentType="text/Html; charset=gb2312" %>
  2:在servlet里面:
  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  response.setContentType("text/html; charset=gb2312");//這是重要的
  
  3:上面的假如在不行就用如下的方法在數據入庫前進行調用:
  public static String UnicodeToChinese(String s){
  try{
  if(s==nulls.equals("")) return "";
  String newstring=null;
  newstring=new String(s.getBytes("ISO8859_1"),"gb2312");
  return newstring;
  }
  catch(UnsupportedEncodingException e)
  {
  return s;
  }
  }
  
  public static String ChineseToUnicode(String s){
  try{
  if(s==nulls.equals("")) return "";
  String newstring=null;
  newstring=new String(s.getBytes("gb2312"),"ISO8859_1");
  return newstring;
  }
  catch(UnsupportedEncodingException e)
  {
  return s;
  }
  }
  
  4.解決weblogic/webshpere中文問題:
  在web.xml文件中需要配置中文環境。r如下:
  <context-param>
  <param-name>weblogic.httpd.inputCharset./*</param-name>
  <param-value>GB2312</param-value>
  </context-param>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 国产精品色在线网站 | 热久久91| 黄色成人av在线 | 久久成人免费网站 | 免费小毛片 | 国语自产免费精品视频在 | 在线成人看片 | 视频一区 在线 | 国产亚洲精品美女久久久 | 成人在线观看一区 | av不卡免费在线 | 欧美一级黄色免费 | 精品国产高清一区二区三区 | 久久久久国产成人免费精品免费 | 搜一级毛片 | 中文字幕在线视频网站 | 91九色福利 | 欧美在线一级 | 欧美精品一级 | 亚洲最大中文字幕 | 久久99国产视频 | 超碰97最新 | 国产高潮好爽好大受不了了 | 日韩欧美综合在线 | 一级毛片在线免费观看视频 | 伊人av影院| 欧美三级日本三级少妇99 | 女人裸体让男人桶全过程 | avlululu| 精品午夜影院 | 北原夏美av | 欧美成人精品一级 | 在线观看视频亚洲 | 国产一区二区成人在线 | 91精品国产91久久久久久吃药 | 欧美日韩免费一区 | 欧美一级黄| 亚洲一区 国产精品 | 在线播放亚洲精品 | 久久久无码精品亚洲日韩按摩 | 欧美激情性色生活片在线观看 |