⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 application.java

📁 DES的java代码,有界面,好用,是个很好的学习的例子
💻 JAVA
字号:
package Application;

import java.awt.Color;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;

import DES.fileDES;
import RSA.fileRSA;

public class application extends JFrame {

	/**
	 * Launch the application
	 * @param args
	 *
	 */
	private static fileDES desdialog;
	private static fileRSA rsadialog;
	public static void main(String args[]) {	
		try {
			application frame = new application();
			frame.setLayout(null);
			frame.setBounds(100, 100, 500, 375);
			frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
			frame.setVisible(true);
		} catch (Exception e) {
			e.printStackTrace();
		}
		


	}

	/**
	 * Create the frame
	 */
	public application() {
		super();
		getContentPane().setLayout(null);
		setFocusCycleRoot(false);

	    
		
		final JButton button_1 = new JButton();
		button_1.addMouseListener(new MouseAdapter() {
			public void mouseClicked(final MouseEvent arg0) {
				
				
				desdialog=fileDES.getfileDES();
				try {
					
					desdialog.addWindowListener(new WindowAdapter() {
						public void windowClosing(WindowEvent e) {
							System.exit(0);
						}
					});
					desdialog.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}

			}
		});
		button_1.setFont(new Font("楷体_GB2312", Font.PLAIN, 18));
		button_1.setText("DES加密");
		button_1.setBounds(90, 123, 106, 28);
		getContentPane().add(button_1);

		final JButton button_2 = new JButton();
		button_2.addMouseListener(new MouseAdapter() {
			public void mouseClicked(final MouseEvent arg0) {
				rsadialog=fileRSA.getfileRSA();
				
				try {
					
					rsadialog.addWindowListener(new WindowAdapter() {
						public void windowClosing(WindowEvent e) {
							System.exit(0);
						}
					});
					rsadialog.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
		button_2.setFont(new Font("楷体_GB2312", Font.PLAIN, 18));
		button_2.setText("RSA加密");
		button_2.setBounds(270, 123, 106, 28);
		getContentPane().add(button_2);

		final JLabel label_1 = new JLabel();
		label_1.setForeground(new Color(255, 0, 0));
		label_1.setFont(new Font("楷体_GB2312", Font.PLAIN, 20));
		label_1.setText("多媒体信息加密");
		label_1.setBounds(164, 41, 147, 43);
		getContentPane().add(label_1);
		
		//
	}

}




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -