资源简介
中文转二进制,中文转二进制,中文转二进制
代码片段和文件信息
package com.hmilyld.jframe;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.Jframe;
import javax.swing.JLabel;
import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import javax.swing.JTextArea;
import com.hmilyld.tools.GetStr;
public class JframeMain extends Jframe{
private JTextArea text2;
private JTextArea text1;
/**
*
*/
private static final long serialVersionUID = 5525106323539851865L;
private Jframe frame;
private Clipboard clipbd = getToolkit().getSystemClipboard();
/**
* Launch the application
* @param args
*/
public static void main(String args[]) {
try {
JframeMain window = new JframeMain();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Create the application
*/
public JframeMain() {
initialize();
}
/**
* Initialize the contents of the frame
*/
private void initialize() {
frame = new Jframe();
frame.getContentPane().setLayout(null);
frame.settitle(“中文转换二进制工具(一切为了HX) By Hmilyld“);
frame.setBounds(100 100 419 400);
frame.setDefaultCloseOperation(Jframe.EXIT_ON_CLOSE);
frame.setResizable(false);
final JSeparator separator = new JSeparator();
separator.setBounds(0 339 413 20);
frame.getContentPane().add(separator);
final JLabel byHmilyld070831Label = new JLabel();
byHmilyld070831Label.setText(“By Hmilyld 07.08.31 http://www.hmilyld.cn“);
byHmilyld070831Label.setBounds(157 344 246 25);
frame.getContentPane().add(byHmilyld070831Label);
final JButton btn1 = new JButton();
btn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String text = GetStr.turnBin(text1.getText());
text2.setText(text);
}
});
btn1.setText(“中文->二进制“);
btn1.setBounds(10 310 117 23);
frame.getContentPane().add(btn1);
final JButton btn_2 = new JButton();
btn_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String text = GetStr.turnWord(text1.getText());
System.out.println(text);
text2.setText(text);
}
});
btn_2.setText(“二进制->中文“);
btn_2.setBounds(133 310 116 23);
frame.getContentPane().add(btn_2);
final JButton exit = new JButton();
exit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
exit.setText(“退出“);
exit.setBounds(255 310 72 23);
frame.getContentPane().add(exit);
final JButton copy = new JButton();
copy.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String copy = text2.getText();
StringSelection clipString = new StringSelection(copy);
clipbd.setContents(clipString clipString);
}
});
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
.CA.... 3749 2007-09-04 19:18 com\hmilyld\jfr
.C.D... 0 2007-09-04 19:18 com\hmilyld\jfr
.CA.... 4628 2007-09-04 19:22 com\hmilyld\tools\GetStr.java
.C.D... 0 2007-09-04 19:18 com\hmilyld\tools
.C.D... 0 2007-09-04 19:18 com\hmilyld
.C.D... 0 2007-09-04 19:18 com
----------- --------- ---------- ----- ----
8377 6
评论
共有 条评论