* DES Algorithm is done by
* HUNG VU PHAM, 06054292
*/
import java.awt.*;
import javax.swing.*;
public class DESAlgorithm extends JFrame
{
public static void main( String[] args )
{
JLabel plainText;
JTextField tfPlainText;
JButton btEncrypt, btDecrypt;
JTextArea taEncrypt, taDecrypt;
JPanel p1;
JScrollPane sp1, sp2;
JFrame frame = new JFrame("Information Security");// Create Frame and set title for the frame
//the program to terminate when the frame is closed
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
//Create Panel to contain all components
p1= new JPanel();
//Set FlowLayout, aligned left with horizontal gap 10 and vertical gap 20 between components
p1.setLayout(new FlowLayout());
frame.add(p1);// add panel to frame
//Get content
//Make Label
plainText = new JLabel("Plain Text Input");
//Make textfield
tfPlainText = new JTextField("Plain Text input",20);
//Encryption Output
btEncrypt = new JButton("Encryption");
taEncrypt = new JTextArea (10,30);
//taEncrypt.setEditable (false);
sp1 = new JScrollPane(taEncrypt, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
//Decryption Output
btDecrypt = new JButton("Decryption");
taDecrypt = new JTextArea (10,30);
taDecrypt.setEditable (false);
//Add all components to panel
p1.add(plainText);
p1.add(tfPlainText);
p1.add(btEncrypt);
p1.add(taEncrypt);
p1.add(btDecrypt);
p1.add(taDecrypt);
frame.setSize(400,480);
frame.setVisible(true);
}
}
Theo điều tra tình hình sử dụng thuốc lá ở người trưởng thành năm 2020 do Bộ Y tế triển khai, ngày nay tỷ lệ đàn ông Việt Nam hút thuốc đang ở mức 42,3%. Không chỉ có khả năng gây ung thư và một...
Những thói quen khiến "cuộc vui" của hai người trở nên... dở dang