Results 1 to 4 of 4
  1. #1
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default jtable cell to string

    Basically what the title says.

    I am running a Modification System,
    Process:
    Menu:
    Select Modify:
    "What would you like to search by to Modify:"
    System Code
    System Name
    System Abbreviation

    Java Code:
    String SysName = JOptionPane.showInputDialog(null, "What is the System Name?", "Modify System Definition: System Name", JOptionPane.QUESTION_MESSAGE);
    String SQL  = "SELECT * FROM  `eossysdef` WHERE SysName LIKE '%"+SysName+"%';";
    Brings up a jtable, with all data with similar names.

    This is where I am at.

    How do I either click a row and get it to send to a string or each cell to a string multiple smaller strings.

    Because it will go to another Panel and fill in the TextBoxes to allow a person to modify and submit.
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,301
    Rep Power
    20

    Default

    Double posted, and in two different but wrong sections.

    Read the JTable API, all the methods you need are there. And in future, post Swing related questions in the AWT/Swing section, once only.

    db

  3. #3
    Sno's Avatar
    Sno
    Sno is offline Senior Member
    Join Date
    Apr 2010
    Posts
    196
    Rep Power
    5

    Default

    I apologize for the double post, just was looking for an answer, or an idea. Can not seem to get one.

    Also, the api is slightly confusing me, and my thinking was, this may be a beginner question, so I asked it here, than after no one responded for a period of 6 hours, I figured maybe its an advanced question.

    All I am looking for Is something that will say
    String CellValue = point at cell selected by mouse
    :rolleyes: ~ Sno ~ :rolleyes:
    '-~ B.S. Computer Science ~-'

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,560
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by Sno View Post
    All I am looking for Is something that will say
    String CellValue = point at cell selected by mouse
    Read the API documentation: a JTable has methods columnAtPoint( ... ) and rowAtPoint( ... ). Given your TableModel you should get it from there.

    kind regards,

    Jos

Similar Threads

  1. JTable Cell Merg
    By anilkumar_vist in forum AWT / Swing
    Replies: 8
    Last Post: 04-25-2011, 09:32 AM
  2. Setting jTable cell?
    By greatmajestics in forum New To Java
    Replies: 5
    Last Post: 04-22-2010, 05:33 PM
  3. jtable cell background
    By anilkumar_vist in forum New To Java
    Replies: 0
    Last Post: 02-22-2010, 04:08 PM
  4. add a check box to only one cell in a JTable
    By aruna1 in forum New To Java
    Replies: 4
    Last Post: 04-03-2009, 06:28 PM
  5. jTable Cell editing
    By mahaling_m in forum AWT / Swing
    Replies: 0
    Last Post: 06-23-2008, 08:17 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
  •