Results 1 to 2 of 2
  1. #1
    doa24uk is offline Member
    Join Date
    Apr 2011
    Rep Power

    Default Best way to model table with header characters?

    Hi guys,

    I'm looking for the best way to model this table in Java.

    I thought about using seperate Arrays but it a) seems cumbersome b) Arrays don't have a key (index) character.

    Eventually my method will:

    Accept two string inputs (a plaintext & a key)

    For example, suppose that the plaintext to be encrypted is:


    The person sending the message chooses a keyword and repeats it until it matches the length of the plaintext, for example, the keyword "LEMON":


    The first letter of the plaintext, A, is paired with L, the first letter of the key. So use row L and column A of the Vigenère square, namely L. Similarly, for the second letter of the plaintext, the second letter of the key is used; the letter at row E and column T is X. The rest of the plaintext is enciphered in a similar fashion:

    Plaintext: ATTACKATDAWN
    Ciphertext: LXFOPVEFRNHR

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Eastern Florida
    Rep Power


    Arrays don't have a key (index) character
    Given that the collating sequence for the letters you are using doesn't have any holes. The letters are contiguous, You could compute an index into an array by giving the letter A the value of 0 and subtracting the value of A from the letter to get the index. The indexes would be 0-25 for A to Z

Similar Threads

  1. How to change the height of a table header?
    By Zelord in forum AWT / Swing
    Replies: 2
    Last Post: 12-20-2010, 09:08 PM
  2. DisplayTag Table header styling problem and paging
    By selvi in forum Web Frameworks
    Replies: 1
    Last Post: 08-06-2010, 12:00 PM
  3. Copy Default table model to another default table model?
    By greatmajestics in forum AWT / Swing
    Replies: 2
    Last Post: 04-28-2010, 05:08 PM
  4. Replies: 1
    Last Post: 01-08-2010, 07:19 AM
  5. Table model
    By Manfizy in forum NetBeans
    Replies: 4
    Last Post: 11-08-2008, 03:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts