Edit JTable and Send Info To DB!!!!!  Duke$$$$

hi,
I have an Applet that contains JTable.
I am retriveing person information from DB to jTable...
Once i click on the JTable i want to change the value in the JTable cell and click the Update button to update that info in db...
Can someone please guide me on how this can be done...
If possible if someone can post a simple code or post where i can get an example like this...
Again Thanks for any help..
Sam

take a look at this code.
import javax.swing.JTable;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import javax.swing.JFrame;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
public class SimpleTableDemo extends JFrame implements TableModelListener {
private boolean DEBUG = true;
javax.swing.table.TableModel modela;
public SimpleTableDemo() {
super("SimpleTableDemo");
Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Integer(5), new Boolean(false)},
{"Alison", "Huml",
"Rowing", new Integer(3), new Boolean(true)},
{"Kathy", "Walrath",
"Chasing toddlers", new Integer(2), new Boolean(false)},
{"Mark", "Andrews",
"Speed reading", new Integer(20), new Boolean(true)},
{"Angela", "Lih",
"Teaching high school", new Integer(4), new Boolean(false)}
String[] columnNames = {"First Name",
"Last Name",
"Sport",
"# of Years",
"Vegetarian"};
final JTable table = new JTable(data, columnNames);
table.setPreferredScrollableViewportSize(new Dimension(500, 70));
modela = table.getModel();
modela.addTableModelListener(this);
//Create the scroll pane and add the table to it.
JScrollPane scrollPane = new JScrollPane(table);
//Add the scroll pane to this window.
getContentPane().add(scrollPane, BorderLayout.CENTER);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
public void tableChanged(TableModelEvent e){
int row = e.getFirstRow();
int column = e.getColumn();
Object firstname = modela.getValueAt(row, 0);
Object lastname = modela.getValueAt(row, 1);
Object sport = modela.getValueAt(row, 2);
Object years = modela.getValueAt(row, 3);
Object veg = modela.getValueAt(row, 4);
System.out.println();
System.out.println(firstname);
System.out.println(lastname);
System.out.println(sport);
System.out.println(years);
System.out.println(veg);
System.out.println();
public static void main(String[] args) {
SimpleTableDemo frame = new SimpleTableDemo();
frame.pack();
frame.setVisible(true);
hope this helps

Similar Messages

  • Can I hide the Adobe Reader panel with "Export, Create and Edit PDF and Send and Store Files"? I don't use it and it takes up space

    Can I hide the Adobe Reader panel with "Export, Create and Edit PDF and Send and Store Files"? I don't use it and it takes up space

    If you just mean, can I close it, sure. In Reader XI click the Tools button to close or reopen it.

  • Sharing an editable file and sending the app to the publisher

    Hello. I am a little confused about some parts of working with apps in dps. We are two persons working together, and therefore, of course, we would like to share the apps we create. But from InDesign it seems that the files can only go one way, and that is up in the cloud. I found out that I can download the .folio (even though it is very cryptic to do so) from Folio Producer, but I cannot download anything editable, which will be necessary if we are to collaborate between more computers. In addition, it would be very convenient to be able to share a file in the process of making it, before I upload it, select icon pictures etc. and press that blue publish button. This is a very time-consuming process.
    Also we would like to send the apps to the publishers that we are working for, so they can upload them with their Apple account, not ours. We do not want to pay monthly for their books. If we send the .folio file (the one I got by pressing publish in Folio Producer and then export) to them, would they be able to publish the app by uploading it to Apple?
    I should mention that I am only using the free version of Creative Cloud. I don't know if this has any limitations relevant for these problems. I know that I can pay extra to be able to share in the cloud, but that does not change the fact, I think, that you cannot edit the files that you download. I am not even able to edit my own files uploaded and downloaded with the same computer and the same account.
    Thank you in advance.

    Can you explain how you currently collaborate when designing a book that you can't do with DPS? You may just need some guidance on best practices with DPS. DPS has several built in collaboration features.
    You can create a folio and share it with another user. That user can contribute articles to your folio and view your content both on device and on the desktop.
    You can create a folio, builda single edition app, sign it with a developer certificate and another user can load it on their device for viewing.
    You can create Indesign files and share them with another user via dropbox or sneaker net. That other person can create folios with these files for no charge and view on device and desktop.
    Create a folio, publish it and share the web viewer URL with another user so they can view it in a browser.
    About the only collaboration mechanism DPS doesn't support is the generatio of a folio that can be emailed to another user for viewing.

  • Problems with saving and sending info in PDF form

    Hi,
    I'm trying to make a PDF form in Indesign CS5, exporting it to PDF, opening in Acrobat 9 Pro, and get the form to be able to send the info I type in the fields.
    So far I've had no problems making the form, exporting it, opening it in Acrobat 9 Pro, getting Acrobat 9 Pro to recognize the fields and save the form.
    However, I'd opened the form and filled it out and attached it to an email, and when I got the email, the form was blank.
    How do I get the form to save the data so it can be emailed?
    thanks for any help.
    Phil

    (Acrobat Pro and Pro Extended) Choose Advanced > Extend Features In Adobe Reader.
    I have somehow solved the problem. I tried using the above direction and it seems to have fixed the problem. I don't seem to get the message about not being able to save anymore and can send a completed PDF form that retains the information typed into the form.
    Thanks for all who made suggestions.
    Phil

  • Internet went down , does and a screen came up ( internet diagnostic screen) does anyone know if this is real ? said it would diagnose and send info to apple then ask for computer password and a minute after I gave it internet came back up. Real apple sea

    internet went down and a aplle diagnostic screen came up ask for password as soon as I gave it and entered within a minute internet came up again. real or Hacked? Has anyone ever seen this before     ---     internet diagnostic screen      said it was from and going to apple

    No, as I already said, they will not.  They will not repair or replace any Apple device that's even been opened by anyone else.
    In this case, the morons who butchered your phone caused a lot more damage than the broken screen.
    You should have taken it to Apple for service in the first place.

  • Intercepting editing start and stop/cancel in a JTable

    Hi,
    I've been seaching the forum for days but could not find anything that solved my problem.
    Problem:
    I'm writing a multiclient server. The data of the server is displayed in a JTable. The rows(cells) in the table is editable and to make sure no two clients edit the same row at the same time I've implemented a locking mechanism in the server and would like to lock a row whenever a user starts editing and release the lock when the user either stops or cancels editing.
    The JTable is 'hooked up' with a TableModel class that I've written to handle the locking and notification of the lock and unlock events from the server.
    I've tried a couple of things but non worked very good. It would be nice if the CellEditorListener implemented a startEditing but it does not so letting my model implement the interface was no good.
    Any ideas? If anyone knows how to solve this, please reply
    Yours, Johan

    Playing around with some methods in JTable, and some minimal testing, I came up with:
    table = new JTable(...)
         private int editingRow = -1;
         public  boolean editCellAt(int row, int column, EventObject e)
              boolean editingCell = super.editCellAt(row, column, e);
              if (isEditing())
                   editingRow = row;
                   System.out.println("started");
              return editingCell;
         public void removeEditor()
              if (isEditing())
                   editingRow = -1;
                   System.out.println("stopped");
              super.removeEditor();
    };

  • I'm using Adobe Acrobat with the hope of editing a url on the graphic...a simple 3-letter change, save, close and send for printing..how do I get in edit mode to delete 3 letters and insert 3 new letters?

    ?I'm using Adobe Acrobat with the hope of editing a url on the graphic...a simple 3-letter change, save, close and send for printing..how do I get in edit mode to delete 3 letters and insert 3 new letters?

    pkg4ibm wrote:
    editing a url on the graphic...
    Not sure what you mean by that: is that URL in an image, or is it actual text?
    If it is in an image, then you need to extract the image, edit it with something like Photoshop, then add it back to the PDF.
    If the URL is actual text, I suggest that you remove the entire URL, then add the corrected link.

  • Opened a draft that had been saved, edited it, and now can neither send, nor delete, nor close that message. Mail program stuck there. Any idea how to get it "unstuck?"

    In mail, on my iPad 2, I opened a draft message that had been saved.  I edited it and want to send it. The Send and Cancel bottons are both grayed out. I can't send it, nor cancel it, nor get out of that message. Please help.

    Charlie-
    First I would select the contents of the message and copy it to the clipboard.
    Click your Home button to get out of Mail.  Then double-click the Home button.  A row of recent Apps will line up along the bottom of the screen.  Scroll across and look for the Mail icon.  Press and hold on it until it starts to wiggle.  A red minus sign will appear on each of the icons.  Press the minus sign to remove Mail from the list.  This should also un-hang it.
    If successful, Mail should work normally, and you should be able to paste the clipboard to another new message.
    If not successful, you can try resetting (rebooting) the iPad.  Hold both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  The iPad will restart after a couple of minutes.
    Fred

  • Highlighted info in html editor and sending it in an email

    Is there a way to take everything that is highlighted in the html editor and send in an email?
    Either in the body of the default email client or as attachment in apex.mail or email client?
    Thanks.

    Hello,
    Maybe this link can help you: http://javascript.internet.com/page-details/highlighted-text.html
    I've been looking at the FCK Editor (which is what APEX is using) Javascript API's but didn't find a solution that quick, but my guess it's somewhere in there too.
    Nevertheless the above link provides you with something that works as well.
    Hope you like it.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/

  • I recently moved my itunes library. Itunes deleted a lot of artist and album info and album art. Now it won't let me edit the info to correct it. Any advice on to correct this?

    I recently bought a new Asus laptop and moved my itunes to it. All of my files are stored on an external hard drive. In the process of importing my files into itunes on the new laptop, some artist and album info has been deleted. A lot of album art is missing as well. I attempted to correct the missing info, but now itunes won't let me edit any track, artist or album info. Any idea what the problem is and how I can fix it? Thanks.

    You can't use your account's balance for gifting, you can only use a credit card - your balance can only be used to buy content for yourself. Until you pay what you owe iTunes then you won't be able to download any items from the store on that account.
    If you haven't got a valid credit card then you can try contacting iTunes support and see if they can cancel the gift or take what you owe them from your balance: http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page

  • I have just recorded on garageband and now need to send away for editing how do i place in file and send

    I have just recorded on garageband and now need to send away for editing how do i place in file and send 

    Send where? Edit how?

  • Make Edit time and Edit count info available in Loupe Info, grid view option, Edit History panel and Smart Collection

    We all know that Lightroom can sort images in grid view by edit time or edit count. I cannot find any way to display edit time and/or edit count in view option or loupe info. I think these should be made viewable. Without them, when you have a large batch of image and you previously edited only some and come back later to finish, you don't know which ones need more work, etc.
    Another useful thing is that Edit History should have an option to show the date/time of the edit. It may be shown when mouse is hovered over an edit item line.
    Similarly, smart folder can filter the images by Edit Time being before/after a certain date. However, if I have no way of knowing what the edit times and counts are, this feature has little use.
    Alll of the above should be a specific date like 08-20-2009 or Today, yesterday, 43 days ago, etc. Both forms are useful for different purposes.

    Good idea.
    Also, it would be good if the SDK functions for updating custom metadata did not necessarily bump the edit time.

  • Two questions: editing info and capacity info

    I have two questions:
    1) I edited some artist/album info, but after synching it with my classic (80gb) the info hadn't changed on the Ipod. It did on Itunes, but not the Ipod. Any thoughts?
    2) As I put more music on my Ipod it increased the number of songs and the approximate # of days that this represented at the bottom of the Itunes screen. But then the days changed dramatically (and inaccurately) and now I have about 2500 songs, but it says that represents 250 days of music, which clearly isn't right. Any ideas on fixing this?
    Thanks

    Thank you for answering the first question - it worked!!!
    As far as the other question,
    When I create a playlist, for example, Jazz Tunes...and then I create another playlist titled Sarah McLachlan, etc., etc.,
    I will eventually have a list of playlists that are titled either as a specific artist or genre. And so, when I look to do a search on genres...I have to also look over the artists, making it confusing... Is there a way to seperate the two? Still not making sense? : /

  • How can I download an attachment on my iPAD 2, edit it and re-send?

    How can I download an attachment on my iPAD 2, edit it and re-send?
    Also how do I send a document from notes as an attachment on an email?

    Depends what kind of application you are downloading... U can use 3rd party software such as docs to go (it covers most of common documents). Else you can use word, numbers, or keynote apps.
    Just pressed and hold the attchment until a balloon appeared asking u whether u want to open in docs to go or quick look or u can swlect "open in" and it will give u other apps option.
    If u use docs to go, Just edit the docs and send from it
    For notes, i dont think u cant send it as attachment. However, you can just send it on emails. Just press the envelope button on the bottom of the note and it automatically put all the notes into the message in email
    Good luck

  • Need software which can send images to my editor, have them make selections, share them with me so I can edit the images and send the final results back to them.  Will Lightroom work?

    Need software which can send images to my editor, have them make selections, share them with me so I can edit the images and send the final results back to them.  Will Lightroom work?

    What I would like to do is to use Lightroom as I have been doing with LR 5.7.  Tag certain images to be shared to the Creative Cloud which my editor can then see and tag as to which she would like to see final versions of.  In the best case, I would then see these tags and edit the images as appropriate and save the JPEGs back to the Cloud where she can download them for final production.
    Possible?

Maybe you are looking for

  • Contacts and Calendar suddenly vanished from my new I phone and Mobile Me

    I set up my new iphone and mobile me account this morning with no problems. I used the phone, contacts, and calendar with no problem for about three hours and then all of my contacts and calendar entries vanished. I have backed both up from my PowerB

  • Early 2008 Mac Pro + ATI Radeon HD 4870 = Not working

    Just took delivery of my new HD 4870 video card today. I installed it in my Early 2008 Mac Pro and booted up. I got a picture no problem on one monitor, but nothing on the other. Furthermore, the display perfpane was missing a lot of controls, like A

  • Somewhat complicated nested generics question

    I have a slightly complicated generics question. I have some parameterized code that looks something like: public <T extends MyBaseObject> Map<String,T> loadObjectCache (Class<T> clazz) {     // load objects of type T from somewhere (file, database,

  • Make graph transparent to mouse?

    Is there any way to allow the mouse to reach behind one front panel object to reach one underneath?  Specifically: I placed a transparent XY graph in front of an Intensity graph, so that I can use its axes in place of the IG axes (left side of attach

  • 11x14 photos on photoshop elements 9

    How do I print 11x14 photos on photoshop elements version 9