Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from javax.swing import *
- class InitGUI():
- def __init__(self):
- frame = JFrame()
- jScrollPane1 = JScrollPane();
- CipherI = JTextArea();
- TextA = JTextField();
- TextB = JTextField();
- TextC = JTextField();
- TextD = JTextField();
- TextE = JTextField();
- TextF = JTextField();
- TextG = JTextField();
- TextH = JTextField();
- TextI = JTextField();
- TextJ = JTextField();
- TextK = JTextField();
- TextL = JTextField();
- TextM = JTextField();
- TextN = JTextField();
- TextO = JTextField();
- TextP = JTextField();
- TextQ = JTextField();
- TextR = JTextField();
- TextS = JTextField();
- TextT = JTextField();
- TextU = JTextField();
- TextV = JTextField();
- TextW = JTextField();
- TextX = JTextField();
- TextY = JTextField();
- TextZ = JTextField();
- CipherT = JLabel();
- PlainT = JLabel();
- ShiftR = JButton();
- ShiftL = JButton();
- jLabel1 = JLabel();
- jLabel2 = JLabel();
- jLabel3 = JLabel();
- jLabel4 = JLabel();
- jScrollPane2 = JScrollPane();
- PlainO = JTextArea();
- Update = JButton();
- jLabel7 = JLabel();
- jLabel8 = JLabel();
- jLabel9 = JLabel();
- jLabel10 = JLabel();
- jLabel11 = JLabel();
- jLabel12 = JLabel();
- jLabel13 = JLabel();
- jLabel14 = JLabel();
- jLabel15 = JLabel();
- jLabel16 = JLabel();
- jLabel17 = JLabel();
- jLabel19 = JLabel();
- jLabel20 = JLabel();
- jLabel21 = JLabel();
- jLabel22 = JLabel();
- jLabel23 = JLabel();
- jLabel24 = JLabel();
- jLabel25 = JLabel();
- jLabel26 = JLabel();
- jLabel27 = JLabel();
- jLabel28 = JLabel();
- jLabel29 = JLabel();
- jLabel30 = JLabel();
- jLabel18 = JLabel();
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- CipherI.setColumns(20);
- CipherI.setRows(5);
- jScrollPane1.setViewportView(CipherI);
- TextA.setText("A");
- TextB.setText("B");
- TextC.setText("C");
- TextD.setText("D");
- TextE.setText("E");
- TextF.setText("F");
- TextG.setText("G");
- TextH.setText("H");
- TextI.setText("I");
- TextJ.setText("J");
- TextK.setText("K");
- TextL.setText("L");
- TextM.setText("M");
- TextN.setText("N");
- TextO.setText("O");
- TextP.setText("P");
- TextQ.setText("Q");
- TextR.setText("R");
- TextS.setText("S");
- TextT.setText("T");
- TextU.setText("U");
- TextV.setText("V");
- TextW.setText("W");
- TextX.setText("X");
- TextY.setText("Y");
- TextZ.setText("Z");
- CipherT.setText("Ciphertext");
- PlainT.setText("Plaintext");
- ShiftR.setText(">");
- ShiftL.setText("<");
- jLabel1.setText("A");
- jLabel2.setText("B");
- jLabel3.setText("C");
- jLabel4.setText("D");
- PlainO.setColumns(20);
- PlainO.setEditable(False);
- PlainO.setRows(5);
- jScrollPane2.setViewportView(PlainO);
- Update.setText("Update Plaintext");
- jLabel7.setText("Ciphertext:");
- jLabel8.setText("Plaintext:");
- jLabel9.setText("E");
- jLabel10.setText("F");
- jLabel11.setText("G");
- jLabel12.setText("H");
- jLabel13.setText("J");
- jLabel14.setText("K");
- jLabel15.setText("L");
- jLabel16.setText("M");
- jLabel17.setText("I");
- jLabel19.setText("O");
- jLabel20.setText("P");
- jLabel21.setText("Q");
- jLabel22.setText("R");
- jLabel23.setText("S");
- jLabel24.setText("T");
- jLabel25.setText("U");
- jLabel26.setText("V");
- jLabel27.setText("W");
- jLabel28.setText("X");
- jLabel29.setText("Y");
- jLabel30.setText("Z");
- jLabel18.setText("N");
- layout = GroupLayout(frame);
- frame.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(jLabel7)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 2524,32767 ))
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(jLabel8)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(PlainT)
- .addComponent(CipherT))
- .addGap(41, 41, 41)
- .addComponent(ShiftL)
- .addGap(41, 41, 41)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(jLabel1)
- .addComponent(TextA, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextB, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel2))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextC, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel3))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextD, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel4))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextE, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel9))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextF, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel10))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextG, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel11))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextH, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel12))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(jLabel17)
- .addComponent(TextI, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, False)
- .addGroup(layout.createSequentialGroup()
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(TextJ, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(TextK, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(TextL, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(TextM, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
- .addGroup(layout.createSequentialGroup()
- .addGap(18, 18, 18)
- .addComponent(jLabel13)
- .addGap(16, 16, 16)
- .addComponent(jLabel14)
- .addGap(18, 18, 18)
- .addComponent(jLabel15)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, 32767)
- .addComponent(jLabel16)))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextN, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel18))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(jLabel19)
- .addComponent(TextO, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextP, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel20))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextQ, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel21))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextR, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel22))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextS, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel23))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextT, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel24))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextU, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel25))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextV, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel26))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextW, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel27))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextX, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel28))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextY, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel29))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(TextZ, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel30))
- .addGap(45, 45, 45)
- .addComponent(ShiftR))))
- .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 2534, 32767)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(Update)))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(jLabel7)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE)
- .addGap(29, 29, 29)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(CipherT)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(PlainT)
- .addGap(20, 20, 20)
- .addComponent(Update)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel8))
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel1)
- .addComponent(jLabel2)
- .addComponent(jLabel3)
- .addComponent(jLabel4)
- .addComponent(jLabel9)
- .addComponent(jLabel10)
- .addComponent(jLabel11)
- .addComponent(jLabel12)
- .addComponent(jLabel17)
- .addComponent(jLabel13)
- .addComponent(jLabel14)
- .addComponent(jLabel15)
- .addComponent(jLabel16)
- .addComponent(jLabel18)
- .addComponent(jLabel19)
- .addComponent(jLabel20)
- .addComponent(jLabel21)
- .addComponent(jLabel22)
- .addComponent(jLabel23)
- .addComponent(jLabel24)
- .addComponent(jLabel25)
- .addComponent(jLabel26)
- .addComponent(jLabel27)
- .addComponent(jLabel28)
- .addComponent(jLabel29)
- .addComponent(jLabel30))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(TextA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextC, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextD, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextG, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextH, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextI, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextJ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextK, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextM, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextL, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextO, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextP, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextQ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextR, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextS, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextT, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextU, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextV, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextW, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextX, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextY, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(TextZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(ShiftL)
- .addComponent(ShiftR))))
- .addGap(18, 18, 18)
- .addComponent(jScrollPane2, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- frame.show()
- run = InitGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement