How to input id data in jtable column 1 and load the detail in other column

Dear all,
I am new to java, I am writing a POS using Java. I want to scan goods barcode into column 1 of a jtable, then the program will load the product's name and price in
column 2 and column 3 from database. And also I want to have another row available where the barcode is scanned in previous row, i.e. I can add multiple products. And then I need to write the good's barcode to database. Please suggest any related article or code example. Thanks.

Peter-Hon wrote:
Dear all,
I am new to java, I am writing a POS using Java. I want to scan goods barcode into column 1 of a jtable, then the program will load the product's name and price in
column 2 and column 3 from database. And also I want to have another row available where the barcode is scanned in previous row, i.e. I can add multiple products. And then I need to write the good's barcode to database. Please suggest any related article or code example. Thanks.Your scanner will probably be a keyboard wedge, so any input from it will be equivalent to typing on the keyboard. You may be able to set it up to send a character, or sequence of characters that you can interpret as "move focus to the input cell, and input the remainder of the input there", if you can't do that, then you will have to just deal with the fact that people will end up scanning the bar codes into the quantity field.

Similar Messages

  • How to Pass XML Data to a PDF Form and Load it into form fields

    I have xml Form data in a string. I would like open a programatically launch a pdf document and pass the xml data as one of the parameters and this xml data needs to load all the form fields.
    Any Idea as to how this can be done?

    I have the same requirement as Daminu, but from the research I have been doing it seems your reply is only partially true. 
    If your PDF is an XFA PDF form, with Reader Extensions enabled, and you want to keep the Reader Extensions functionality for a user to use after your programmatic manipulation, then neither of these tools will work (FDFToolkit or iText).
    Upon the user opening the file once it has been programmatically modified, the user will see the following:
    From what I have read, this requirement can only be fullfilled by use of LiveCycle Reader Extensions Server?  Please confirm?

  • How Can I set up a JTable columns?

    Dear All,
    How can I set up my JTable columns to have the amount the user specifies?
    for example when the user types in 50 in JTextField 1 I want the JTables columns to then set to 50.
    How can this be done?
    Thanks
    lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

    As you can see I have tried this, but no success.
    If I am doing something wrong please accept my apology, and address me in the right direction.
    Thanks
    Lol
    import javax.swing.*;
    import javax.swing.table.TableModel;
    import java.io.*;
    import java.util.*;
    import java.lang.*;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    public class si1 extends javax.swing.JFrame implements ActionListener {
        JTextField name = new JTextField(15);
        JTextField name1 = new JTextField(15);
        public si1() {
            super("DataBase Loader");
            setSize(1025,740);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel pane = new JPanel();
            JPanel pane1 = new JPanel();
            JPanel pane2 = new JPanel();
            JPanel pane3 = new JPanel();
            JPanel pane4 = new JPanel();
            pane.setLayout(new GridLayout(20,1));
            pane1.setLayout(new BorderLayout());
            int j=10;
            String[][] data = new String[j][2];
            for (int k=0; k<j; k++){
               String[] row = {"",""};
               data[k] = row;
            String[] columnNames = {"First Name", "Last Name"};
            JTable perstab = new JTable(data, columnNames);
         ((DefaultTableModel)perstab.getModel()).setColumnCount(Integer.parseInt(name.getText()));
            perstab.setGridColor(Color.yellow);
            perstab.setPreferredScrollableViewportSize(new Dimension(500,500));
            JScrollPane scrollPane = new JScrollPane(perstab);
            pane1.add(new JPanel(), BorderLayout.EAST);
            JButton btn = new JButton("What are the names?");
            btn.addActionListener(this);
            btn.putClientProperty("DATABASE", perstab);
            pane1.add(new JPanel().add(btn), BorderLayout.SOUTH);
            pane2.add(name);
            pane3.add(name1);
            pane.add(pane2);
            pane.add(pane3);
            pane1.add(pane, BorderLayout.WEST);
            pane4.add(scrollPane);
            pane1.add(pane4, BorderLayout.CENTER);
            setContentPane(pane1);
            show();
        public static void main(String[] args) {
            si1 frame = new si1();
            frame.setVisible(true);
        public void actionPerformed(ActionEvent e) {
            JTable table = (JTable)((JButton)e.getSource()).getClientProperty("DATABASE");
            TableModel model = table.getModel();
            int count = model.getRowCount();
            String[] firstnames = new String[count];
            String[] lastnames = new String[count];
            for (int i=0; i < count; i++) {
               firstnames[i] = (String)model.getValueAt(i, 0);
                System.out.println("first name at row " + i + ": " + firstnames);
    lastnames[i] = (String)model.getValueAt(i, 1);
    System.out.println("lastname name at row " + i + ": " + lastnames[i]);

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • APEX CSS - How do I get data in report columns to wrap?

    I found information here http://www.orafaq.com/wiki/APEX_FAQ
    About How do I get data in report columns to wrap?
    This works and another way to do it is by adding the CSS directly into the
    Home>Application Builder>Application 137>Page 1>Report Attributes>Column Attributes page
    in the Column Formatting area. I added 'white-space:normal' and this works in FF but in
    IE it has a different behavior.
    In FireFox
    testasdgadhad
    gadfadgadgadg
    adgafhsrgjsgnsfg
    nsdfbadfafhafha
    dfhadfh
    In Internet Explorer
    testasdgadhad gadfadgadgadg adgafhsrgjsgnsfg nsdfbadfafhafha dfhadfh
    Is there a way to force it so it display in IE the same way that it displays in FF?
    The correct display format is FF.
    Thanks,
    Nestor :)

    I have try this because I found it during a search and it makes no difference in IE.
    This is what I am using now 'display: block; width: 100px;max-width:100px;white-space:normal'
    I also tried 'display:block; width:500px'
    If I use the values 'normal' or 'pre' for white-space' it works in FireFox but not in IE, The display block
    does not seem to make a difference. It seems that all I need is 'white-space:normal' but again
    it does not works on IE.
    Thanks,
    Nestor :-)

  • How can i open a DOC or TXT file and insert the data into table?

    How can i open a DOC or TXT file and insert the data into table?
    I have a doc file . the doc include some columns and some rows.(for example 'ID,Name,Date,...').
    I'd like open DOC file and I'd like insert them into the table with same columns.
    Thanks.

    Use the SQL*Loader utility or the UTL_FILE package.

  • How will be outbound data structure in sap xi after executing the stored pr

    Hi All
    can any one please tell me how will be outbound data structure in sap xi after executing the stored procedure by sender JDBC adapter?
    Thanks in advance
    regards
    Rams

    Hi..
    My stored procedure is select and it will be OUTBOUND in PI.
    is it will be same as following
    <resultset>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2></column-name2>
    <column-name3>column-value</ column-name3>
    <column-name4></column-name4>
    </row>
    <row>
    <column-name1>column-value</ column-name1>
    <column-name2></ column-name2>
    </row>
    </resultset>
    Regards
    Rams
    Edited by: Rameshkumar Varanganti on Oct 15, 2008 12:04 PM

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to call a jsp file from an servlet and access the jsp file objects??

    Hi everybody
    I have an jsp file where it contains a vector object with some data and I have a servlet that needs to access this vector object . How can my servlet call for this jsp page and get the vector object. ?
    then an applet will be calling this servlet to get some other object created with the data contained within this vector object...so each time Applet ask the servlet for the object the servlet need to call for this jsp page somehow
    My main question is the communication servlet-jsp
    please if u have any clue I will appreciate it
    thanks

    Hi
    There are several ways to share objects between JSPs/Servlets.
    You can share objects by putting them in the request-in which case the objects lifetime is limited by that of the request, Another way is to store them in the session, againg the lifetime is limited by the lifetime of the session. To have objects that have to persistent over the application life-span use the servletContext to store the objects.
    Any good tutorial should help you get started. Please see the link below for a tutorial on Servlets/JSPs
    Note: Local variables in the JSP cannot be shared with other components as their scope is limited to that particular Page/Servlet.
    Link: http://java.sun.com/docs/books/tutorial/servlets/
    Good Luck!
    Eshwar Rao
    Developer Technical Support
    Sun microsystems inc
    http://www.sun.com/developers/support

  • How do I combine all my calendars into one and delete the others?

    I have a work computer, a home desktop, and Apple air laptop and an 1phone 4s.
    I use Outlook calendar for all my appointments and only need one calendar.
    When I get notifications of my upcoming events on the Oulook page and on my iphone, I get multiple notifications, sometimes as many as 6 times.
    How can I combine all my calendars into one and delete the others?

    Your old account is the one you migrated, but it has been renamed because the new account had the same name. "Fixing" this is a bit complicated. It is possible to transfer data from one account to the other. See Transferring files from one User Account to another.
    A cleaner solution is to do this:
    Create a temporary new admin user account with a completely different username.
    Log into this new account.
    Delete the new account you created before migrating.
    Delete the old account you migrated that has the changed name.
    Re-migrate your old account from the Mini.
    Log into the newly migrated account and delete the temporary account.
    And, the simplest solution is to use the migrated account as-is and delete the account you originally made on the new computer.

  • HT4623 I tried updating to iOS6 via itunes bc my storage space was pass limit and now my phone is telling me it's in recovery mode and I need to restore it. I didn't back it up. How do I take it out of recovery mode and keep the information on my phone?

    I tried updating to iOS6 via itunes bc my storage space was pass limit and now my phone is telling me it's in recovery mode and I need to restore it. I didn't back it up. How do I take it out of recovery mode and keep the information on my phone?

    You cannot.  If it is in recovery mode, the data is already gone.
    Did you fail to make sure everything was on your computer before updating?

  • How to use lsmw and load cin details of the customer

    hi,
    how to use lsmw and load CIN details of the customer master data as the CIN DETAILS are not visible under XD01.
    thanx in advance
    regards,
    balajit

    i got the solution

  • Taking the data from interactive forms and load the data into SAP system?

    hi all,
    I want to know how to take the data from interactive forms and load the data into sap system?
    if u have any sample scenario, explain with that.
    thanks in advance
    Raja

    Hello,
    Check the program...
    SAPBC480_DEMO.
    Check the below threads
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/88e7ea34-0501-0010-95b0-ed14cfbeb85a
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/bfbcd790-0201-0010-679d-e36a3c6b89fa
    Thanks
    Seshu

  • How do I use my canon mx432 to scan and email the information?

    How do I use my canon MX432 to scan and send the scanned documents forward on e-mail?

    Hi supercon!
    So that the Community can help you better, we will need to know the Computer Operating System you're using (Windows XP/Vista/7/8 or Mac 10.x), as well as the applications you're trying to scan with.
    Any other details you'd like to give will only help the Community better understand your issue!
    If this is an urgent support need, please CLICK HERE to reach our friendly Technical Support Team by phone or email.
    Thanks and have a great day!

  • I am using FCP 7.0.3.on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    I am using FCP 7.0.3 on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    .. and by the way, the jump from FCP 6.0.3 to FCP 7.0 (or higher) isn't an "update"  It's a full version "upgrade" that has to be done using the install discs (or disc images).
    -DH

Maybe you are looking for

  • Question on cl_gui_frontend_services= file_save_dialog

    Hi all,,,  need your help.. thank you i n ad vance .. why ist tht happen?  the default extension, 'txt' but  the "save as type" in the dialog box  shows 'XLS', excel file ?? CALL METHOD cl_gui_frontend_services=>file_save_dialog     EXPORTING       w

  • Corrupt hard drive, new photos

    My imac recently crashed, and was diagnosed with a corrupt hard drive, but I am most worried about my photos. Is there any way that I can access my iphoto threw another computer? Or online? Please help

  • Is there a way i can prevent my hp 6600 to stop disconnecting from wifi?

     I have  do the setup wireless wizard everday.

  • Why does my cursor spin?

    I just got a new MacBookPro, and I recently downloaded pages and number and keynote but even when nothing is downloading my cusor is a rainbow circle and it spins. I cant move anything on the desktop or open anthing on the desktop, and I am not reall

  • Finder-based account with root privileges?

    Is there anyway to give the Admin account root privileges? Or is there a true Root account in the Finder? There are times when I need to move/change files in other accounts. Can this be done through the Finder? Or do I have to use Unix and the Termin