Advertisement
Guest User

Stackoverflow question source

a guest
Sep 9th, 2010
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 21.60 KB | None | 0 0
  1. from javax.swing import *
  2.  
  3. class InitGUI():
  4.    
  5.  
  6.     def __init__(self):
  7.         frame = JFrame()
  8.  
  9.  
  10.         jScrollPane1 = JScrollPane();
  11.         CipherI = JTextArea();
  12.         TextA = JTextField();
  13.         TextB = JTextField();
  14.         TextC = JTextField();
  15.         TextD = JTextField();
  16.         TextE = JTextField();
  17.         TextF = JTextField();
  18.         TextG = JTextField();
  19.         TextH = JTextField();
  20.         TextI = JTextField();
  21.         TextJ = JTextField();
  22.         TextK = JTextField();
  23.         TextL = JTextField();
  24.         TextM = JTextField();
  25.         TextN = JTextField();
  26.         TextO = JTextField();
  27.         TextP = JTextField();
  28.         TextQ = JTextField();
  29.         TextR = JTextField();
  30.         TextS = JTextField();
  31.         TextT = JTextField();
  32.         TextU = JTextField();
  33.         TextV = JTextField();
  34.         TextW = JTextField();
  35.         TextX = JTextField();
  36.         TextY = JTextField();
  37.         TextZ = JTextField();
  38.         CipherT = JLabel();
  39.         PlainT = JLabel();
  40.         ShiftR = JButton();
  41.         ShiftL = JButton();
  42.         jLabel1 = JLabel();
  43.         jLabel2 = JLabel();
  44.         jLabel3 = JLabel();
  45.         jLabel4 = JLabel();
  46.         jScrollPane2 = JScrollPane();
  47.         PlainO = JTextArea();
  48.         Update = JButton();
  49.         jLabel7 = JLabel();
  50.         jLabel8 = JLabel();
  51.         jLabel9 = JLabel();
  52.         jLabel10 = JLabel();
  53.         jLabel11 = JLabel();
  54.         jLabel12 = JLabel();
  55.         jLabel13 = JLabel();
  56.         jLabel14 = JLabel();
  57.         jLabel15 = JLabel();
  58.         jLabel16 = JLabel();
  59.         jLabel17 = JLabel();
  60.         jLabel19 = JLabel();
  61.         jLabel20 = JLabel();
  62.         jLabel21 = JLabel();
  63.         jLabel22 = JLabel();
  64.         jLabel23 = JLabel();
  65.         jLabel24 = JLabel();
  66.         jLabel25 = JLabel();
  67.         jLabel26 = JLabel();
  68.         jLabel27 = JLabel();
  69.         jLabel28 = JLabel();
  70.         jLabel29 = JLabel();
  71.         jLabel30 = JLabel();
  72.         jLabel18 = JLabel();
  73.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  74.         CipherI.setColumns(20);
  75.         CipherI.setRows(5);
  76.         jScrollPane1.setViewportView(CipherI);
  77.         TextA.setText("A");
  78.         TextB.setText("B");
  79.         TextC.setText("C");
  80.         TextD.setText("D");
  81.         TextE.setText("E");
  82.         TextF.setText("F");
  83.         TextG.setText("G");
  84.         TextH.setText("H");
  85.         TextI.setText("I");
  86.         TextJ.setText("J");
  87.         TextK.setText("K");
  88.         TextL.setText("L");
  89.         TextM.setText("M");
  90.         TextN.setText("N");
  91.         TextO.setText("O");
  92.         TextP.setText("P");
  93.         TextQ.setText("Q");
  94.         TextR.setText("R");
  95.         TextS.setText("S");
  96.         TextT.setText("T");
  97.         TextU.setText("U");
  98.         TextV.setText("V");
  99.         TextW.setText("W");
  100.         TextX.setText("X");
  101.         TextY.setText("Y");
  102.         TextZ.setText("Z");
  103.         CipherT.setText("Ciphertext");
  104.         PlainT.setText("Plaintext");
  105.         ShiftR.setText(">");
  106.         ShiftL.setText("<");
  107.         jLabel1.setText("A");
  108.         jLabel2.setText("B");
  109.         jLabel3.setText("C");
  110.         jLabel4.setText("D");
  111.         PlainO.setColumns(20);
  112.         PlainO.setEditable(False);
  113.         PlainO.setRows(5);
  114.         jScrollPane2.setViewportView(PlainO);
  115.         Update.setText("Update Plaintext");
  116.         jLabel7.setText("Ciphertext:");
  117.         jLabel8.setText("Plaintext:");
  118.         jLabel9.setText("E");
  119.         jLabel10.setText("F");
  120.         jLabel11.setText("G");
  121.         jLabel12.setText("H");
  122.         jLabel13.setText("J");
  123.         jLabel14.setText("K");
  124.         jLabel15.setText("L");
  125.         jLabel16.setText("M");
  126.         jLabel17.setText("I");
  127.         jLabel19.setText("O");
  128.         jLabel20.setText("P");
  129.         jLabel21.setText("Q");
  130.         jLabel22.setText("R");
  131.         jLabel23.setText("S");
  132.         jLabel24.setText("T");
  133.         jLabel25.setText("U");
  134.         jLabel26.setText("V");
  135.         jLabel27.setText("W");
  136.         jLabel28.setText("X");
  137.         jLabel29.setText("Y");
  138.         jLabel30.setText("Z");
  139.         jLabel18.setText("N");
  140.  
  141.         layout = GroupLayout(frame);
  142.         frame.setLayout(layout);
  143.         layout.setHorizontalGroup(
  144.             layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  145.             .addGroup(layout.createSequentialGroup()
  146.                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  147.                     .addComponent(jLabel7)
  148.                     .addGroup(layout.createSequentialGroup()
  149.                         .addContainerGap()
  150.                         .addComponent(jScrollPane2, GroupLayout.DEFAULT_SIZE, 2524,32767 ))
  151.                     .addGroup(layout.createSequentialGroup()
  152.                         .addContainerGap()
  153.                         .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  154.                             .addComponent(jLabel8)
  155.                             .addGroup(layout.createSequentialGroup()
  156.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  157.                                     .addComponent(PlainT)
  158.                                     .addComponent(CipherT))
  159.                                 .addGap(41, 41, 41)
  160.                                 .addComponent(ShiftL)
  161.                                 .addGap(41, 41, 41)
  162.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  163.                                     .addComponent(jLabel1)
  164.                                     .addComponent(TextA, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
  165.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  166.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  167.                                     .addComponent(TextB, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  168.                                     .addComponent(jLabel2))
  169.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  170.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  171.                                     .addComponent(TextC, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  172.                                     .addComponent(jLabel3))
  173.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  174.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  175.                                     .addComponent(TextD, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  176.                                     .addComponent(jLabel4))
  177.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  178.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  179.                                     .addComponent(TextE, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  180.                                     .addComponent(jLabel9))
  181.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  182.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  183.                                     .addComponent(TextF, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  184.                                     .addComponent(jLabel10))
  185.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  186.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  187.                                     .addComponent(TextG, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  188.                                     .addComponent(jLabel11))
  189.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  190.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  191.                                     .addComponent(TextH, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  192.                                     .addComponent(jLabel12))
  193.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  194.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  195.                                     .addComponent(jLabel17)
  196.                                     .addComponent(TextI, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
  197.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, False)
  198.                                     .addGroup(layout.createSequentialGroup()
  199.                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  200.                                         .addComponent(TextJ, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  201.                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  202.                                         .addComponent(TextK, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  203.                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  204.                                         .addComponent(TextL, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  205.                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  206.                                         .addComponent(TextM, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
  207.                                     .addGroup(layout.createSequentialGroup()
  208.                                         .addGap(18, 18, 18)
  209.                                         .addComponent(jLabel13)
  210.                                         .addGap(16, 16, 16)
  211.                                         .addComponent(jLabel14)
  212.                                         .addGap(18, 18, 18)
  213.                                         .addComponent(jLabel15)
  214.                                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, 32767)
  215.                                         .addComponent(jLabel16)))
  216.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  217.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  218.                                     .addComponent(TextN, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  219.                                     .addComponent(jLabel18))
  220.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  221.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  222.                                     .addComponent(jLabel19)
  223.                                     .addComponent(TextO, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE))
  224.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  225.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  226.                                     .addComponent(TextP, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  227.                                     .addComponent(jLabel20))
  228.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  229.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  230.                                     .addComponent(TextQ, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  231.                                     .addComponent(jLabel21))
  232.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  233.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  234.                                     .addComponent(TextR, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  235.                                     .addComponent(jLabel22))
  236.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  237.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  238.                                     .addComponent(TextS, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  239.                                     .addComponent(jLabel23))
  240.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  241.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  242.                                     .addComponent(TextT, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  243.                                     .addComponent(jLabel24))
  244.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  245.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  246.                                     .addComponent(TextU, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  247.                                     .addComponent(jLabel25))
  248.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  249.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  250.                                     .addComponent(TextV, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  251.                                     .addComponent(jLabel26))
  252.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  253.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  254.                                     .addComponent(TextW, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  255.                                     .addComponent(jLabel27))
  256.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  257.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  258.                                     .addComponent(TextX, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  259.                                     .addComponent(jLabel28))
  260.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  261.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  262.                                     .addComponent(TextY, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
  263.                                     .addComponent(jLabel29))
  264.                                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  265.                                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
  266.                                     .addComponent(TextZ, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
  267.                                     .addComponent(jLabel30))
  268.                                 .addGap(45, 45, 45)
  269.                                 .addComponent(ShiftR))))
  270.                     .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 2534, 32767)
  271.                     .addGroup(layout.createSequentialGroup()
  272.                         .addContainerGap()
  273.                         .addComponent(Update)))
  274.                 .addContainerGap())
  275.         );
  276.         layout.setVerticalGroup(
  277.             layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  278.             .addGroup(layout.createSequentialGroup()
  279.                 .addComponent(jLabel7)
  280.                 .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  281.                 .addComponent(jScrollPane1, GroupLayout.PREFERRED_SIZE, 124, GroupLayout.PREFERRED_SIZE)
  282.                 .addGap(29, 29, 29)
  283.                 .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
  284.                     .addGroup(layout.createSequentialGroup()
  285.                         .addComponent(CipherT)
  286.                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  287.                         .addComponent(PlainT)
  288.                         .addGap(20, 20, 20)
  289.                         .addComponent(Update)
  290.                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  291.                         .addComponent(jLabel8))
  292.                     .addGroup(layout.createSequentialGroup()
  293.                         .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  294.                             .addComponent(jLabel1)
  295.                             .addComponent(jLabel2)
  296.                             .addComponent(jLabel3)
  297.                             .addComponent(jLabel4)
  298.                             .addComponent(jLabel9)
  299.                             .addComponent(jLabel10)
  300.                             .addComponent(jLabel11)
  301.                             .addComponent(jLabel12)
  302.                             .addComponent(jLabel17)
  303.                             .addComponent(jLabel13)
  304.                             .addComponent(jLabel14)
  305.                             .addComponent(jLabel15)
  306.                             .addComponent(jLabel16)
  307.                             .addComponent(jLabel18)
  308.                             .addComponent(jLabel19)
  309.                             .addComponent(jLabel20)
  310.                             .addComponent(jLabel21)
  311.                             .addComponent(jLabel22)
  312.                             .addComponent(jLabel23)
  313.                             .addComponent(jLabel24)
  314.                             .addComponent(jLabel25)
  315.                             .addComponent(jLabel26)
  316.                             .addComponent(jLabel27)
  317.                             .addComponent(jLabel28)
  318.                             .addComponent(jLabel29)
  319.                             .addComponent(jLabel30))
  320.                         .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
  321.                         .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
  322.                             .addComponent(TextA, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  323.                             .addComponent(TextB, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  324.                             .addComponent(TextC, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  325.                             .addComponent(TextD, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  326.                             .addComponent(TextE, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  327.                             .addComponent(TextF, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  328.                             .addComponent(TextG, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  329.                             .addComponent(TextH, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  330.                             .addComponent(TextI, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  331.                             .addComponent(TextJ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  332.                             .addComponent(TextK, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  333.                             .addComponent(TextM, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  334.                             .addComponent(TextL, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  335.                             .addComponent(TextN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  336.                             .addComponent(TextO, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  337.                             .addComponent(TextP, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  338.                             .addComponent(TextQ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  339.                             .addComponent(TextR, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  340.                             .addComponent(TextS, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  341.                             .addComponent(TextT, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  342.                             .addComponent(TextU, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  343.                             .addComponent(TextV, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  344.                             .addComponent(TextW, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  345.                             .addComponent(TextX, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  346.                             .addComponent(TextY, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  347.                             .addComponent(TextZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
  348.                             .addComponent(ShiftL)
  349.                             .addComponent(ShiftR))))
  350.                 .addGap(18, 18, 18)
  351.                 .addComponent(jScrollPane2, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE)
  352.                 .addContainerGap())
  353.         );
  354.  
  355.         frame.show()
  356.  
  357.  
  358.  
  359. run = InitGUI()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement