In the graphical user interface, set up two panels and set the layout to display their components individually. Set two menu items, respectively "open" and "save", set two buttons, respectively "Encrypt" and "decrypt", create a text area, with a label labeled "File Browser window", this is the entire graphical user interface.
Added a window event windowclosing to close the running program.
Where the code for the Window event is implemented:
Addwindowlistener (New Windowadapter ()
{
public void windowclosing (WindowEvent e)
{
System.exit (0);
}
});
}
Commissioning and
Experience ha
This program uses a simple encryption algorithm, that is, the text file obtained from the text area, initialized, stored in an array, and then perform an XOR operation, the results are stored in the array, thus appearing in the "File browser window." Decryption operation is in fact the same as the encryption operation, still open the encrypted file first, so that it appears in the text area, and then the same elements in the array initialization, the XOR operation, you can get the decrypted file, and then displayed in the "File browser window." When I study those classes, I think it is still a bit difficult, and then call several classes of methods, see the results of the operation, so very intuitive to the class to learn, and memory is very deep.
Learning language, repeated operations, often write code, we have a problem when we have certain ideas. Waste, learning programming language needs a relatively long stage, solid foundation. Do not think that you have written a simple small program, you think you have learned very well, this is just a little practice in your learning programming process. Do not be satisfied with the status quo, to constantly improve their knowledge system, good at summing up practical experience. To correct their learning attitude, is the initiative to learn, rather than passive! Improve self-study ability. Then you should not be satisfied to put the code to pass, you should think about if I do not write this, another way, try again trial not.
Two weeks of personal projects (software engineering)