Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- public class CodeGenerator {
- private JFrame f;
- private JPanel p;
- private JPanel p2;
- private JPanel p3;
- private JButton butt;
- private JLabel lab;
- public CodeGenerator() {
- gui();
- }
- public void gui() {
- f = new JFrame ("Code generator");
- f.setVisible(true);
- f.setSize(600,400);
- f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- p = new JPanel();
- p.setBackground(Color.WHITE);
- p2 = new JPanel();
- p2.setBackground(Color.DARK_GRAY);
- butt = new JButton("Generate");
- butt.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- CodeAlgorythm codegen = new CodeAlgorythm();
- codegen.generateCode();
- //The code over here is the code generator
- }
- });
- lab = new JLabel("This program is designed to generate random codes
- to help you protect your datas.");
- p2.add(butt);
- p.add(lab);
- f.add(p,BorderLayout.CENTER);
- f.add(p2,BorderLayout.SOUTH);
- //Up there is all the GUI stuff
- }
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new CodeGenerator();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement