Storing data from resultset to javascript array

Hi all,
Can anyone let me know how to store data from servlet's result set to javascript array ?
Firstly i have downloaded all the data at client side in the resultset while the servlet form
is first loaded...then i want to use javascript array to check that whether the code entered by
the user on runtime exists in resultset or not.
If the code doesnot exist the user will be prompted to enter another code by alert.
and if the specified code exists then the name of the respective client will be displayed in
text box on the servlet form.
For this reason i want to use javascript for code validation.
Thanks for any help in advance.
sunny.v

Just let JSP print it as JS array.

Similar Messages

  • Read Video data from buffer or byte array

    Hi guys,
    I've developed a tx/rx module, the tx read an mpg file and transfer it over network. rx has the data in a byte array, I also feed the byte array to a media buffer. Now my question is how to creat the player and feed the player to play the content of the buffer or byte array?
    I would really appreaciate if someone could help me please...
    Thanx
    I haven't and didn't want to use any of the RTP stuff...

    Hi, I tried PullBufferDataSource. What I am trying to do is : read a .wav file into a queue, then construct a datasource with this queue. The processor will be contructed to process the datasource, and a datasink to sink data to a file. I think if this workflow could work, it should work in network transmission.
    In fact the code works partially. The trick part is the read( Buffer ) method. If I try to use 'if' statement to see if Queue has empty or not, the datasink could not format the head part of output file correctly. If I didnot use 'if' statement, the program will terminate when exception occurs. The output file is all right.
    I did not understand what is going on.
    Note: the original file is a RAW data file without format info.
    Here is the code fragments. Hopefully we can work together to figure it out.
    Thanks.
    Jim
    * QueueDataSourceTester.java
    * Created on November 11, 2002, 10:29 AM
    package bonephone;
    import javax.media.*;
    import javax.media.control.*;
    import javax.media.protocol.*;
    import javax.media.datasink.*;
    import javax.media.format.AudioFormat;
    import java.util.LinkedList;
    import java.io.*;
    * @author wguo
    public class QueueDataSourceTester implements ControllerListener, DataSinkListener {
    protected LinkedList myQueue;
    /** Creates a new instance of QueueDataSourceTester */
    public QueueDataSourceTester() {
    myQueue = new LinkedList();
    public void testIt( ){
    // Read a file into a Queue
    FileInputStream inputStream = null;
    try{
    inputStream = new FileInputStream( "c:/media/phone.wav");
    catch( IOException ioe ){
    System.err.println( "Error on open media file." );
    try{
    byte data[] = new byte[1024];
    int n ;
    while( ( n = inputStream.read( data, 0, 1024 )) != -1 ){
    myQueue.addLast( data );
    data = new byte[1024];
    inputStream.close();
    catch( IOException ioe ){
    System.err.println( "Error on reading file." );
    System.out.println( "Queue Size: " + myQueue.size() );
    System.out.println( "myQueue = " + myQueue.size() );
    QueueDataSource dataSource = new QueueDataSource( myQueue );
    Processor p = null ;
    try{
    System.out.println( "Create processor for QueueDataSource ... " );
    p = Manager.createProcessor( dataSource );
    catch( Exception e ){
    System.err.println( "Cannot create a processor for the QueueDataSource. " );
    System.out.println( "\nProcessor is created." );
    p.addControllerListener( this );
    p.configure();
    if( !waitForState( p, p.Configured ) ) {
    System.err.println( "Failed to configure the processor." );
    System.out.println( "\nProcessor is configured") ;
    // p.setContentDescriptor( new ContentDescriptor( ContentDescriptor.RAW ) );
    p.setContentDescriptor( new ContentDescriptor( FileTypeDescriptor.WAVE ) );
    TrackControl tcs[] = p.getTrackControls();
    Format f[] = tcs[0].getSupportedFormats();
    if( f == null || f.length == 0 ){
    System.err.println( "The mux does not support the input format : "+ tcs[0].getFormat() );
    tcs[0].setFormat(
    new AudioFormat( AudioFormat.ULAW,
    8000,
    8,
    1,
    Format.NOT_SPECIFIED,
    AudioFormat.SIGNED,
    8,
    Format.NOT_SPECIFIED,
    Format.byteArray ) );
    //System.out.println( "Setting the track format to: " + f[4] );
    p.realize();
    if( !waitForState( p, p.Realized )){
    System.err.println( "Failed to realize the processor" );
    DataSink dsink;
    MediaLocator outML = new MediaLocator("file:/c:/media/queue.wav" );
    if( (dsink = createDataSink( p, outML )) == null ){
    System.err.println( "Failed to create a datasink for given " +
    "mediaLocator : " + outML );
    dsink.addDataSinkListener( this );
    System.out.println( "\nProcessor is realized" );
    try{
    p.start();
    dsink.start();
    catch( IOException ioe ){
    System.err.println( "IO error during processing." );
    waitForFileDone();
    try{
    dsink.close();
    catch( Exception e ){
    p.removeControllerListener( this );
    System.err.println( "... done processing." );
    DataSink createDataSink( Processor p, MediaLocator outML ){
    DataSource ds ;
    if( ( ds = p.getDataOutput() ) == null ) {
    System.err.println( "Something is really wrong: the processor does" +
    " not have an output DataSource. " );
    return null;
    System.out.println( "DataOutput: " + ds.getContentType() );
    DataSink dsink;
    try{
    System.out.println( "- create DataSink for : " + outML );
    dsink = Manager.createDataSink( ds, outML );
    dsink.open();
    catch( Exception e ){
    System.err.println( "Cannot create the DataSink: " + e );
    return null;
    return dsink;
    Object waitSync = new Object();
    boolean stateTransitionOK = true;
    boolean waitForState( Processor p, int state ){
    synchronized( waitSync ){
    try{
    while( p.getState() < state && stateTransitionOK )
    waitSync.wait();
    catch( Exception e ){
    return stateTransitionOK;
    public void controllerUpdate(javax.media.ControllerEvent controllerEvent) {
    if( controllerEvent instanceof ConfigureCompleteEvent ||
    controllerEvent instanceof RealizeCompleteEvent ||
    controllerEvent instanceof PrefetchCompleteEvent ){
    synchronized( waitSync ){
    stateTransitionOK = true;
    waitSync.notifyAll();
    } else if( controllerEvent instanceof ResourceUnavailableEvent ){
    synchronized( waitSync ){
    stateTransitionOK = false;
    waitSync.notifyAll( );
    public static void main( String args[] ){
    QueueDataSourceTester tester = new QueueDataSourceTester();
    tester.testIt();
    Object waitFileSync = new Object();
    boolean fileDone = false;
    boolean fileSuccess = true;
    boolean waitForFileDone(){
    synchronized( waitFileSync ){
    try{
    waitFileSync.wait( 5000 );
    catch( Exception e ){
    System.err.println( "Error on waiting file to be done" );
    return fileSuccess;
    public void dataSinkUpdate(javax.media.datasink.DataSinkEvent dataSinkEvent) {
    if( dataSinkEvent instanceof EndOfStreamEvent ){
    synchronized( waitFileSync ){
    fileDone = true;
    waitFileSync.notifyAll();
    else if ( dataSinkEvent instanceof DataSinkErrorEvent ){
    synchronized( waitFileSync ){
    fileDone = true;
    fileSuccess = false;
    waitFileSync.notifyAll();
    // Inner Class
    * A datasource that will read Media data from Queue.
    * Inside queue individual RAW data packats are stored.
    * @author wguo
    public class QueueDataSource extends PullBufferDataSource{
    protected QueueSourceStream streams[];
    /** Creates a new instance of QueueDataSource */
    public QueueDataSource( LinkedList source ) {
    printDebug( "QueueDataSource: QueueDataSource( LinkedList) " );
    streams = new QueueSourceStream[1];
    streams[0] = new QueueSourceStream( source );
    public void connect() throws java.io.IOException {
    printDebug( "QueueDataSource: connect() " );
    public void disconnect() {
    printDebug( "QueueDataSource: disconnect()" );
    public String getContentType() {
    return ContentDescriptor.RAW;
    public Object getControl(String str) {
    printDebug( "QueueDataSource: getControl(String) " );
    return null;
    public Object[] getControls() {
    printDebug( "QueueDataSource: getControls() " );
    return new Object[0];
    public javax.media.Time getDuration() {
    return DURATION_UNKNOWN;
    public javax.media.protocol.PullBufferStream[] getStreams() {
    printDebug( "QueueDataSource: getStreams() " );
    return streams;
    public void start() throws java.io.IOException {
    printDebug( "QueueDataSource:start()" );
    public void stop() throws java.io.IOException {
    printDebug( "QueueDataSource: stop() " );
    private void printDebug( String methodInfo ){
    System.out.println( methodInfo + " is called" );
    // Inner Class
    public class QueueSourceStream implements PullBufferStream{
    LinkedList sourceQueue;
    AudioFormat audioFormat;
    boolean ended = false;
    /** Creates a new instance of QueueSourceStream */
    public QueueSourceStream( LinkedList sourceQueue ) {
    printDebug( "QueueSourceStream: QueueSourceStream( LinkedList )" );
    this.sourceQueue = sourceQueue;
    audioFormat = new AudioFormat(
    AudioFormat.ULAW,
    8000,
    8,
    1,
    Format.NOT_SPECIFIED,
    AudioFormat.SIGNED,
    8,
    Format.NOT_SPECIFIED,
    Format.byteArray);
    public boolean endOfStream() {
    printDebug( "QueueSourceStream: endOfStream()" );
    return ended;
    public javax.media.protocol.ContentDescriptor getContentDescriptor() {
    printDebug( "QueueSourceStream: getContentDescriptor()" );
    return new ContentDescriptor( ContentDescriptor.RAW) ;
    public long getContentLength() {
    printDebug( "QueueSourceStream:getContentLength()" );
    return 0;
    public Object getControl(String str) {
    printDebug( "QueueSourceStream:getControl( String) " );
    return null;
    public Object[] getControls() {
    printDebug( "QueueSourceStream:getControls()" );
    return new Object[0];
    public javax.media.Format getFormat() {
    printDebug( "QueueSourceStream:getFormat()" );
    return audioFormat;
    public void read(javax.media.Buffer buffer) throws java.io.IOException {
    buffer.setData( (byte[])sourceQueue.removeFirst() );
    buffer.setOffset( 0 );
    buffer.setLength( 1024 );
    buffer.setFormat( audioFormat );
    printDebug( "QueueSourceStream: read( Buffer ) " );
    else {
    buffer.setEOM( true );
    buffer.setOffset( 0 );
    buffer.setLength( 0 );
    ended = true;
    System.out.println( "Done reading byte array" );
    return;
    public boolean willReadBlock() {
    printDebug( "QueueSourceStream: willReadBlock()" );
    if( myQueue.isEmpty() )
    return true;
    else
    return false;
    private void printDebug( String methodInfo ){
    System.out.println( methodInfo + " is called. " );

  • How can I display data from ResultSet to a component like jLable and JTable

    hi there
    My code as shown below
    boolean fillTable(int type){
            try{
                //model.setRowCount(0);
                if(type == 1){
                    System.out.println("line 1");
                    model = new DefaultTableModel(new Object [][] {   },
                            new String[] { "\u1200 Code", "Description" });
                    System.out.println("line 2");
                    while(lookup.rs2.next()){
                        System.out.println("line in while");
                        model.addRow(new String[] { lookup.rs2.getString("code"),
                            "\u1201 " + lookup.rs2.getString("amdescription")});
                          //System.out.println("While : " + lookup.rs2.getString("code") + " " +
                            //      lookup.rs2.getString("amdescription"));
                    lookup.rs2.last();
                    String str;
                    str =  new String (lookup.rs2.getString("amdescription"));
                    jLabel2.setText(str);
                    System.out.println("line 3");
                    tblLookup.setModel(model);
                    System.out.println("line 4");
                else if(type == 2){
                    System.out.println("line else if 1");
            }catch(Exception ex)    {
                System.out.println("Exception @ MilLookupDisplay fillTable : " + ex.getMessage());
                return false;
            return true;
        }I can read from access db and put the resultset on rs2 , it works fine
    my problem is when I try to display the data ( which is amharic unicode character ) on jTable and jLabel as shown it displays '???'
    besides I have checked the font by giving unicode like '\u1200' on both component displays it well
    so is there something to do before trying to display unicode characters from resultSet
    please I ' m waiting
    thanks a lot

    http://forum.java.sun.com/thread.jspa?threadID=5153938

  • Error NO Data Found  in fetching a data from ResultSet

    I am fetching a data from Access Data base ...and i am getting data in a result set...
    query.append(" select * from college_admission_form ");
    stmt = con.createStatement();
    rs = stmt.executeQuery(query.toString());
    while(rs.next()){
    String ad_id = rs.getString(1);
    String admFormId = rs.getString(2); // line 2
    String collegeId = rs.getString(26);
    String temp = rs.getString(2); // error is showing in this line that NO Data Found.
    but earlier in line 2 i am getting the data.
    how to solve it ...plz reply fast

    I am accessing MS Access DB through a simple web appln using jdbc-odbc
    I am getting error at
    while (rs.next())
    System.out.println("rs.getString(1)="+rs.getString(1));
    objEmp.setEmpName(rs.getString(2)); -----at this line
    The problem i am getting is when i assign/set "rs.getString" value to something.If I commect the problem line, it goes ahead well.
    Can some one pls tell me how i shud resolve this problem or how shud i make use of the resultset?
    Thanks

  • Storing data from XML files in Oracle DB

    Hi!
    I just started to work with XML and need to save data from XML files into Oracle database. I tried to run sample from Oracle web site. The code was following:
    public class xmlwritedb
    public static void main(String args[]) throws SQLException
    String tabName = "EMP"; // Table into which to insert XML data
    String fileName = "emp.xml"; // XML document filename
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Initialize a JDBC connection
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:oci8:scott/tiger@");
    // Insert XML data from file (filename) into
    // database table (tabName)
    OracleXMLSave save = new OracleXMLSave(conn, tabName);
    URL url = save.createURL(fileName);
    int rowCount = save.insertXML(url);
    System.out.println(" successfully inserted "+rowCount+
    " rows into "+ tabName);
    conn.close();
    But it does not work.
    OracleXMLSave object does not see file name.
    Please, help me solve this problem. Also,where is it possible to find any documentation on oracle.xml.* classes API.
    Thank you.
    Maya.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by sudeepk:
    If a java exception is thrown probably during ur install u might have forgotten
    grant javauserpriv to scott;
    grant javasyspriv to scott;
    Thanks
    [email protected]
    <HR></BLOCKQUOTE>
    Thank you!!!

  • Data from PDF  with  javascript

    Looking for some code to get me started doing: 1) moving through subdirectories 2) extracting data from a PDF form to a text file (CSV)
    We need to move through 100's of directories and extract PDF form data.
    Fields are the same but files have different names; in all these files is a form page with the same field structure.
    In other words; we keep track of jobs for hundreds of customers using a
    pdf in hundreds of folders ( folder and file names reflect the customer name( I did not, BTW, design such a silly way of tracking jobs) )
    Some sample code will save me hours or days, of course -

    > but never in Java
    There is no Java interface to Acrobat. Do you perhaps mean a LiveCycle server, as they can be extended with Java?
    > Windows 2003 server box
    Again, this makes me think of a LiveCycle server instead of Acrobat, since Acrobat is not licensed for server use.

  • How can I copy Captivate 6.x document array data into a new Javascript array

    I'd like to copy an array from my captivate document variables to a variable within a script my project runs.  I attempted to use objCP.cpEIGetValue("m_VarHandle.Array.slice(0)") but that didnt seem to work.

    One the primary things I learnt at Uni is the Object Oriented Modal of design and Development, MVC etc.
    Seperation of the function, display, data being a fundemental point to develop and all the benifits of that.
    Also, Your HTML code will weigh more, i.e. a web page riddled with similar code will have a kb size that is a lot larger than necessary. The inline script and css will make the source more dense, search engines have to sift through it to find your actual content.
    Your HTML code will never be truely cached but the external dependencies, such as the CSS and JavaScript files, will be cached by the visitor’s web browser after the first visit – this means that instead of loading a lot of superfluous HTML code for every page in your web site the visitor visits, it will quickly retrieve all style and interaction locally from the web browser cache and thus improve perfomance further.
    No fall back interaction, and harder to manage, correct and update along with poor attrinbute accessability. Having your scripting in one central location makes your development time more effecient, working on new aspects of the site has no effect on the live site, functions can be wrote once called many times and only when needed. Object coding in Javascript improves performance, management, use and more also.
    With these in mind the page load is just longer with inline scripting and the event handling is poorer and then coupled with the other elments mentioned above.
    Just better done right BC has runs gzip, you can optimise your code and the server caching of css, script, image files and the browser it just all leads to better perfomance of your site which is also increasingly something google wants to see to rank you well.

  • Updating JTable from data from resultset

    I have an athletics database, where the user updates an event and round e.g. 100M run Round 1. I then have a query which returns the 3 fastest times from each round for whatever event.
    Now on my JTable gui, the user chooses what event and round to update through 2 JCombo boxes, one for events, one for rounds. Now if the user chooses the round name final, i need the JTable to update the table with the three fastest times from rounds 1, 2 and 3.
    Whats the best way to do this? I was thinking putting all the different result sets into an array, and then through an if loop have somthing like
    if(roundType.equals (final))then in the body of this loop, create an instance of my JTable setting the rows for each column the the resultset data.
    Is this the right approach or any other advise?
    cheers

    You probably defined the "table" variable twice. Once as a class variable and once as a local variable and your "insertValue" method is referring to the wrong variable and therefore updating the wrong table.

  • Storing Data from Serial Connection

    Hello All,
    I am fairly new to LabView, I am trying to store and anaylze values from a non-Labview hardware via an rs-232 connection.
    I have two devices on COM1 and COM2 ports. COM2 sends a value which I would like to store in an array. COM 2 points will form a somewhat sine wave within a few seconds. I would like to compare these values live to generate: max and min peak values, peak to peak values, and mean (I know LabView has signal icons for this, I'm just not sure how to wire it up).
    I have attached the vi.
    Thank you for your time and help.
    Kelvin R.
    Solved!
    Go to Solution.
    Attachments:
    krreadwrite.vi ‏74 KB

    kore101 wrote:I believe I need to use a for loop along with shift registers, but I just don't know how to.
    LabVIEW Basics
    LabVIEW 101
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Need help in storing data from JList into a vector

    need help in doing the following.-
    alright i click a skill on industryskills Jlist and press the add button and it'll be added to the applicantskills Jlist. how do i further store this data that i added onto the applicantskills JList into a vector.
    here are the codes:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.text.*;
    import java.util.*;
    import java.util.Vector;
    import javax.swing.JScrollPane.*;
    //import javax.swing.event.ListSelectionListener;
    public class Employment extends JFrame
            //declare class variables
            private JPanel jpApplicant, jpEverything,jpWEST, jpCENTRE, jpEAST, jpAddEditDelete,
                                       jpCentreTOP, jpCentreBOT, jpEastTOP, jpEastCENTRE, jpEastBOT,
                                       jpBlank1, panel1, panel2, panel3, panel4,jpBottomArea,
                                       jpEmptyPanelForDisplayPurposes;
            private JLabel jlblApplicantForm, jlblAppList, jlblName, jlblPhone,
                                       jlblCurrentSalary, jlblPassword, jlblDesiredSalary,
                                       jlblNotes, jlblApplicantSkills, jlblIndustrySkills,
                                       jlblBlank1, jlblBlank2, ApplicantListLabel,
                                       NotesListLabel, ApplicantSkillsLabel,
                                       IndustrySkillsLabel,jlblEmptyLabelForDisplayPurposes;  
            private JButton jbtnAdd1, jbtnEdit, jbtnDelete, jbtnSave, jbtnCancel,
                                            jbtnAdd2, jbtnRemove;
            private JTextField jtfName, jtfPhone, jtfCurrentSalary, jtfPassword,
                                               jtfDesiredSalary;
              private JTabbedPane tabbedPane;
            private DefaultListModel /*listModel,*/listModel2;
              String name,password,phone,currentsalary,desiredsalary,textareastuff,NotesText;
              String selectedname;
            final JTextArea Noteslist= new JTextArea();;
            DefaultListModel listModel = new DefaultListModel();
            JList ApplicantSkillsList = new JList(listModel);
           private ListSelectionModel listSelectionModel;
            JList ApplicantList, /*ApplicantSkillsList,*/ IndustrySkillsList;
            //protected JTextArea NotesList;    
                    //Vector details = new Vector();
                  Vector<StoringData> details = new Vector<StoringData>();             
                public static void main(String []args)
                    Employment f = new Employment();
                    f.setVisible(true);
                    f.setDefaultCloseOperation(EXIT_ON_CLOSE);
                    f.setResizable(false);
                }//end of main
                    public Employment()
                            setSize(800,470);
                            setTitle("E-commerce Placement Agency");
                                  Font listfonts = new Font("TimesRoman", Font.BOLD, 12);
                            JPanel topPanel = new JPanel();
                            topPanel.setLayout( new BorderLayout() );
                            getContentPane().add( topPanel );
                            createPage1();
                            createPage2();
                            createPage3();
                            createPage4();
                            tabbedPane = new JTabbedPane();
                            tabbedPane.addTab( "Applicant", panel1 );
                            tabbedPane.addTab( "Job Order", panel2 );
                            tabbedPane.addTab( "Skill", panel3 );
                            tabbedPane.addTab( "Company", panel4 );
                            topPanel.add( tabbedPane, BorderLayout.CENTER );
            public void createPage1()//PAGE 1
                 /*******************TOP PART********************/
                            panel1 = new JPanel();
                            panel1.setLayout( new BorderLayout());
                                  jpBottomArea = new JPanel();
                                  jpBottomArea.setLayout(new BorderLayout());
                            jpApplicant= new JPanel();
                            jpApplicant.setLayout(new BorderLayout());
                            Font bigFont = new Font("TimesRoman", Font.BOLD,24);
                            jpApplicant.setBackground(Color.lightGray);
                            jlblApplicantForm = new JLabel("\t\t\t\tAPPLICANT FORM  ");
                            jlblApplicantForm.setFont(bigFont);
                            jpApplicant.add(jlblApplicantForm,BorderLayout.EAST);
                            panel1.add(jpApplicant,BorderLayout.NORTH);
                            panel1.add(jpBottomArea,BorderLayout.CENTER);
           /********************************EMPTY PANEL FOR DISPLAY PURPOSES*************************/
                               jpEmptyPanelForDisplayPurposes = new JPanel();
                               jlblEmptyLabelForDisplayPurposes = new JLabel(" ");
                               jpEmptyPanelForDisplayPurposes.add(jlblEmptyLabelForDisplayPurposes);
                               jpBottomArea.add(jpEmptyPanelForDisplayPurposes,BorderLayout.NORTH);
           /*****************************************WEST*********************************/             
                            jpWEST = new JPanel();                 
                            jpWEST.setLayout( new BorderLayout());
                            //Applicant List
                                  listModel2=new DefaultListModel();
                                  ApplicantList = new JList(listModel2);
                                listSelectionModel = ApplicantList.getSelectionModel();
                                listSelectionModel.addListSelectionListener(new SharedListSelectionHandler());
                                JScrollPane scrollPane3 = new JScrollPane(ApplicantList);
                                  ApplicantList.setPreferredSize(new Dimension(20,40));
                                 scrollPane3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);                                             
                                scrollPane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                            ApplicantListLabel = new JLabel( "Applicant List:");
                            jpWEST.add(ApplicantListLabel,"North"); 
                            jpWEST.add(scrollPane3,"Center");
                            jpBottomArea.add(jpWEST,BorderLayout.WEST);
                            /*********CENTRE*********/
                            jpCENTRE = new JPanel();
                            jpCENTRE.setLayout(new GridLayout(2,1));
                            jpCentreTOP = new JPanel();
                            jpBottomArea.add(jpCENTRE,BorderLayout.CENTER);
                            jpCENTRE.add(jpCentreTOP);
                            jpCentreTOP.setLayout(new GridLayout(6,2));
                              //Creating labels and textfields
                            jlblName = new JLabel( "Name:");
                            jlblBlank1 = new JLabel ("");
                            jtfName = new JTextField(18);
                            jlblBlank2 = new JLabel("");
                            jlblPhone = new JLabel("Phone:");
                            jlblCurrentSalary = new JLabel("Current Salary:");
                            jtfPhone = new JTextField(13);
                            jtfCurrentSalary = new JTextField(7);
                            jlblPassword = new JLabel("Password:");
                            jlblDesiredSalary = new JLabel("Desired Salary:");
                            jtfPassword = new JTextField(13);
                            jtfDesiredSalary = new JTextField(6);
                              //Add labels and textfields to panel
                            jpCentreTOP.add(jlblName);
                            jpCentreTOP.add(jlblBlank1);
                            jpCentreTOP.add(jtfName);
                            jpCentreTOP.add(jlblBlank2);
                            jpCentreTOP.add(jlblPhone);
                            jpCentreTOP.add(jlblCurrentSalary);
                            jpCentreTOP.add(jtfPhone);
                            jpCentreTOP.add(jtfCurrentSalary);
                            jpCentreTOP.add(jlblPassword);
                            jpCentreTOP.add(jlblDesiredSalary);
                            jpCentreTOP.add(jtfPassword);
                            jpCentreTOP.add(jtfDesiredSalary);
                            //Noteslist
                            jpCentreBOT = new JPanel();
                            jpCentreBOT.setLayout( new BorderLayout());
                            jpCENTRE.add(jpCentreBOT);
                            jpBlank1 = new JPanel();
                             //     Noteslist = new JTextArea(/*Document doc*/);
                            JScrollPane scroll3=new JScrollPane(Noteslist);
                                scroll3.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                                scroll3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                            NotesListLabel = new JLabel( "Notes:");
                            jpCentreBOT.add(NotesListLabel,"North"); 
                            jpCentreBOT.add(scroll3,"Center");
                            jpCentreBOT.add(jpBlank1,"South");
                            jpBottomArea.add(jpCENTRE,BorderLayout.CENTER);
                            /**********EAST**********/
                            //Applicant Skills Panel
                            //EAST ==> TOP
                            jpEAST = new JPanel();
                            jpEAST.setLayout( new BorderLayout());
                            jpEastTOP = new JPanel();
                            jpEastTOP.setLayout( new BorderLayout());
                            ApplicantSkillsLabel = new JLabel( "Applicant Skills");
                            JScrollPane scrollPane1 = new JScrollPane(ApplicantSkillsList);
                               scrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                              scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);                                             
                            ApplicantSkillsList.setVisibleRowCount(6);
                            jpEastTOP.add(ApplicantSkillsLabel,"North"); 
                            jpEastTOP.add(scrollPane1,"Center");
                            jpEAST.add(jpEastTOP,BorderLayout.NORTH);
                            jpBottomArea.add(jpEAST,BorderLayout.EAST);
                            //Add & Remove Buttons
                            //EAST ==> CENTRE
                            jpEastCENTRE = new JPanel();
                            jpEAST.add(jpEastCENTRE,BorderLayout.CENTER);
                            jbtnAdd2 = new JButton("Add");
                            jbtnRemove = new JButton("Remove");
                            //add buttons to panel
                            jpEastCENTRE.add(jbtnAdd2);
                            jpEastCENTRE.add(jbtnRemove);
                            //add listener to button
                           jbtnAdd2.addActionListener(new Add2Listener());
                           jbtnRemove.addActionListener(new RemoveListener());
                            //Industry Skills Panel
                            //EAST ==> BOTTOM
                            jpEastBOT = new JPanel();
                            jpEastBOT.setLayout( new BorderLayout());
                           String[] data = {"Access97", "Basic Programming",
                           "C++ Programming", "COBOL Programming",
                           "DB Design", "Fortran programming"};
                           IndustrySkillsList = new JList(data);
                           JScrollPane scrollPane = new JScrollPane(IndustrySkillsList);
                           scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);                                             
                           scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
                           IndustrySkillsLabel = new JLabel( "Industry Skills:");
                           jpEastBOT.add(IndustrySkillsLabel,"North"); 
                           jpEastBOT.add(scrollPane,"Center");
                           jpEAST.add(jpEastBOT,BorderLayout.SOUTH);
                            //BOTTOM
                            jpAddEditDelete= new JPanel();
                            jbtnAdd1=       new JButton("Add");
                            jbtnEdit=       new JButton("Edit");
                            jbtnDelete=     new JButton("Delete");
                            jbtnSave=       new JButton("Save");
                            jbtnCancel=     new JButton("Cancel");
                            jpAddEditDelete.add(jbtnAdd1);
                            jpAddEditDelete.add(jbtnEdit);
                            jpAddEditDelete.add(jbtnDelete);
                            jpAddEditDelete.add(jbtnSave);
                            jpAddEditDelete.add(jbtnCancel);
                               jbtnEdit.addActionListener(new EditListener());
                               jbtnDelete.addActionListener(new DeleteListener());
                                jbtnEdit.addActionListener(new EditListener());
                            jbtnAdd1.addActionListener(new Add1Listener());
                            jbtnCancel.addActionListener(new CancelListener());
                            jpBottomArea.add(jpAddEditDelete,BorderLayout.SOUTH);
            public void createPage2()//PAGE 2
                    panel2 = new JPanel();
                    panel2.setLayout( new GridLayout(1,1) );
                    panel2.add( new JLabel( "Sorry,under construction" ) );
            public void createPage3()//PAGE 3
                    panel3 = new JPanel();
                    panel3.setLayout( new GridLayout( 1, 1 ) );
                    panel3.add( new JLabel( "Sorry,under construction" ) );
            public void createPage4()//PAGE 4
                    panel4 = new JPanel();
                    panel4.setLayout( new GridLayout( 1, 1 ) );
                    panel4.add( new JLabel( "Sorry,under construction" ) );
            public class Add1Listener implements ActionListener
            public void actionPerformed(ActionEvent e)
                    name = jtfName.getText();
                    password = jtfPassword.getText();
                    phone = jtfPhone.getText();
                    currentsalary = jtfCurrentSalary.getText();
                    int i= Integer.parseInt(currentsalary);
                    desiredsalary = jtfDesiredSalary.getText();
                    int j= Integer.parseInt(desiredsalary);
                       StoringData person = new StoringData(name,password,phone,i,j);
                   //     StoringData AppSkillsList = new StoringData(listModel);
                    details.add(person);
                 //     details.add(AppSkillsList);
                  listModel2.addElement(name);
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");
    //                NotesList.setText("");
            public class Add2Listener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                           String temp1;
                           temp1 = (String)IndustrySkillsList.getSelectedValue();
                           listModel.addElement(temp1);
            public class RemoveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                            int index = ApplicantSkillsList.getSelectedIndex();
                                listModel.remove(index);
            public class EditListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                            jtfName.setEditable(true);
                            jtfPassword.setEditable(true);
                            jtfPhone.setEditable(true);
                            jtfCurrentSalary.setEditable(true);
                            jtfDesiredSalary.setEditable(true);
                            Noteslist.setEditable(true);
                            jbtnAdd2.setEnabled(true);               
                            jbtnRemove.setEnabled(true);
                            jbtnSave.setEnabled(true);
                            jbtnCancel.setEnabled(true);                     
            public class DeleteListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                        int index1 = ApplicantList.getSelectedIndex();
                            listModel2.remove(index1);
            public class SaveListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
            public class CancelListener implements ActionListener
                    public void actionPerformed(ActionEvent e)
                    jtfName.setText("");
                    jtfPassword.setText("");
                    jtfPhone.setText("");
                    jtfCurrentSalary.setText("");
                    jtfDesiredSalary.setText("");                         
            public class SharedListSelectionHandler implements ListSelectionListener
            public void valueChanged(ListSelectionEvent e)
             selectedname =ApplicantList.getSelectedValue().toString();
             StoringData selectedPerson = null;
             jtfName.setEditable(false);
             jtfPassword.setEditable(false);
             jtfPhone.setEditable(false);
             jtfCurrentSalary.setEditable(false);
             jtfDesiredSalary.setEditable(false);                                 
             Noteslist.setEditable(false);
             jbtnAdd2.setEnabled(false);               
             jbtnRemove.setEnabled(false);
             jbtnSave.setEnabled(false);
             jbtnCancel.setEnabled(false);
                   for (StoringData person : details)
                          if (person.getName1().equals(selectedname))
                                 selectedPerson = person;
                                 jtfName.setText(person.getName1());
                                 jtfPassword.setText(person.getPassword1());
                              jtfPhone.setText(person.getPhone1());
                              //String sal1 = Integer.parseString(currentsalary);
                             // String sal2 = Integer.parseString(desiredsalary);
                             // jtfCurrentSalary.setText(sal1);
                             // jtfDesiredSalary.setText(sal2);
                                 break;
                   //     if (selectedPerson != null)
    }

    Quit posting 300 line programs to ask a question. We don't care about your entire application. We only care about code that demonstrates your current problem. We don't want to read through 300 lines to try and find the line of code that is causing the problem.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.
    Here is a simple SSCCE. Now make your changes and if you still have problems you have something simple to post. If it works then you add it to your real application.
    Learn to simplify your problem by simplifying the code.
    import java.awt.*;
    import javax.swing.*;
    public class ListTest2 extends JFrame
         JList list;
         public ListTest2()
              String[] numbers = { "one", "two", "three", "four", "five", "six", "seven" };
              list = new JList( numbers );
              JScrollPane scrollPane = new JScrollPane( list );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              ListTest2 frame = new ListTest2();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.setSize(200, 200);
              frame.setLocationRelativeTo( null );
              frame.setVisible( true );
    }

  • Storing data from Java Pogram(data in xml format) to SAP R/3

    Hi,
    I am having a java program which results me an xml.
    I want to dump the data to SAP R/3.
    What are the different ways/techniques should i use,to achieve the result?
    Thanks for your reply,
    regards,
    cg

    Hi,
    In simle terms can you explain me in more detail.
    lest say my java application produces xml as:
    <xml>
    <fname>myfirstname</fname>
    <lname>mylastname</lname>
    thanks for your reply,
    reg
    cg

  • Storing Data from One DataGrid & Passing it to Another.

    This is probably a simple problem for some of you Flex veterans, but I'm having a rough time with it...
    I have a datagrid that looks like this:
                   <mx:DataGrid x="319" y="63" width="100%" height="100%" id="patient_stream" fontSize="11">
                        <mx:columns>
                            <mx:DataGridColumn id="category_head" width="50" headerText="PC #" dataField="pc"/>
                            <mx:DataGridColumn width="100" headerText="Category" dataField="category"/>
                            <mx:DataGridColumn width="75" headerText="# of Cases">
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:TextInput/>
                                        </mx:Component>
                                    </mx:itemRenderer>
                                </mx:DataGridColumn>
                            <mx:DataGridColumn width="800" headerText="PC Description" dataField="description"/>
                        </mx:columns>
                    </mx:DataGrid>
    As you can see I have a TextInput component that is within an ItemRenderer.  I need to be able to collect any row of data that has numbers added to the TextInput field.  I then have a button that says "Add"  and this data is added to another datagrid that acts as a "summary" of the data being collected.
    Here is what that other "Summary" grid looks like:
    <mx:DataGrid x="10" y="538" width="100%" height="100%" id="stream_summary" textAlign="left">
                    <mx:columns>
                        <mx:DataGridColumn width="50" headerText="PC #"/>
                        <mx:DataGridColumn width="150" headerText="Category" />
                            <mx:DataGridColumn width="75" headerText="# of Cases">
                                <mx:itemRenderer>
                                    <mx:Component>
                                        <mx:TextInput/>
                                    </mx:Component>
                                </mx:itemRenderer>
                            </mx:DataGridColumn>
                        <mx:DataGridColumn width="800" headerText="Description" dataField="description"/>
                    </mx:columns>
                </mx:DataGrid>
    Can anyone provide any clues on how I could go about accomplishing this?
    Thanks.

    Usually you set editable=true on the first DG and don't use TextInput as your renderer.  That should cause that DG's dataprovider to be updated automatically.  Then if you want you can copy the data to the other DG's dataProvider
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • How to put data from database into array

    I need to answer hot to put data from database directly into array.
    I tried like the code below but the error message said: java.lang.ArrayIndexOutOfBoundsException: 0, and it points to this line: numbers [row][0]= rs.getString("ID");
    Hope you can help.
    ResultSet rs = stmt.executeQuery(query);
         int row=0;
         String [] [] numbers=new String [row][10];
         // output resultset
         while ( rs.next() )
              numbers [row][0]= rs.getString("ID");
              numbers [row][1]= rs.getString("name");
         row++;
         // close resultset
         rs.close();
    thanks,Devi

    The exception is been thrown simply because you assigned '0' to the 'row' variable, indicating a zero length of the array. In fact you should assign the row count to it.
    After all, don't do that. Make use of the Collection framework and map the ResultSet to a Collection of DTO's.
    List<User> users = new ArrayList<User>();
    while (resultSet.next()) {
        User user = new User();
        user.setID(resultSet.getString("ID"));
        user.setName(resultSet.getString("name"));
        users.add(user);
    }

  • Deleting data from a 2D array based on the id of the second column

    Hello
    I hope someone can help me. I have come across a hurdle in the programming of my application.
    1.
    I have a 2D array, the first column of this array contains my data and the second column contains an id, which is either 0 or 1.
    I have sorted this 2D array based on the id column so that the data corresponding to the 0’s is on top part of the array and the data corresponding to the 1’s follows it (on the bottom of the array).
    I want to delete that data (rows) of this sorted array that correspond to the 1’s and keep only the data (rows) that correspond to the 0’s.  
    So I would end up with a new 2D array that has only the data that I want on the first column and 0’s on the second column.
    I have hundreds of these 2D arrays resulting from my program (using a for loop) hence I want to automate this procedure. The length of the selected data arrays will vary.
    2.
    Once I can do this I will want to remove the id column (with the 0’s) from the 2D array and would like to build a new array with only the data from the first column (which may be of different length).
    So I want to end up with a 2D array with columns corresponding to the selected (1st column) data from the (original) 2D arrays. These data may be of different lengths so when building this new array I may need to do some padding. Will labview do this automatically?
    I hope that this is clear.
    Best wishes,

    Attached is a different approach - you don't need to do any sorting.
    The outer FOR loop assumes you have all the arrays available at once. If you are reading a file, modify it accordingly.
    You may or may not want the TRANSPOSE function on the final results, depending on what you want to do with it.
    Yes, when you assemble N-dimensional arrays into (N+1)-dimensional arrays, LabVIEW automatically pads for you.
    Enjoy.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks
    Attachments:
    Extract Marked Data.vi ‏40 KB

  • Can 'Form Data' Be Called From Within A JavaScript?

    Hi,
    I'm trying to import form data from within a JavaScript. What would the following code be changed to, if my form data file was called "NewDoc"?
    n=app.alert("Are you sure you want to Reset?/Êtes-vous certain de vouloir recommencer?",2,1);
    if (n==1)
    this.resetForm();

    First you will need to set the other PDF's "disclosed" property to "true" so you can open it in the first PDF.
    Then you can modify the following code from example 3 for the "app.openDoc" method:
    oDoc = app.openDoc({
    cPath:"/C/myDocs/myInfo.pdf",
    bHidden: true
    }); // oepn other PDF
    var v = oDoc.getField("myTextField").value;
    this.getField("yourTextField").value = v; // get value of field in other document
    oDoc.closeDoc(); // close the other document

Maybe you are looking for

  • Please help!! problem with rebooting lumia 820

    I only got my Lumia 820 yesterday and it was fine then today the camera stopped working, i tried taking the battery out, and putting it back in then switching it back on - still no luck. Then i went on the nokia website and looked up the troubleshoot

  • Web site fit to screen

    I apologise if this is an old (or stupid!) question, but is there anything I can do to make my web site automatically fit the size of the screen being used to view the site? Hope someone is happy to help an iWeb apprentice. My web site is www.lloydve

  • Opening Movie player on TV screen

    i have my tv hooked up and working and can play movies on it. it is a seperate x screen "screen 1" i have a script that starts a new openbox session on the new screen when needed. i was woundering if i could get my movie player to open on that screen

  • Import / Export TNS error

    Hello, I am getting this pesting TNS error when running IMP and EXP from the server. I can successfully run sqplus on the server and across the net. IMP 00058 - Oracle error 12560 ORA 12560 - TNS: Protocol Adapter Error What gives? Scott

  • Plz Help...Downloaded, but won't open to install

    Someone PLZ help... I have downloaded the correct iTunes edition. But when I try to open it, nothing happens. I have deleted my Temp files, cookies, etc..tried using another user profile, downloaded the file once more, downloaded QuickTime(facing sam