How to read 16 bits at a time from a file.

Hi everyone:
I have a homework problem that requires me to read from a file 16 bits at a time, which is a signed value. I have tried using the code below:
try     {
     FileInputStream fis = new FileInputStream(fileName);
     DataInputStream dis = new DataInputStream(fis);
     System.out.println("Reading "+fileName+"...");
     int x,y;
     bytes = new int [];
     for(y=0;y<height;y++)      {
          bytes[y] = dis.readByte();
          dis.close();
          fis.close();
          System.out.println("Read "+fileName+" Successfully.");
     } // try
     catch(Exception e)      {
          System.err.println(e.getMessage());
          System.exit(1);
But this code only reads a byte at a time, I need to read 16 bits at a time. Does anyone have any ideas?
Any help is greatly appreciated.
Celia

DataInputStream has another method that does what you want.

Similar Messages

  • Gif - file help: i don't want to read the gif each time from the file.....

    Hello there guys,
    i'm making a game and therefor i need to read a gif file like 20 times.
    i don't want my program to read the gif each time from the file, but only once.
    so i load it into an image or something?
    cuz opening the gif 20 times from my hard disk is a lot of time loss....
    opening it once and store it is much more efficient
    thx in advance
    plz help me out, cuz i don't really know how to do it.
    (in Delphi it's easy, but Java......)
    greetz,
    SpeciesXX
    Ramon Ribbe

    yes, it works, i used this code, thx man
    void button1_ActionPerformed(java.awt.event.ActionEvent event)
              ImageIcon image = new ImageIcon("f:/a.gif");          
              JLabel label = new JLabel();          
              label.setIcon(image);                    
              this.getContentPane().add(label);
              label.setBounds(10,10,100,100);
    and there i see my image :-)
    but 1 more thing, should i display all those blocks (images) on an applet, or should i use something else? (like what??)
    a sort of frame?
    because later on i have the field where all the blocks are in, and i have an area surrounding it, displaying all kinda information about the game, like how many lives remaining....
    can i put 2 applets in eachother? like applet1 is the parent of applet2?
    or should i use something else?
    plz help me, cuz java is kinda new to me i see....
    in delphi i just used 2 forms, form 1 with the blocks, form2 with the rest of info, and also being the parent of form1
    thx again, soon i can help ya guys too, i hope..
    (im learning java at school, but way too slow and to ez)
    Ramon

  • How to read and write a data from extrenal file

    Hi..
    How to read and write a data from extrenal file using Pl/sql?
    Is it possible from Dyanamic Sql or any other way?
    Reagards
    Raju

    utl_file
    Re: How to Create text(dat) file.
    Message was edited by:
    jeneesh

  • How to read out message cycle time from Vector CANdb file?

    Hello LabVIEW friends,
    I tried to open a Vector CAN Database (*.dbc) using the NI-CAN 2.3.2 Channel API and read out the cycle time of a message.
    The CAN get property.vi should provide the sample rate which is described as followed:
    Input parameter of the CAN Init Start function.
    The sample rate specifies
    whether to transfer data in a periodic or event-driven manner.
    For periodic
    behavior, the rate specifies the number of read/write samples to perform per
    second.
    But for all messages in my database I get the value 0.
    When I connect a sample rate to the CAN Initialize.vi I will get it's value.
    Could anybody help?
    Thank You.
    Greets,
    Marcus

    Hi,
    unfortunately there is no way to use the cycle time property from your DBC file, because the NI driver is not able to read this information.
    This is because the cycletime is stored in different places for different users and only Vector itself can read this information back.
    In your case, you have to figure out this information by yourself and you can use the sample rate input of the init or initstart function to configure the cycle time in Hz.
    If you need different cycle times for different messages, see the attached example.
    DirkW
    Attachments:
    CAN_Multi-Chans_Diff-Period.vi ‏26 KB

  • How to read a BLOB (base64 - stream) from XML-file in ORACLE10

    ORACLE 10g
    PL/SQL function
    MY XML-file:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <slo xmlns="http://www.example.org/detection">
         <LekKey>1999_036371_509627</LekKey>
         <HuiNum>46</HuiNum>
         <Res></Res>
         <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
         <XWGS>3.637028</XWGS>
         <YWGS>50.962667</YWGS>
         <Pei>EANDIS</Pei>
         <DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
         <Kan> </Kan>
         <Doc>UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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dW1hj8TfGUZPPWqCeLCB7J6HX/+OZpck
    bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAADqNAkAY3VzdG9tWG1sL19y
    ZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhANouSfniAAAAVQEAABgAAAAAAAAAAAAAAAAA
    8DYJAGN1c3RvbVhtbC9pdGVtUHJvcHMxLnhtbFBLAQItABQABgAIAAAAIQD+hDirOAIAAMwHAAASAAAA
    AAAAAAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAA
    EQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADa
    AAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2I
    CwEAALoBAAAUAAAAAAAAAAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
    IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
    pQQAALNCCQAAAA==</Doc>
    </slo>
    I have to write an PL/SQL function where I can read all the data in the XML-file (see attach).
    In this XML there is a BLOB stored (base64 - stream -> that contains always a MSWORD document).
    1) how can I extract this BLOB + the other data in the XML and save this data in a ORACLE table?
    2) how can I decode this BLOB and save this MSWORD-document to a fileserver?

    First extract your data as CLOB (as it's character based)...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select xmltype('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      2  <slo xmlns="http://www.example.org/detection">
      3    <LekKey>1999_036371_509627</LekKey>
      4    <HuiNum>46</HuiNum>
      5    <Res></Res>
      6    <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
      7    <XWG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jErfqgXIb5PJd6mDJ/BUUuYQs+kZtGplqTh/4M8bJ9EvRHG62ZelamFcxufvchCRwOILiIrRGq2Ia5N3vnnh
    q3z0VDGy24NLE/ErG39DIa8897Qt8DbuJg7XchOhK+Y3559MA8WlSvRLOS5W3ofUyCboleOgqt3KA6WFtjUaenxmiyloQOSDdbbqV5wy/qnkIR96hRTclbPSELjLFCIeH2ynJ818kMhAH/uQhy4LpLUFPFj6VRIb3l0RbMn/M7Q8b1vQfKvHz8RhmbHVRmILO64GRHxQ+4g877Vy7ODxkXnUwj1c//k0F1vko0ZaHgJzdW1hj8TfGUZPPWqCeLCB
    7J6HX/+OZpckbWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAADqNAkAY3VzdG9tWG1sL19yZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhANouSfniAAAAVQEAABgAAAAAAAAAAAAAAAAA8DYJAGN1c3RvbVhtbC9pdGVtUHJvcHMxLnhtbFBLAQItABQABgAIAAAAIQD+hDirOAIAAMwHAAASAAAAAAAA
    AAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAAEQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADaAAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2ICwEAALoBAAAUAAAAAAAA
    AAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIApQQAALNCCQAAAA==</Doc>
    13  </slo>') as xml from dual)
    14  --
    15  -- end of test data
    16  --
    17  select x.*
    18  from   t
    19        ,xmltable(xmlnamespaces(default 'http://www.example.org/detection'),
    20                  '/slo'
    21                  passing t.xml
    22                  columns lekkey varchar(30) path './LekKey'
    23                         ,doc    clob        path './Doc'
    24*                ) x
    SQL> /
    LEKKEY                         DOC
    1999_036371_509627             UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                                   AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0VUtP20AQviP1P1h7rewNPVRVFYcDj2OL1FTluqzH
                                   ycK+tDMB8u8764AVwMSBiIsle/d7zLc74+nJg7PFHSQ0wdfiuJqIArwOjfGLWvydX5Q/RIGkfKNs8FCL
                                   NaA4mX05ms7XEbBgtMdaLIniTylRL8EprEIEzyttSE4Rv6aFjErfqgXIb5PJd6mDJ/BUUuYQs+kZtGpl
                                   qTh/4M8bJ9EvRHG62ZelamFcxufvchCRwOILiIrRGq2Ia5N3vnnhq3z0VDGy24NLE/ErG39DIa8897Qt
                                   8DbuJg7XchOhK+Y3559MA8WlSvRLOS5W3ofUyCboleOgqt3KA6WFtjUaenxmiyloQOSDdbbqV5wy/qnk
                                   IR96hRTclbPSELjLFCIeH2ynJ818kMhAH/uQhy4LpLUFPFj6VRIb3l0RbMn/M7Q8b1vQfKvHz8RhmbHV
                                   RmILO64GRHxQ+4g877Vy7ODxkXnUwj1c//k0F1vko0ZaHgJzdW1hj8TfGUZPPWqCeLCB7J6HX/+OZpck
                                   bWxQSwECLQAUAAYACAAAACEAdD85esIAAAAoAQAAHgAAAAAAAAAAAAAAAADqNAkAY3VzdG9tWG1sL19y
                                   ZWxzL2l0ZW0xLnhtbC5yZWxzUEsBAi0AFAAGAAgAAAAhANouSfniAAAAVQEAABgAAAAAAAAAAAAAAAAA
                                   8DYJAGN1c3RvbVhtbC9pdGVtUHJvcHMxLnhtbFBLAQItABQABgAIAAAAIQD+hDirOAIAAMwHAAASAAAA
                                   AAAAAAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAA
                                   EQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADa
                                   AAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2I
                                   CwEAALoBAAAUAAAAAAAAAAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
                                   IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
                                   pQQAALNCCQAAAA==
    SQL>Then, you can convert the CLOB to a BLOB by doing your base64 decoding.

  • How to read data in correct format from EXCEL file into an internal table??

    Hi Experts,
    My requirement is to upload data from an excel file on presentation server into an internal table on <b>SRM</b> server.
    I used 'GUI_UPLOAD' function module to achieve the same but all the the data is getting uploaded in # only.I had set in the 'HAS_FIELD_SEPARATOR' to 'X' to overcome this problem.
    But all the efforts are in vain. The function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' doesn't exist on SRM Server and I am not getting any other function module having similar functionality available on SRM server.
    I have written the following code:-
    TYPES: BEGIN OF ty_addr_loc,
             userid    TYPE xubname,      "User Id
             addr_code TYPE char4,        "3 Digit Site Location Code/4 Digit
                                                       "Alternate Address
             loc_id    TYPE bbp_location, "Indicator: Address is standard address
            END OF ty_addr_loc.
    *Retrieving file name
    parameters: p_file type rlgrap-filename.
      DATA:
        Local variable holding file name
          l_file TYPE string,
        Local Variable holding the file type,
          l_type TYPE filetype VALUE 'ASC',
        Local Variable holding the field separator
          l_sep  TYPE char01,
          i_tab type standard table of ty_addr_loc.
    Clearing local variables
      CLEAR:
            l_file,
            l_sep.
    Initializing the local variables
      MOVE p_file TO l_file.
      l_sep = 'X'.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                      = l_file
          filetype                      = l_type
          has_field_separator           = l_sep
       HEADER_LENGTH                 = 0
       READ_BY_LINE                  = 'X'
       DAT_MODE                      = ' '
       CODEPAGE                      = ' '
       IGNORE_CERR                   = ABAP_TRUE
       REPLACEMENT                   = '#'
       CHECK_BOM                     = ' '
       VIRUS_SCAN_PROFILE            =
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       HEADER                        =
        TABLES
          data_tab                     = i_tab
       EXCEPTIONS
         file_open_error               = 1
         file_read_error               = 2
         no_batch                      = 3
         gui_refuse_filetransfer       = 4
         invalid_type                  = 5
         no_authority                  = 6
         unknown_error                 = 7
         bad_data_format               = 8
         header_not_allowed            = 9
         separator_not_allowed         = 10
         header_too_long               = 11
         unknown_dp_error              = 12
         access_denied                 = 13
         dp_out_of_memory              = 14
         disk_full                     = 15
         dp_timeout                    = 16
         OTHERS                        = 17
      IF sy-subrc <> 0.
      Throwing an information message
        MESSAGE i003. "Data Upload Failed
        LEAVE LIST-PROCESSING.
      ENDIF.
    Please tell me a way out. I have to make a delivery urgently.
    Thanks in advance,
    Swati Gupta

    Hi
    Try the FM <b>KCD_EXCEL_OLE_TO_INT_CONVERT</b>
    Sample:
      call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
           exporting
                filename                = i_filename
                i_begin_col             = l_begin_col
                i_begin_row             = l_begin_row
                i_end_col               = l_end_col
                i_end_row               = l_end_row
           tables
                intern                  = xt_intern
           exceptions
                INCONSISTENT_PARAMETERS = 201
                UPLOAD_OLE              = 201.
      if sy-subrc <> 0.
        e_subrc = sy-subrc.
        exit.
      endif.
    <b>reward if Helpful.</b>

  • How to read and update the value of property file

    Hi,
    I am not able read the values from property file.
    Please tell me how to read and update the values from property file using Properties class
    This is my property file : - Config.properties its located in D:\newfolder
    Values
    SMTP = localhost
    Now i need to change the value of the SMTP
    New value :
    SMTP =10.60.1.9
    Pls Help me
    Thanks
    Merlin Rosina,

    Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.

  • How to read a tab seperated data from a text file using utl_file

    Hi,
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....
    Thanks in advance...
    Naveen

    Naveen Nishad wrote:
    How to read a tab seperated data from a text file using utl_file...
    I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....If it's a text file then UTL_FILE will only allow you to read it a line at a time. It is then up to you to split that string up (search for split string on this forum for methods) into it's individual components.
    If the text file contains a standard structure on each line, i.e. it is a fixed delimited structure, then you could use external tables to read the data instead.

  • How to read the date and time information of a file by labview

    how to read the date and time information of a file by labview? for example, created time and modified time.
    Solved!
    Go to Solution.

    if you need to know the last modification date of file:-
    "Functions->File I/O->Advanced File Functions->File/Directory Info.vi"
    This vi returns the value of file's last modification date. This is returned as U32 number. To see it in MM/DD/YY format you must create the indicator, right-click on it and select "Format & Precision" item from drop-down menu. Then select "Time and Date" format there.
    Thanks as kudos only

  • How can I change the shipping time from 1-2 weeks to 2 days

    How can I change the shipping time from 1-2 weeks to 2 days. Thank you in advance.

    Right you are, R_Kelly. Thanks, that did the trick. Ukgaurav also pointed out some choices in the Displays and Cursors Preferences with which I fine-tuned the tool cursor appearance.

  • How to load date and time from text file to oracle table through sqlloader

    hi friends
    i need you to show me what i miss to load date and time from text file to oracle table through sqlloader
    this is my data in this path (c:\external\my_data.txt)
    7369,SMITH,17-NOV-81,09:14:04,CLERK,20
    7499,ALLEN,01-MAY-81,17:06:08,SALESMAN,30
    7521,WARD,09-JUN-81,17:06:30,SALESMAN,30
    7566,JONES,02-APR-81,09:24:10,MANAGER,20
    7654,MARTIN,28-SEP-81,17:24:10,SALESMAN,30my table in database emp2
    create table emp2 (empno number,
                      ename varchar2(20),
                      hiredate date,
                      etime date,
                      ejob varchar2(20),
                      deptno number);the control file code in this path (c:\external\ctrl.ctl)
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>any help i greatly appreciated
    thanks
    Edited by: user10947262 on May 31, 2010 9:47 AM

    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime, ejob, deptno)Try
    load data
    infile 'C:\external\my_data.txt'
    into table emp2
    fields terminated by ','
    (empno, ename, hiredate, etime "to_date(:etime,'hh24:mi:ss')", ejob, deptno)
    this is the error :
    C:\>sqlldr scott/tiger control=C:\external\ctrl.ctl
    SQL*Loader: Release 10.2.0.1.0 - Production on Mon May 31 09:45:10 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Commit point reached - logical record count 5
    C:\>
    That's not an error, you can see errors within log and bad files.

  • How to read data in binary form from file?

    Hi,
    i try to write an implementation of LZW. I need to read data in binary form from a file. How can i do that? I cannot find something like "binary input stream" ...
    Thanks

    Hi,
    i try to write an implementation of LZW. I need to
    read data in binary form from a file. How can i do
    that? I cannot find something like "binary input
    stream" ...
    ThanksInputStream reads bytes. I don't understand your question.

  • Reading and writing to and from a file to a form

    Hi there
    I would like somebody to send me a code example,
    showing me how to reading records from a file to a form,
    and writing records to the same file from the same form.
    I know that I have to use sycronize, but I just have not been
    successful. I can constract forms, go from form to a form,
    do buttons, do text fields. I can even read and write from and
    to files. However I cannot do is write from a file to a form and
    from a form to a file.
    could somebody please explain how this done, and could you
    please give me a code example. All the books seem to either
    deal with forms or with files. None seem to combine both.
    I am sure it is very ease to do if ONLY I knew how!!!
    thank you very much in advance for you help.

    I understand that code and I have used it before, however thanks for
    trying to help me, it is really appreciated. However, that is not my
    problem. I can read and write from a file to the console and vice versa.
    what I cannot do, no matter how hard I try, is to write from a file, and
    output it in.
    I will tell you how far I have got.
    I have a MenuFrame class, this is the code for it:
    package WorkflowApp;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.io.*;
    public class MenuFrame extends JFrame {
    JMenuBar menuBar1 = new JMenuBar();
    JMenu menuFile = new JMenu();
    JMenuItem menuFileExit = new JMenuItem();
    JMenu menuHelp = new JMenu();
    JMenuItem menuHelpAbout = new JMenuItem();
    JToolBar toolBar = new JToolBar();
    JButton jButton1 = new JButton();
    JButton jButton2 = new JButton();
    JButton jButton3 = new JButton();
    ImageIcon image1;
    ImageIcon image2;
    ImageIcon image3;
    JLabel statusBar = new JLabel();
    Button button2 = new Button();
    Button button3 = new Button();
    Button button4 = new Button();
    Button button5 = new Button();
    Button button6 = new Button();
    Button button7 = new Button();
    Button button1 = new Button();
    //Construct the frame
    public MenuFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    image1 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("openFile.gif"));
    image2 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("closeFile.gif"));
    image3 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("help.gif"));
    this.getContentPane().setLayout(null);
    this.setSize(new Dimension(400, 492));
    this.setTitle("MenuFrame");
    statusBar.setText(" ");
    statusBar.setBounds(new Rectangle(0, 0, 3, 17));
    menuFile.setText("File");
    menuFileExit.setText("Exit");
    menuFileExit.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    fileExit_actionPerformed(e);
    menuHelp.setText("Help");
    menuHelpAbout.setText("About");
    menuHelpAbout.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    helpAbout_actionPerformed(e);
    jButton1.setIcon(image1);
    jButton1.setToolTipText("Open File");
    jButton2.setIcon(image2);
    jButton2.setToolTipText("Close File");
    jButton3.setIcon(image3);
    jButton3.setToolTipText("Help");
    toolBar.setBorder(null);
    toolBar.setBounds(new Rectangle(2, 2, 389, 30));
    button2.setBounds(new Rectangle(217, 62, 135, 44));
    button2.setLabel("Staff Details");
    button2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button2_actionPerformed(e);
    button3.setBounds(new Rectangle(26, 127, 135, 44));
    button3.setLabel("Arange Viewing");
    button3.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button3_actionPerformed(e);
    button4.setBounds(new Rectangle(218, 127, 136, 41));
    button4.setLabel("Valuation");
    button4.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button4_actionPerformed(e);
    button5.setBounds(new Rectangle(28, 196, 135, 41));
    button5.setLabel("Schedule");
    button6.setBounds(new Rectangle(221, 194, 133, 40));
    button6.setName("button6");
    button6.setLabel("Register Interest");
    button7.setBounds(new Rectangle(31, 266, 133, 42));
    button7.setLabel("Register Offers");
    button1.setBounds(new Rectangle(27, 62, 131, 42));
    button1.setLabel("New Client");
    button1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button1_actionPerformed(e);
    menuFile.add(menuFileExit);
    menuHelp.add(menuHelpAbout);
    menuBar1.add(menuFile);
    menuBar1.add(menuHelp);
    this.setJMenuBar(menuBar1);
    this.getContentPane().add(statusBar, null);
    this.getContentPane().add(toolBar, null);
    toolBar.add(jButton1);
    toolBar.add(jButton2, null);
    toolBar.add(jButton3, null);
    this.getContentPane().add(button3, null);
    this.getContentPane().add(button5, null);
    this.getContentPane().add(button7, null);
    this.getContentPane().add(button2, null);
    this.getContentPane().add(button4, null);
    this.getContentPane().add(button6, null);
    this.getContentPane().add(button1, null);
    //File | Exit action performed
    public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    //Help | About action performed
    public void helpAbout_actionPerformed(ActionEvent e) {
    MenuFrame_AboutBox dlg = new MenuFrame_AboutBox(this);
    Dimension dlgSize = dlg.getPreferredSize();
    Dimension frmSize = getSize();
    Point loc = getLocation();
    dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
    dlg.setModal(true);
    dlg.show();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    fileExit_actionPerformed(null);
    void button2_actionPerformed(ActionEvent e) {
    StaffDetails myFrame = new StaffDetails();
    myFrame.show();
    void button3_actionPerformed(ActionEvent e) {
    ArrangeViewing myFrame = new ArrangeViewing();
    myFrame.show();
    void button1_actionPerformed(ActionEvent e) {
    NewClientFrame myFrame = new NewClientFrame();
    myFrame.show();
    // System.exit(1);
    void button4_actionPerformed(ActionEvent e) {
    Valuation myFrame = new Valuation();
    myFrame.show();
    then I have a new form class, this is the code for it
    package WorkflowApp;
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class NewClientFrame extends JFrame {
    Label label1 = new Label();
    Label label2 = new Label();
    Label label3 = new Label();
    Label label4 = new Label();
    Label label5 = new Label();
    Label label6 = new Label();
    Label label7 = new Label();
    Label label8 = new Label();
    Label label9 = new Label();
    Label label10 = new Label();
    TextField textField1 = new TextField();
    TextField textField2 = new TextField();
    TextField textField3 = new TextField();
    TextField textField4 = new TextField();
    TextField textField5 = new TextField();
    TextField textField6 = new TextField();
    TextField textField7 = new TextField();
    TextField textField8 = new TextField();
    TextField textField9 = new TextField();
    TextField textField10 = new TextField();
    Button button1 = new Button();
    Button button2 = new Button();
    //Construct the frame
    public NewClientFrame() {
    enableEvents(AWTEvent.WINDOW_EVENT_MASK);
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    //Component initialization
    private void jbInit() throws Exception {
    this.getContentPane().setLayout(null);
    this.setSize(new Dimension(411, 488));
    this.setTitle("NewClientFrame ");
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    this_windowClosing(e);
    label1.setBounds(new Rectangle(21, 23, 110, 23));
    label1.setAlignment(2);
    label1.setText("Assign Number");
    label2.setBounds(new Rectangle(23, 57, 108, 25));
    label2.setAlignment(2);
    label2.setText("Name");
    label3.setBounds(new Rectangle(40, 91, 94, 24));
    label3.setAlignment(2);
    label3.setText("Address 1");
    label4.setBounds(new Rectangle(21, 124, 112, 29));
    label4.setAlignment(2);
    label4.setText("Address 2");
    label5.setBounds(new Rectangle(20, 159, 116, 29));
    label5.setAlignment(2);
    label5.setText("PoscCode");
    label6.setBounds(new Rectangle(18, 197, 119, 26));
    label6.setAlignment(2);
    label6.setText("Telephone");
    label7.setBounds(new Rectangle(25, 228, 112, 26));
    label7.setAlignment(2);
    label7.setText("Other Telephone");
    label8.setBounds(new Rectangle(12, 261, 125, 24));
    label8.setAlignment(2);
    label8.setText("Email Address");
    label9.setBounds(new Rectangle(6, 301, 138, 25));
    label9.setAlignment(2);
    label9.setText("Staff Assigned (Name)");
    label10.setBounds(new Rectangle(22, 341, 124, 23));
    label10.setAlignment(2);
    label10.setText("Staff Assigned (No.)");
    textField1.setBounds(new Rectangle(155, 19, 80, 26));
    textField2.setBounds(new Rectangle(155, 58, 193, 24));
    textField3.setBounds(new Rectangle(156, 90, 192, 25));
    textField4.setBounds(new Rectangle(157, 126, 192, 23));
    textField5.setBounds(new Rectangle(157, 159, 195, 25));
    textField6.setBounds(new Rectangle(157, 194, 195, 26));
    textField7.setBounds(new Rectangle(157, 230, 192, 24));
    textField8.setBounds(new Rectangle(157, 263, 193, 25));
    textField9.setBounds(new Rectangle(157, 303, 196, 24));
    textField10.setBounds(new Rectangle(158, 337, 95, 24));
    button1.setBounds(new Rectangle(23, 398, 144, 34));
    button1.setLabel("Staff Available");
    button2.setBounds(new Rectangle(211, 396, 148, 34));
    button2.setLabel("Submit Record");
    button2.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(ActionEvent e) {
    button2_actionPerformed(e);
    this.getContentPane().add(label1, null);
    this.getContentPane().add(label2, null);
    this.getContentPane().add(label3, null);
    this.getContentPane().add(label4, null);
    this.getContentPane().add(label5, null);
    this.getContentPane().add(label6, null);
    this.getContentPane().add(label7, null);
    this.getContentPane().add(label8, null);
    this.getContentPane().add(label9, null);
    this.getContentPane().add(label10, null);
    this.getContentPane().add(textField1, null);
    this.getContentPane().add(textField2, null);
    this.getContentPane().add(textField3, null);
    this.getContentPane().add(textField4, null);
    this.getContentPane().add(textField5, null);
    this.getContentPane().add(textField6, null);
    this.getContentPane().add(textField7, null);
    this.getContentPane().add(textField8, null);
    this.getContentPane().add(textField9, null);
    this.getContentPane().add(textField10, null);
    this.getContentPane().add(button1, null);
    this.getContentPane().add(button2, null);
    public void fileExit_actionPerformed(ActionEvent e) {
    System.exit(0);
    // exit(this);
    // close();
    //Overridden so we can exit on System Close
    protected void processWindowEvent(WindowEvent e) {
    super.processWindowEvent(e);
    if(e.getID() == WindowEvent.WINDOW_CLOSING) {
    System.exit(0);
    void button2_actionPerformed(ActionEvent e) {
    // myFrame.close();
    this.dispose();
    void this_windowClosing(WindowEvent e) {
    this.dispose();
    I also have an about box, staff details, and valuation forms.
    what I am trying to do is for the New client form to be able to read and write from and to a file, and display the info.
    I am working in JBuilder3, a bit out of date I know, but it is the best I can do. Any Ideas how to do this.

  • Time from .xls file is divided

    Hello I,m new with LabVIEW 10 and i have a problem with reading time from .xls file with the read excel values.vi. 
    In excel the time format is  00:00:20     but in LabVIEW (with Strings) i get (i think) a divided result 0,000231481481481481 for 00:00:20 and so on.
            00:00:15
    00:00:20
    00:00:17
    00:00:20
    00:00:08
    00:00:20
    00:00:09
    I would like to get the same format in the .vi as it is in .xls file.
    Picture added.
    Could you please helpe me with this...
    Attachments:
    String problem.JPG ‏36 KB

    That VI returns the value of the cell, not the formatted string. The issue with time values between Excel and LabVIEW has been brought up numerous times before. Excel does not use the same datetime starting point as LabVIEW. See, for example, this discussion: http://forums.ni.com/t5/LabVIEW/Read-custom-excel-time-data-in-LabView/m-p/775359

  • Error 105, Could not read full block (2048 bytes) from checkpoint file ~/dirchk/sdfsdj.cpe

    Hi expert,
        i am getting below error in goldengate  due to mount point full and i released the space and still the same error for all gg processes. i can see the *cpe cpr file become 0 bytes. so i deleted and re added the extract and repliacat and while adding the replcat i used add replicat  checkpoint table because of that multiple entries of same replicat came in checkpoint table . my checkpoint details also  present in ./GLOBALS. now my doubt is if add  replicate with mentioning checkpoint table name  will duplicate entry will be created or what is the work around for this.
    MANAGER RUNNING
    Invalid checkpoint for EXTRACT  qqqq   (error 105, Could not read full block (2048 bytes) from checkpoint file XXXXXXXXX)
    Invalid checkpoint for EXTRACT  qqq(error 105, Could not read full block (2048 bytes) from checkpoint file XXXXXXXXXX)
    Invalid checkpoint for REPLICAT qqq  (error 105, Could not read full block (2048 bytes) from checkpoint file XXXXXXXXXXX)

    Hi Kariyath
    Increase the page size of your windows machine.Check for the recommanded page size.Remember that the recommanded page size should be the lower limit.If you have any issue feel free to ask.Your prob will be solved
    Award suitable points

Maybe you are looking for