日期:2014-05-20  浏览次数:20763 次

求高手点拨“一个乱码Java源文件”的转换方案.
高手,您好:
    我有一份Java的原代码文件,在我的机器上,他的源代码如下:
    
package com.ccc520.component;

import javax.swing.JFrame;
import javax.swing.UIManager;

public class Test {

public static void main(String[] args) {

try {
UIManager.setLookAndFeel("com.ccc520.laf.IMLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}

final JFrame jf = new IMFrame("鐒︺€亅浼婄瑧","/gj//lol/銆庢垜鍕掍釜鍘伙紝涔熷氨閭g偣浜嬪憲鈥︺€?","/resource/head.jpg");

/*final JPopupMenu jpm = new JPopupMenu("hehe");

jpm.setLayout(new VerticalLayout(22));
jpm.setPreferredSize(new Dimension(145,95));

IMPopupItem popupItem1 = new IMPopupItem("/resource/aio_quickbar_cut.png","鍙戦€佹枃浠?);
IMPopupItem popupItem2 = new IMPopupItem("/resource/aio_quickbar_more.png","鎵嬫満涓€璧风帺娓告垙");
IMPopupItem popupItem3 = new IMPopupItem("/resource/aio_quickbar_register.png","璐粯閫?);
IMPopupItem popupItem4 = new IMPopupItem("/resource/aio_quickbar_richface.png","鍒犻櫎濂藉弸");

jpm.add(popupItem1);
jpm.add(popupItem2);
jpm.add(new JSeparator());
jpm.add(popupItem3);
jpm.add(popupItem4);

IMPanel panel = new IMPanel(new Color(32,127,168),new Color(61,143,195),IMPanel.TOP_BOTTOM);
panel.setPreferredSize(new Dimension(0,40));

panel.setLayout(new FlowLayout(FlowLayout.LEFT,2,8));
panel.add(new IMMenuButton("/resource/b6m0_0.png"));
panel.add(new IMMenuButton("/resource/b7m0_0.png"));
panel.add(new IMMenuButton("/resource/b8m0_0.png"));
panel.add(new IMMenuButton("/resource/b9m0_0.png"));
panel.add(new IMMenuButton("/resource/b1m0_0.png"));
panel.add(new IMMenuButton("/resource/b20m0_0.png"));

jf.add(panel,BorderLayout.NORTH);

JPanel contentPanel = new JPanel();
contentPanel.setOpaque(false);
jf.add(contentPanel);

contentPanel.setLayout(new BorderLayout());

JPanel showPanel = new JPanel();
showPanel.setBorder(new LineBorder(Color.LIGHT_GRAY));
showPanel.setPreferredSize(new Dimension(140,0));

contentPanel.add(showPanel,BorderLayout.EAST);

JPanel textPanel = new JPanel();
textPanel.setLayout(new BorderLayout());

JTextPane jtp = new JTextPane();
jtp.setEditable(false);
jtp.setPreferredSize(new Dimension(0,280));

JScrollPane jsp = new JScrollPane(jtp);
jsp.setBorder(null);

textPanel.add(jsp,BorderLayout.NORTH);

IMPanel bottomPanel = new IMPanel(new Color(195,220,237),new Color(222,236,245),IMPanel.LEFT_RIGHT);
bottomPanel.setPreferredSize(new Dimension(0,32));
bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT,5,3));

textPanel.add(bottomPanel,BorderLayout.SOUTH);

JPanel talkContent = new JPanel();
talkContent.setOpaque(false);

IMPanel controlPanel = new IMPanel(new Color(195,220,237),new Color(222,236,245),IMPanel.LEFT_RIGHT);
controlPanel.setPreferredSize(new Dimension(0,26));
controlPanel.setLayout(new FlowLayout(FlowLayout.LEFT,5,2));

talkContent.setLayout(new BorderLayout());
talkContent.add(controlPanel,BorderLayout.NORTH);

Dimension d = new Dimension(22,22);
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_cut.png",d));
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_flirtationface.png",d));
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_inputassist.png",d));
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_more.png",d));
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_register.png",d));
controlPanel.add(new IMMenuButton("/resource/aio_quickbar_richface.png",d));

textPanel.add(talkContent);

JTextPane inputPane = new JTextPane();
JScrollPane jsp1 = new JScrollPane(inputPane);
jsp1.setBorder(null);
talkContent.add(jsp1);


IMButton jb = new IMButton("鍏抽棴(C)");
bottomPanel.add(jb);

IMPopupButton popupButton = new IMPopupButton("鍙戦€?S)");
popupButton.setTriglePopupMenu(jpm);
popupButton.setOneShowLeft(true);

bottomPanel.add(popupButton);

contentPanel.add(textPanel);*/


jf.setVisible(true);


}
}

    我对于乱码的处理,还不是很有经验,第一反应,我将本文件用EditPlus打开,并且进入了“转存”的界面,EditPlus给我的结果是:“本文件为utf8”的编码格式:
    
    于是我打开了我的MyEclipse,将编码格式设置为:
    utf8的格式:
    
    按照道理来说,我的MyEclipse中的上述代码,应该没有“乱码”了..
    但是,现在我的代码,如我贴出的内容一样,在我的MyEclipse中,“躺着”上面代码中的乱码..
    希望得到高手的点拨:
    我的程序,什么地方出问题了..?
    怎么修改..?
    谢谢高手!!