Can anybody give the solution of this code

SELECT poh.org_id,pv.vendor_name,pol.creation_date,poh.segment1 "PO_NUM"
rt.unit_price,jpt.tax_amount,NVL (pol.unit_price, 0) "PO_Amt",
pda.quantity_ordered "QTY_Ordered",rsh.invoice_num,pol.item_description,
msib.segment1,msib.segment2,msib.segment3,msib.segment4,mic.category_set_id
FROM po_headers_all poh,
po_lines_all pol,
po_distributions_all pda,
rcv_shipment_headers rsh,
rcv_transactions rt,
po_vendors pv,
jai_po_taxes jpt,
mtl_system_items_b msib,
mtl_item_categories mic
WHERE rsh.vendor_id = poh.vendor_id
AND rt.po_header_id = pol.po_header_id
AND poh.vendor_id = pv.vendor_id
AND poh.po_header_id = pol.po_header_id
AND jpt.vendor_id = poh.vendor_id
AND msib.inventory_item_id = mic.inventory_item_id;

Just to make things more evident
SELECT poh.org_id,
       pv.vendor_name,
       pol.creation_date,
       poh.segment1 "PO_NUM"
       rt.unit_price,
       jpt.tax_amount,
       NVL (pol.unit_price, 0) "PO_Amt",
       pda.quantity_ordered "QTY_Ordered",
       rsh.invoice_num,
       pol.item_description,
       msib.segment1,
       msib.segment2,
       msib.segment3,
       msib.segment4,
       mic.category_set_id
  FROM po_headers_all poh,            /* (1)(3)(4)(5) */
       po_lines_all pol,              /* (2)(4) */
       po_distributions_all pda,      /* not joined */
       rcv_shipment_headers rsh,      /* (1) */
       rcv_transactions rt,           /* (2) */
       po_vendors pv,                 /* (3) */
       jai_po_taxes jpt,              /* (5) */
       mtl_system_items_b msib,       /* (6) */
       mtl_item_categories mic        /* (6) */
WHERE rsh.vendor_id = poh.vendor_id                   /* (1) */
   AND rt.po_header_id = pol.po_header_id              /* (2) */
   AND poh.vendor_id = pv.vendor_id                    /* (3) */
   AND poh.po_header_id = pol.po_header_id             /* (4) */
   AND jpt.vendor_id = poh.vendor_id                   /* (5) */
   AND msib.inventory_item_id = mic.inventory_item_id  /* (6) */and another way
poh  pol  pda  rsh  rt   pv   jpt  msib  mic
1111111111111111
      2222222222222222
33333333333333333333333333
444444
5555555555555555555555555555555
                                     666666
/* msib|mic not joined with poh|pol|pda|rsh|rt|pv|jpt */
/* no join begins/ends at pda */Regards
Etbin

Similar Messages

  • I am new to Service module,can anybody give the over view of service module

    I am new to Service module,can anybody give the over view of service module including base table and Relation ship with other Oracle Application module.

    Hello Les,
    Think that you want to buy television or computer and how will you proceed for that.
    1. Material Requirement : Your family will ask you that they need television so that is material requirement from the users (family), they will also give additional information like what is the size of TV, which brand etc
    2. Quotation (Inquiry) : now you have requirement that you need one TV so you will looking for different vendors i.e. Phillips, Sharp, AIWA, Deawood and ask them to give the prices and other terms (free shipping, service after sales ) for TV
    3. Quotation comparision : Once you get the price from all your supplier, you will make comparision on price and other terms also you can negotiate the price with vendor asking for discounts, free door delivery
    4. Vendor Selection: Based on your negotiation you will identify the best deal and place order to that vendor.
    5. Purchase order : You will place order to vendor asking for material (TV), for certain price on particular date at particular location (you home).
    6. Goods Receipt : Once vendor delivers TV then you will receive the material at your location
    7. Invoice receipt: Vendor will send the invoice with that delivery and you will check the price and make the payment to vendor,
    I hope this will help you to under stand the concept of Procurment cylce.
    More details you can get it from the link which I provided.
    Regards
    Arif Mansuri

  • I can't put numbers on the decimals. It only allow ,00 as decimals. If i put 33.00 it's ok but i i put 33.44 when i press enter changes to 3344 as an entire number, i've try everything and can't find the solution. This should be a basic thing.

    I can't put numbers on the decimals. It only allow ,00 as decimals. If i put 33.00 it's ok but if i put 33.44 when i press enter changes to 3344 as an entire number, i've try everything and i can't find the solution. This should be a basic thing. How frustrating !!

    pedrofromsydney wrote:
    €          55,555.00
    that's the result i get. Still why can't i just type for ex. 29.55 and stay like that on the cell ? Why does it always change to 2955 or 2955.00. ??
    I don't understand this
    It appears you have the cell formatted to Currency, with the default two decimal places.
    What I don't understand, though is how Numbers arrived at a result of fifty five thousand five hundred fifty five on your entering the exact keystrokes in Yvan's post:
    an equals sign, followed by five ones, followed by a forward slash, followed by a 2.
    Here's the result I get:
    Could you do the following:
    Open a NEW Numbers document using the Blank template.
    Drag the Row and Column control (bottom right corner) to reduce the table to two columns and three rows.
    Enter the words "My table" in cell A1.
    Click on cell B2 to select it, then enter the formula 
    =11111/5
    Use only those eight keystrokes; do not include any commas, periods or other characters not shown.
    Click on B2 again to select it.
    Open the inspector and choose the Cell Format button.
    Do not make any changes in the Inspector window.
    Drag the Inspector window to the position shown in my screen shot.
    Take a screen shot that includes the Formula bar, the Table (with cell B2 selected) and the Cell Format Inspector pane (the same screen area as in my screen shot above).
    Post the screen shot in a reply to this post.
    I'm hoping there will be some clues as to what's happening here in the screen shot. Procedure for taking and posting a shot of part of the screen follows.
    Regards,
    Barry
    SCREEN SHOTS (Selected area)
    Place the mouse pointer at the top left corner of the area you want to include.
    Press shift-command-4.
    The mouse pointer will change to a plus sign on a circle.
    Hold down the mouse button and drag to the bottom right corner of the area you wan to capture.
    Release the mouse button.
    The screen shot will be saved to your desktop with the name "Picture 1" (The number will be different if you have taken other screen shots).
    POSTING
    In the Compose frame, place the Insertion point at the location you want the picture to be inserted.
    Click the camera icon above the compose frame to open the Insert Image dialogue.
    Click Choose file to open the Choose dialogue.
    If necessary, navigate to the Desktop and click on the 'by date column header to sort the files by date, most recent at the top.
    Select the most recent picture file.
    Click Choose.
    Wait for the picture's file name to appear beside Choose file.
    Click insert image.
    Done.
    B.

  • REGARDING SCRIPTS.... CAN ANY ONE GIVE THE SOLUTION FOR THIS

    I have copied the standard script ML_SERVICE_ENTRY to ZFORM.... in tcode se71 but it has its original lang. - DE and lang - EN , if i get into this ZFORM ...
    in change mode,  the creation of windows, windows allignment and convert original lang. are in disabled mode , here i have to change the window size to add some text , is there any other method to change the language and to get these things in
    enable mode. plz give some solution for this one.

    Hi Mohan,
    While copying itself U have to give the Language in which U want to maintain, else U are supposed login in with the original Language only.
    Regards,
    Mohan
    *Reward if helpful*

  • Can anybody help me to troubleshoot this code

    According to this code i must get the same number as o/p. But shift and add seems not functioning well.Can anybody help me to troubleshoot

    Hello Pushpa,
    Thank you for contacting National Instruments.
    Which code are you specifying
    Just make your problem clearly and elaborated
    you can send me your code & If you might want to contact the developer of your application, contact - [email protected]
    Have a great day.
    Regards~
    Mathews
    [email protected]

  • Please give the meaning of this code

    Hi anyone please give the meaning of the below mentioned modify command code
      READ TABLE XKOMV INTO L_XKOMV
                  WITH KEY
                  KSCHL = 'ZGBC'.
      IF sy-subrc = 0.
        XKOMV-KINAK = 'X'.
        <b>MODIFY XKOMV TRANSPORTING KINAK WHERE KSCHL = 'ZFIK'.</b>
      ENDIF.
    Point will be sure.
    vijai

    Hello Vijaya,
    Its reading the Conditiuon table and checking for the condition type ZGBC in the document condition table. If it exists then its makeing the Condition ZFIK as in active. So   During pricing, the system ignores conditions that are valid but not active in this case ZFIK.
    Regards,
    <b>Reward Points if Useful</b>
    Sake Sharma

  • Urgently seek the solution of this code

    this code is using the SOAP for message transmission
    class checkData is on the server side, fetch information from database.
    class Transport is on the client side, make the SOAP "call"
    I use UtilSnoop to fetch the message between server and client, we can see that seems the checkData class works well, it can get the information from database and seems it can transmit it back. but when the progress come back Transport class, I found it failure in excute this line:
    --- resp = call.invoke(url, ""); ---
    the error message is : java.NullPointerException
    the result from the XML message fetched by UtilSNoop, and the error message, looks inconsistent, what was the problem, plesase help me
    public class Transport {
    public Object[][] doTran_viewList () throws Exception {
    Object [][] value=null;
    try{
    url=new URL(log.urls);
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
    Call call = new Call ();
    call.setTargetObjectURI ("urn:RegistrySystem");
    call.setMethodName ("ViewList");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector ();
    String arg1=" ";
    params.addElement (new Parameter("arg1", String.class,arg1, null));
    call.setParams (params);
    Response resp;
    System.out.println("before");//when run this code, it will print out "before"
    resp = call.invoke(url, "");
    System.out.println("after");//but no after
    if (!resp.generatedFault())
    Parameter ret = resp.getReturnValue();
    value = (Object[][])ret.getValue();
    else
    Fault fault = resp.getFault();
    System.err.println("Generated fault: " + fault);
    return value;
    }catch(Exception e){
    System.err.println("fail to build call");//when run, it will print out this
    return value;
    public class checkData{
    public Object[][] ViewList (String arg1) throws IllegalArgumentException{
    int p=0;
    String url="jdbc:odbc:RST";
    String cs="select ID,Name from course";
    Connection con=null;
    Statement stmt=null;
    ResultSet rs =null;
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException:");
    System.err.println(e.getMessage());
    try {
    con=DriverManager.getConnection(url);
    stmt=con.createStatement();
    rs=stmt.executeQuery(cs);
    while(rs.next()){p++;}
    } catch(SQLException ex) {
    System.err.println("SQLException: "+ex.getMessage());
    Object[][] value = new Object[p][2];
    try {
    con=DriverManager.getConnection(url);
    stmt=con.createStatement();
    rs=stmt.executeQuery(cs);
    for(p=0;rs.next();p++) {
    String i = rs.getString("ID");
    String n = rs.getString("Name");
    value[p][0] =i;
    value[p][1] =n;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: "+ex.getMessage());
    finally{
    if (rs!=null) {
    try {
    rs.close();
    } catch (Exception ex) {
    } //end of if(rs)
    if (stmt!=null) {
    try {
    stmt.close();
    } catch (Exception ex) {
    }//end of if(stm)
    if (con!=null) {
    try {
    con.close();
    } catch (Exception ex) {
    }//end of if(con)
    return value;
    the UtilSnoop fetch message from server to client:
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:ViewListResponse xmlns:ns1="urn:RegistrySystem" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <return xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:Array" ns2:arrayType="ns2:Array[13]">
    <item xsi:type="ns2:Array" ns2:arrayType="xsd:anyType[2]">
    <item xsi:type="xsd:string">IEI22202</item>
    <item xsi:type="xsd:string">GUI</item>
    </item>
    <item xsi:type="ns2:Array" ns2:arrayType="xsd:anyType[2]">
    <item xsi:type="xsd:string">IEI12301</item>
    <item xsi:type="xsd:string">Robotics</item>
    </item>
    </return>
    </ns1:ViewListResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    First make sure that you deployed urn:RegistrySystem. I do this from the soap admin page.
    If you have narrowed down that the NullPointerException is coming from the call.innvoke() line, then I would make sure that your URL is not null.
    You did: url=new URL(log.urls);
    I am not sure what log.urls is, but I would so a simple check to see if url is null after this statement. If it is, then you narrowed down your problem.
    this code is using the SOAP for message transmission
    class checkData is on the server side, fetch
    information from database.
    class Transport is on the client side, make the SOAP
    "call"
    I use UtilSnoop to fetch the message between server
    and client, we can see that seems the checkData class
    works well, it can get the information from database
    and seems it can transmit it back. but when the
    progress come back Transport class, I found it failure
    in excute this line:
    --- resp = call.invoke(url, ""); ---
    the error message is : java.NullPointerException
    the result from the XML message fetched by UtilSNoop,
    and the error message, looks inconsistent, what was
    the problem, plesase help me
    public class Transport {
    public Object[][] doTran_viewList () throws Exception
    Object [][] value=null;
    try{
    url=new URL(log.urls);
    SOAPMappingRegistry smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
    Call call = new Call ();
    call.setTargetObjectURI ("urn:RegistrySystem");
    call.setMethodName ("ViewList");
    call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
    Vector params = new Vector ();
    String arg1=" ";
    params.addElement (new Parameter("arg1",
    String.class,arg1, null));
    call.setParams (params);
    Response resp;
    System.out.println("before");//when run this code, it
    will print out "before"
    resp = call.invoke(url, "");
    System.out.println("after");//but no after
    if (!resp.generatedFault())
    Parameter ret = resp.getReturnValue();
    value = (Object[][])ret.getValue();
    else
    Fault fault = resp.getFault();
    System.err.println("Generated fault: " + fault);
    return value;
    }catch(Exception e){
    System.err.println("fail to build call");//when run,
    it will print out this
    return value;
    public class checkData{
    public Object[][] ViewList (String arg1) throws
    IllegalArgumentException{
    int p=0;
    String url="jdbc:odbc:RST";
    String cs="select ID,Name from course";
    Connection con=null;
    Statement stmt=null;
    ResultSet rs =null;
    try {
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch(java.lang.ClassNotFoundException e) {
    System.err.print("ClassNotFoundException:");
    System.err.println(e.getMessage());
    try {
    con=DriverManager.getConnection(url);
    stmt=con.createStatement();
    rs=stmt.executeQuery(cs);
    while(rs.next()){p++;}
    } catch(SQLException ex) {
    System.err.println("SQLException: "+ex.getMessage());
    Object[][] value = new Object[p][2];
    try {
    con=DriverManager.getConnection(url);
    stmt=con.createStatement();
    rs=stmt.executeQuery(cs);
    for(p=0;rs.next();p++) {
    String i = rs.getString("ID");
    String n = rs.getString("Name");
    value[p][0] =i;
    value[p][1] =n;
    stmt.close();
    con.close();
    } catch(SQLException ex) {
    System.err.println("SQLException: "+ex.getMessage());
    finally{
    if (rs!=null) {
    try {
    rs.close();
    } catch (Exception ex) {
    } //end of if(rs)
    if (stmt!=null) {
    try {
    stmt.close();
    } catch (Exception ex) {
    }//end of if(stm)
    if (con!=null) {
    try {
    con.close();
    } catch (Exception ex) {
    }//end of if(con)
    return value;
    the UtilSnoop fetch message from server to client:
    <?xml version='1.0' encoding='UTF-8'?>
    <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelop
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <SOAP-ENV:Body>
    <ns1:ViewListResponse xmlns:ns1="urn:RegistrySystem"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap
    encoding/">
    <return
    xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
    xsi:type="ns2:Array" ns2:arrayType="ns2:Array[13]">
    <item xsi:type="ns2:Array"
    ns2:arrayType="xsd:anyType[2]">
    <item xsi:type="xsd:string">IEI22202</item>
    <item xsi:type="xsd:string">GUI</item>
    </item>
    <item xsi:type="ns2:Array"
    ns2:arrayType="xsd:anyType[2]">
    <item xsi:type="xsd:string">IEI12301</item>
    <item xsi:type="xsd:string">Robotics</item>
    </item>
    </return>
    </ns1:ViewListResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

  • Can anybody give the good SAP-HR Material?

    Hi,
    Could any body please give the SAP-HR material?.
    Please send to this id : [email protected]
    Early reply is highely appriciable.
    Regards,
    Chow

    Hi,
    You can see alot of similar thread in SDn itself.check it out.
    SAP-HR Learning Material
    Need SAP HR Study material for starters in SAP
    Regards,
    Manoj.

  • Can anyone give a solution for  this ???

    Hi all,
    In upload and download function modules we will get One Pop-Up in that we have File Name and Data Format Options.
    But we are in Upgrade Project (ecc 6.0). So, we are not Using the Upload or Download FM.
    Instead of that we are using
    For Upload
    CALL METHOD cl_gui_frontend_services=>file_open_dialog and
    CALL METHOD cl_gui_frontend_services=>gui_upload
    For Download
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    CALL METHOD cl_gui_frontend_services=>Gui_download
    But problem is ..Client is Requiring the Pop-Up for Data Format in new methods.
    How can we get the Popup for the same ??
    Please reply ASAP.
    Thanks in advance
    Hariram

    Hi
    Refer this code
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
    PARAMETERS : p_flint LIKE filename-fileintern
                 DEFAULT 'ZDIR_APPDATA',           " Logical Path Name
                 p_aserv RADIOBUTTON GROUP grp,    " Application server
                 p_flext LIKE filename-fileextern, " Application File Name
                 p_pserv RADIOBUTTON GROUP grp,    " Presentation Server
                 p_file1 LIKE rlgrap-filename,     " Presentation File Name
                 p_file2 LIKE rlgrap-filename,     " Error File Name
                 p_sesnm LIKE bgr00-group
                 DEFAULT 'ZPTPCNV110'.             " Session Name
    SELECTION-SCREEN : END OF BLOCK b1.
    FORM getfilename1  CHANGING p_file1 TYPE rlgrap-filename.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = sy-cprog
          dynpro_number = sy-dynnr
        IMPORTING
          file_name     = p_file1.
    ENDFORM.                    " getfilename1
    Regards,
    Prashant

  • Can you find the problem in this code?

    I've searching some examples of the using of JTable on this forum.
    So I've used a code found here.
    But nothing happens, the JFrame doesn't appear on screen.
    I'm sure my database "CLIENTES" exists inside the db folder. And also there's data inside "CLIENTES" table.
    So, where is the problem then?
    Thanks.
    import java.io.*;
    import java.sql.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TelaPrincipal extends JFrame {
       public TelaPrincipal() {
            Vector columnNames = new Vector();
            Vector data = new Vector();
            try {
               //  Connect to the Database
               String driver = "org.hsqldb.jdbcDriver";
               String url = "jdbc:hsqldb:file:./db/CLIENTES";
               String userId = "sa";
               String password = "";
               Class.forName(driver);
               Connection connection = DriverManager.getConnection(url, userId, password);
               //  Read data from a table
               String sql = "SELECT * FROM CLIENTES";
               Statement stmt = connection.createStatement();
               ResultSet rs = stmt.executeQuery(sql);
               ResultSetMetaData md = rs.getMetaData();
               int columns = md.getColumnCount();
               //  Get column names
               for (int i = 1; i <= columns; i++){
                  columnNames.addElement( md.getColumnName(i) );
               //  Get row data
               while (rs.next()) {
                  Vector row = new Vector(columns);
                  for (int i = 1; i <= columns; i++) {
                     row.addElement(rs.getObject(i));
                  data.addElement(row);
               rs.close();
               stmt.close();
            catch(ClassNotFoundException cnfe) {
               cnfe.printStackTrace();
            catch(SQLException sqle) {
              sqle.printStackTrace(); 
            //  Create table with database data
            JTable table = new JTable(data, columnNames);
            JScrollPane scrollPane = new JScrollPane( table );
            getContentPane().add(scrollPane);
        public static void main(String[] args) {
           TelaPrincipal tp = new TelaPrincipal();
           tp.setDefaultCloseOperation(EXIT_ON_CLOSE);
           tp.pack();
           tp.setVisible(true);
    }

    the jdbc driver is not on the classpath?

  • We want to automate Iphone mobile app's, can anybody give the details of the Mobile Automations tools that are certified the by the Apple, here i am having some of the tool names but i could not be able to figure out whether Apple has cerified those tools

    Hi All,
    We are planning to regress IOS mobile app that were developed in our organization with the help of Mobile Automation tools that were available int he market both commericial as well as non-commercial. Can anyone please provide us with list of tool that were certified by the apple to use for our needs in the functional as well as regression of the developed applications. I am having a list of tools that we got from the net when browsed,
    UIAutomation
    TestFlight
    SeeTestMobile
    M-eux
    NativeDriver
    Frank
    FoneMonkey / Mokey Talk
    DeviceAnyWhere
    KIF
    LessPainful
    iCuke
    UISpec
    Zap-Fix
    TestQuest
    T-Plan Robot
    Sikuli
    TestPlant
    Can any one of you let me know from the list as what are the tools that was certified the apple, apart from this list anyother tools that i may miss from the list that were certified by the Apple
    Revert back ASAP
    Wating for the reply

    Hi All,
    We are planning to regress IOS mobile app that were developed in our organization with the help of Mobile Automation tools that were available int he market both commericial as well as non-commercial. Can anyone please provide us with list of tool that were certified by the apple to use for our needs in the functional as well as regression of the developed applications. I am having a list of tools that we got from the net when browsed,
    UIAutomation
    TestFlight
    SeeTestMobile
    M-eux
    NativeDriver
    Frank
    FoneMonkey / Mokey Talk
    DeviceAnyWhere
    KIF
    LessPainful
    iCuke
    UISpec
    Zap-Fix
    TestQuest
    T-Plan Robot
    Sikuli
    TestPlant
    Can any one of you let me know from the list as what are the tools that was certified the apple, apart from this list anyother tools that i may miss from the list that were certified by the Apple
    Revert back ASAP
    Wating for the reply

  • Derived Table How can I give the results of this SQL Line an Explicit Name.

    I am trying to create a derived table and I get the error
    "each calculated column must have an explicit name"
    I added the as shiptype to the end of the line and that did not work. Any thoughts?
    shiptype = case when araddr.invno is not null then 'ADDR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end as shiptype,
    Thanks
    Jeff

    Sure,
    Here is the complete query.
    This query works fine is sql query analyzer but when I put it in the designer I get the error.
    SELECT      'C' as tableId,
    '' as StartMast,
    armast.invno as invno,
    armast.invdte as invdte,
    armast.ponum as ponum,
    armast.ordate as ordate,
    armast.shipvia as shipvia,
    armast.fob as fob,
    armast.ornum as ornum,
    armast.disc as Idisc,
    armast.taxrate as Itaxrate,
    armast.tax as tax,
    armast.invamt as invamt,
    armast.disamt as disamt,
    armast.paidamt as paidamt,
    armast.balance as balance,
    armast.dtepaid as dtepaid,
    armast.pterms as pterms,
    armast.arstat as arstat,
    armast.artype as artype,
    armast.notes as notes,
    armast.salesmn as salesmn ,
    '' as StartBill,
    arcust.custno,
    arcust.company as billComp,
    arcust.contact as billaddr1,
    arcust.address1 as billaddr2,
    arcust.address2 as billaddr3,
    arcust.city as billcity,
    arcust.addrstate as billstate,
    arcust.zip as billzip,
    arcust.country as billcountry,
    arcust.phone as billphone,
    arcust.faxno as billfaxno,
    rtrim(cast(arcust.email as varchar(2000))) as billemail,
    '' as StartShip,
    armast.tosw,
    armast.cshipno,
    shiptype = case when araddr.invno is not null then 'ADDR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end,
    shipcomp = left(case when araddr.invno is not null then araddr.company else (case when arcadr.custno is not null then arcadr.company else arcust.company end) end + space(35),35),
    shipaddr1 = left(case when araddr.invno is not null then araddr.address1 else (case when arcadr.custno is not null then arcadr.contact else arcust.contact end) end + space(30),30),
    shipaddr2 = left(case when araddr.invno is not null then araddr.address2 else (case when arcadr.custno is not null then arcadr.address1 else arcust.address1 end) end + space(30),30),
    shipaddr3 = left(case when araddr.invno is not null then araddr.address3 else (case when arcadr.custno is not null then arcadr.address2 else arcust.address2 end) end + space(30),30),
    shipcity = left(case when araddr.invno is not null then araddr.city else (case when arcadr.custno is not null then arcadr.city else arcust.city end) end + space(20),20),
    shipstate = left(case when araddr.invno is not null then araddr.addrstate else (case when arcadr.custno is not null then arcadr.addrstate else arcust.addrstate end) end + space(10),10),
    shipzip = left(case when araddr.invno is not null then araddr.zip else (case when arcadr.custno is not null then arcadr.zip else arcust.zip end) end + space(10),10),
    shipcntry = left(case when araddr.invno is not null then araddr.country else (case when arcadr.custno is not null then arcadr.country else arcust.country end) end + space(15),15),
    '' as StartCmnt,
    armast.commid as commid,
    arcomm.comment as CommCmnt,
    arscom.comment as ScomCmnt,
    invCmnt = isnull(
                case
                      when armast.commid = 'MISC' then arcomm.comment
                      when len(rtrim(armast.commid)) > 0 then arscom.comment
                      else ''
                end
    '' as StartTran,
    artran.tranlineno,
    artran.item,
    artran.loctid,
    artran.Descrip,
    artran.intmemo,
    artran.custmemo,
    artran.qtyord,
    artran.qtyshp,
    artran.price,
    artran.disc as ldisc,
    artran.taxrate as ltaxrate,
    artran.extprice,
    artran.taxable,
    artran.arstat as linestat,
    artran.artype as linetype
    FROM armast
    LEFT JOIN artran ON artran.invno = armast.invno
    Left JOIN arcust ON arcust.custno = armast.custno
    Left JOIN arcomm ON arcomm.invno = armast.invno
    Left JOIN arscom ON arscom.commid = armast.commid
    LEFT JOIN araddr ON araddr.invno = armast.invno
    LEFT JOIN arcadr ON arcadr.custno = armast.custno AND arcadr.cshipno = armast.cshipno
    WHERE (armast.invdte >= getdate() - 180 OR len(rtrim(armast.arstat)) = 0)
          AND armast.invno <> '_RECEIPT'
          AND len(rtrim(armast.currhist)) = 0
          AND armast.custno = 'TJS-01'
    Union All
    SELECT      'H' as tableId,
    '' as StartMast,
    arymst.invno as invno,
    arymst.invdte as invdte,
    arymst.ponum as ponum,
    arymst.ordate as ordate,
    arymst.shipvia as shipvia,
    arymst.fob as fob,
    arymst.ornum as ornum,
    arymst.disc as Idisc,
    arymst.taxrate as Itaxrate,
    arymst.tax as tax,
    arymst.invamt as invamt,
    arymst.disamt as disamt,
    arymst.paidamt as paidamt,
    arymst.balance as balance,
    arymst.dtepaid as dtepaid,
    arymst.pterms as pterms,
    arymst.arstat as arstat,
    arymst.artype as artype,
    arymst.notes as notes,
    arymst.salesmn as salesmn ,
    '' as StartBill,
    arcust.custno,
    arcust.company as billComp,
    arcust.contact as billaddr1,
    arcust.address1 as billaddr2,
    arcust.address2 as billaddr3,
    arcust.city as billcity,
    arcust.addrstate as billstate,
    arcust.zip as billzip,
    arcust.country as billcountry,
    arcust.phone as billphone,
    arcust.faxno as billfaxno,
    rtrim(cast(arcust.email as varchar(2000))) as billemail,
    '' as StartShip,
    arymst.tosw,
    arymst.cshipno,
    shiptype = case when aryadr.invno is not null then 'YADR' else (case when arcadr.custno is not null then 'CADR' else 'CUST' end) end,
    shipcomp = left(case when aryadr.invno is not null then aryadr.company else (case when arcadr.custno is not null then arcadr.company else arcust.company end) end + space(35),35),
    shipaddr1 = left(case when aryadr.invno is not null then aryadr.address1 else (case when arcadr.custno is not null then arcadr.contact else arcust.contact end) end + space(30),30),
    shipaddr2 = left(case when aryadr.invno is not null then aryadr.address2 else (case when arcadr.custno is not null then arcadr.address1 else arcust.address1 end) end + space(30),30),
    shipaddr3 = left(case when aryadr.invno is not null then aryadr.address3 else (case when arcadr.custno is not null then arcadr.address2 else arcust.address2 end) end + space(30),30),
    shipcity = left(case when aryadr.invno is not null then aryadr.city else (case when arcadr.custno is not null then arcadr.city else arcust.city end) end + space(20),20),
    shipstate = left(case when aryadr.invno is not null then aryadr.addrstate else (case when arcadr.custno is not null then arcadr.addrstate else arcust.addrstate end) end + space(10),10),
    shipzip = left(case when aryadr.invno is not null then aryadr.zip else (case when arcadr.custno is not null then arcadr.zip else arcust.zip end) end + space(10),10),
    shipcntry = left(case when aryadr.invno is not null then aryadr.country else (case when arcadr.custno is not null then arcadr.country else arcust.country end) end + space(15),15),
    '' as StartCmnt,
    arymst.commid as commid,
    arcomm.comment as CommCmnt,
    arscom.comment as ScomCmnt,
    invCmnt = isnull(
                case
                      when arymst.commid = 'MISC' then arcomm.comment
                      when len(rtrim(arymst.commid)) > 0 then arscom.comment
                      else ''
                end
    '' as StartTran,
    arytrn.tranlineno,
    arytrn.item,
    arytrn.loctid,
    arytrn.Descrip,
    arytrn.intmemo,
    arytrn.custmemo,
    arytrn.qtyord,
    arytrn.qtyshp,
    arytrn.price,
    arytrn.disc as ldisc,
    arytrn.taxrate as ltaxrate,
    arytrn.extprice,
    arytrn.taxable,
    arytrn.arstat as linestat,
    arytrn.artype as linetype
    FROM arymst
    LEFT JOIN arytrn ON arytrn.invno = arymst.invno
    Left JOIN arcust ON arcust.custno = arymst.custno
    Left JOIN arcomm ON arcomm.invno = arymst.invno
    Left JOIN arscom ON arscom.commid = arymst.commid
    LEFT JOIN aryadr ON aryadr.invno = arymst.invno
    LEFT JOIN arcadr ON arcadr.custno = arymst.custno AND arcadr.cshipno = arymst.cshipno
    WHERE (arymst.invdte >= getdate() - 180 OR (len(rtrim(arymst.arstat)) = 0 AND arymst.invno in (select invno FROM armast where len(rtrim(arstat)) = 0)))
          AND arymst.invno <> '_RECEIPT'
          AND arymst.custno = 'TJS-01'

  • Can anyone give a solution to this problem..thanks in advance

    - Servlet.service() for servlet jsp threw exception
    java.lang.ClassNotFoundException: org.apache.taglibs.datetime.TimeZonesTEI
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1338)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1187)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.createTagInfo(TagLibraryInfoImpl.java:419)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:248)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:162)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:146)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeploymentPage_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeploymentPage_jsp:208)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604)
    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
    at org.apache.jsp.WEB_002dINF.jsp.layouts.applicationContentLayout_jsp._jspx_meth_tiles_insert_3(org.apache.jsp.WEB_002dINF.jsp.layouts.applicationContentLayout_jsp:324)
    at org.apache.jsp.WEB_002dINF.jsp.layouts.applicationContentLayout_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.layouts.applicationContentLayout_jsp:151)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604)
    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
    at org.apache.jsp.WEB_002dINF.jsp.layouts.masterLayout_jsp._jspx_meth_tiles_insert_3(org.apache.jsp.WEB_002dINF.jsp.layouts.masterLayout_jsp:397)
    at org.apache.jsp.WEB_002dINF.jsp.layouts.masterLayout_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.layouts.masterLayout_jsp:160)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
    at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
    at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
    at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604)
    at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:137)
    at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:177)
    at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:756)
    at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:881)
    at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:473)
    at org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeployment_jsp._jspx_meth_tiles_insert_0(org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeployment_jsp:140)
    at org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeployment_jsp._jspService(org.apache.jsp.WEB_002dINF.jsp.patchDeploymentWizardScheduleDeployment_jsp:79)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
    at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
    at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
    at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
    at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
    at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:274)
    at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
    at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:320)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at com.ca.unicenter.upm.uimanager.UTF8EncodingFilter.doFilter(UTF8EncodingFilter.java:47)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)

    java.lang.ClassNotFoundException: org.apache.taglibs.datetime.TimeZonesTEIYou are using some tag or class that requires the above class, but the above class can't be found in your web app's classpath. I would search Apache to see which library (probably one of the taglibs) provides the datetime package and download it and put it in your app's WEB-INF/lib directory.

  • Can anybody tell me the problem with this code when compiled in jdk1.4

    Can anybody help me find out the error in this code.
    Try to drag a file from your desktop and drop it on the first textpane on my GUI. Then try to drag another file. This time the dragdrop event handler throws a null pointer exception. This happened when I compiled the code with jdk1.4. With jdk1.3 it is working fine. Actually, I need jdk1.4 to get the systemicons for the files I drop on my desktop.
    /* Client.java*/
    import java.util.Vector;
    import java.util.Enumeration;
    import java.util.Arrays;
    import java.awt.*;
    import java.awt.event.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import java.util.Iterator;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.*;
    import java.util.Hashtable;
    import javax.swing.text.*;
    import javax.swing.event.*;
    public class Client extends JFrame{
    static String newline = System.getProperty("line.separator");
    static Client client;
         //ServerInterface server;
         //ClientProperties clp;
         Vector v1=new Vector();
         ByteArrayOutputStream out;
         Runtime r1;
         //file objects,together with array of bytes
         Hashtable files=new Hashtable(); //files sent
         Hashtable rfiles=new Hashtable(); //files received
         //file objects,together with button handlers
         Hashtable hfiles=new Hashtable(); //files sent,files received
         JButton button1=new JButton();
         JButton button2=new JButton();
         JButton button3=new JButton();
         JLabel label1=new JLabel();
         JLabel label2=new JLabel();
         JLabel label3=new JLabel();
         JLabel label4=new JLabel();
         JLabel label5=new JLabel();
         JLabel label6=new JLabel();
         JLabel label7=new JLabel();
         JLabel label8=new JLabel();
         JOptionPane dialog=new JOptionPane();
         JFileChooser chooser = new JFileChooser();
         JPanel panel1;
         JPanel panel2;
         DropTarget dtarget;
         DragSource dsource;
         JTextPane textArea1=new JTextPane();
         TextArea textArea2=new TextArea();
         JTextPane textpanel=new JTextPane();
         Style defstyle,style;
         StyledDocument doc,doc1;
         JPopupMenu popup;
         JTree tree;
         JScrollPane jsppane;
         JScrollPane jsp,jsp2;
         DefaultMutableTreeNode top;
         Container cp;
         private String toalias;
         private String togroup;
    private String fromalias;
         private String fromgroup;     
         private boolean CONNECT;
         public Client()
         cp=getContentPane();
         cp.setLayout(null);
              setForeground(java.awt.Color.red);
              setFont(new Font("Dialog", Font.PLAIN, 14));
              setVisible(false);
              label1.setText(" CHAT APPLICATION");
              cp.add(label1);
              label1.setFont(new Font("Dialog", Font.BOLD, 16));
              label1.setBounds(72,20,319,30);
              label2.setText("List of Users Connected.");
              cp.add(label2);
              label2.setForeground(java.awt.Color.blue);
              label2.setFont(new Font("Dialog", Font.BOLD, 12));
              label2.setBounds(24,60,192,26);
              label8.setBounds(280,60,100,26);
              cp.add(label8);
              cp.add(textArea2);
              textArea2.setBounds(204,120,268,90);
              jsppane=new JScrollPane(textArea1);
              doc1=textArea1.getStyledDocument();
              jsppane.setBounds(12,264,456,109);
              cp.add(jsppane);
              label3.setText("TO::");
              cp.add(label3);
              label3.setFont(new Font("Dialog", Font.BOLD, 12));
              label3.setBounds(12,228,36,20);
              cp.add(label4);
              label4.setBackground(java.awt.Color.lightGray);
              label4.setBounds(60,228,172,19);
              label5.setText("SERVER RESPONSE");
              cp.add(label5);
              label5.setFont(new Font("Dialog", Font.BOLD, 12));
              label5.setBounds(204,96,204,21);
              label7.setText("MESSAGE FOR YOU.");
              cp.add(label7);
              label7.setFont(new Font("Dialog", Font.BOLD, 14));
         label7.setBounds(12,371,288,25);
         jsp2=new JScrollPane(textpanel);
         setTextPaneStyle();
    jsp2.setBounds(12,401,456,109);
    cp.add(jsp2);
    button1.setLabel("Send");
              button1.setEnabled(false);
              cp.add(button1);
              button1.setBackground(java.awt.Color.lightGray);
              button1.setForeground(java.awt.Color.black);
              button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button1.setBounds(60,520,78,36);
              button2.setLabel("Attach");
              //button2.setEnabled(false);
              cp.add(button2);
              button2.setBackground(java.awt.Color.lightGray);
              button2.setForeground(java.awt.Color.black);
              button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button2.setBounds(180,520,72,36);
              button3.setLabel("Connect");
              cp.add(button3);
              button3.setBackground(java.awt.Color.lightGray);
              button3.setForeground(java.awt.Color.black);
              button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
              button3.setBounds(288,520,72,33);
              setSize(500,620);
         show();
         addWindowListener(new WindowEventHandler());
         button1.addActionListener(new ButtonHandler());     
         button2.addActionListener(new ButtonHandler());     
         button3.addActionListener(new ButtonHandler());
         textArea1.addContainerListener(new ComponentHandler());     
         dtarget=new DropTarget(textArea1,new DragDropHandler());
         textArea2.setEnabled(false);
         textpanel.setEnabled(false);
         r1=Runtime.getRuntime();
         r1.addShutdownHook(new onshutdown());
         addMenu();
         cp.repaint();
         //adds attachments to the textArea1     
         synchronized private void addAttach(java.util.List fileList)
         Iterator iterator=fileList.iterator();
         JButton bw;
         while(iterator.hasNext())
              File file=(File)iterator.next();
              Icon icon=chooser.getIcon(file);
              bw=new JButton(icon);
              bw.setBackground(java.awt.Color.gray);
              bw.setToolTipText(file.getAbsolutePath());
              bw.addMouseListener(new AttachmentHandler());
              Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
              bw.setMaximumSize(d1);
              hfiles.put(bw,file);          
              textArea1.insertComponent(bw);
              textArea1.setCaretPosition(doc1.getLength());
              bw.setSize(icon.getIconWidth(),icon.getIconHeight());
              //only one file at a time
              break;
         cp.repaint();
    public void setAudioStream(ByteArrayOutputStream out)
    this.out=out;               
    private void addMenu()
         JMenuBar mbar=new JMenuBar();
         mbar.setVisible(true);
         mbar.setBounds(0,0,500,20);
         mbar.setBackground(java.awt.Color.gray);
         //first menu
         JMenu m1=new JMenu("Connection");
         m1.setBounds(0,0,80,20);
         m1.setBackground(java.awt.Color.gray);
         JMenuItem mitem1=new JMenuItem("Connect");
         JMenuItem mitem2=new JMenuItem("Disconnect");
         m1.add(mitem1);
         m1.add(mitem2);
         mitem1.addActionListener(new ButtonHandler());
         mitem2.addActionListener(new ButtonHandler());
         mbar.add(m1);
         //second menu
         JMenu m2=new JMenu("Send...");
         m2.setBounds(90,0,80,20);
         m2.setBackground(java.awt.Color.gray);
         JMenuItem mitem3=new JMenuItem("Send");
         JMenuItem mitem4=new JMenuItem("Send with Audio...");
         mitem3.addActionListener(new ButtonHandler());
         mitem4.addActionListener(new ButtonHandler());
         m2.add(mitem3);
         m2.add(mitem4);
         mbar.add(m2);
         cp.add(mbar);
    private void setTextPaneStyle()
    StyleContext stylecontext =StyleContext.getDefaultStyleContext();
    defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
    doc= textpanel.getStyledDocument();
    //style 1
    style= textpanel.addStyle("bold",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.blue);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, true);
    StyleConstants.setFontSize(style,16);
    //style 2
    style= textpanel.addStyle("normal",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.black);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,14);      
    //style3
    style= textpanel.addStyle("attach",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.red);
    StyleConstants.setItalic(style, true);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,12);      
    //remote method called by server
    public void addClient(String alias,String group,JTree tree)
         //if old client remove old tree
         if(!alias.equals(""))
         cp.remove(this.jsp);
         //add new tree
         this.tree=tree;
         setTreeModel();
         getSound(2);
         if(!alias.equals(""))
         textArea2.append("\nNew Client:" + alias + "has joined");
         else
         textArea2.append("\nYou have been connected to the Server.");
         jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
         jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    //remote method called by server
    public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
              receiveMessage(str,rfiles,alias,group);
    //remote method called by server
    public void removeClient(JTree tree,String alias,String group) throws RemoteException
    cp.remove(this.jsp);
    this.tree=tree;
    setTreeModel();
    getSound(3);
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
         jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    textArea2.append("\nClient:" + alias + "has disconnected");                          
    private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
              boolean flag=true;
              UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
    UIManager.put("JFrame.activeTitleForeground", Color.white);
    UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
    UIManager.put("JFrame.inactiveTitleForeground", Color.black);
    SwingUtilities.updateComponentTreeUI(this);
              try{
              if(alias.equals(""))
         doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
              doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
              else
              doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
              doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
              //add files to textpanel
              if(rfiles!=null && rfiles.size()>0)
              doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
              showattach(rfiles);
              addtoList(rfiles);     
    doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
    catch(Exception e)
              e.printStackTrace();
              dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
         cp.repaint();               
    protected boolean ContactServer(String alias,String servername,String group)
         try{
              //UnicastRemoteObject.exportObject(this);
              //server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
         //     server.notifyMe(this,alias,group);
              //change the settings of buttons
              button1.setEnabled(true);
              button2.setEnabled(true);
              button3.setLabel("Disconnect");
              label8.setVisible(true);
              label8.setText(" Welcome::" + alias);
              //putting values of alias and group for sending messages
              fromalias=alias;
              fromgroup=group;
              CONNECT=true;
              return true;
         catch(UnsupportedOperationException e)
         dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);                                   
         try{
              //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception ev){System.out.println(ev.toString());}     
         catch(Exception e)
              dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
              try{
              //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception ev){System.out.println(ev.toString());}     
         return false;      
    public static void main(String args[]) throws RemoteException{
         client=new Client();          
    }//main ends
    public void getSound(int count)
         Toolkit t1=getToolkit();
              for(int i=0;i<count;i++)
              t1.beep();
              try{
                   Thread.sleep(500);
              catch(Exception e){}
    public void setTreeModel()
    ImageIcon i1=new ImageIcon("Lock.gif","No Users");
    ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
    ImageIcon i3=new ImageIcon("authorbn.gif","An User");
    DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
    dr1.setClosedIcon(i1);
    dr1.setOpenIcon(i2);
    dr1.setLeafIcon(i3);
    dr1.setTextSelectionColor(java.awt.Color.red);
    tree.setCellRenderer(dr1);
    //add received files to the list
    private void addtoList(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();          
    while(filelist.hasMoreElements())          
    File file=(File)filelist.nextElement();
    this.rfiles.put(file,rfiles.get(file));               
    //show the attachments received               
    private void showattach(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    dsource=DragSource.getDefaultDragSource();
    JButton b1=null;
    while(filelist.hasMoreElements())
         File file=(File)filelist.nextElement();
         Icon icon=chooser.getIcon(file);
         b1=new JButton(icon);
         b1.setBackground(java.awt.Color.gray);
    b1.setToolTipText(file.getName());
    b1.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    b1.setMaximumSize(d1);
    hfiles.put(b1,file);
    textpanel.setCaretPosition(doc.getLength());
    textpanel.insertComponent(b1);
    b1.setSize(icon.getIconWidth(),icon.getIconHeight());
    dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());           
    cp.repaint();
    private void savefile(File file,Object parent)
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension("txt",true);
    //chooser.setFileFilter(filter);
    int returnVal = chooser.showSaveDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
         try{
         FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
         //decide whether the file received or sent is to be saved
         if(((Container)parent).equals(textArea1))
         fstream.write((byte[])files.get(file));
         else
         fstream.write((byte[])rfiles.get(file));
         fstream.close();
         System.out.println(file.getName());          
         catch(Exception e)
         {System.out.println(e.toString()); }
    private void openfile(File file,Object parent)
         File tempfile=null;
         try{
         String fname=file.getName();     
         tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));     
         FileOutputStream fstream=new FileOutputStream(tempfile);
         System.out.println(tempfile.getAbsolutePath());
         //decide whether the file received or sent is to be saved
         if(((Container)parent).equals(textArea1))
         fstream.write((byte[])files.get(file));
         else
         fstream.write((byte[])rfiles.get(file));          
         fstream.close();
    catch(Exception e){System.out.println(e.toString());}
    try{
         Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
         p1.waitFor();
    catch(Exception e){System.out.println(e.toString());}     
    //inner classes
    class ComponentHandler implements ContainerListener{
    public void componentRemoved(ContainerEvent ev)     
              Container cont=(Container)ev.getChild();
              if(cont.getComponentCount()>0)
              JButton but=(JButton)cont.getComponent(0);
              files.remove((File)hfiles.get(but));
              hfiles.remove(but);
    public void componentAdded(ContainerEvent ev){}
    class AttachmentHandler extends MouseAdapter{
         public void mouseClicked(MouseEvent ev){
         if(ev.getModifiers()==4)
         Component comp=(Component)ev.getSource();
         File file=(File)hfiles.get(comp);
         popup=new JPopupMenu();
         JMenuItem popopen=new JMenuItem("Open");
         JMenuItem popsave=new JMenuItem("Save As..");
         popup.add(popopen);
         System.out.println(comp.getParent().getParent().getClass().toString());
         popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
         popup.add(popsave);
         popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
         popup.show(comp,12,12);
    class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
    final static int FILE = 0;
    final static int STRING = 1;
    final static int PLAIN = 2;
    DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
    public void dragDropEnd(DragSourceDropEvent ev){}
    public void dragEnter(DragSourceDragEvent ev){}
    public void dragExit(DragSourceEvent ev){}
    public void dragOver(DragSourceDragEvent ev){}
    public void dropActionChanged(DragSourceDragEvent ev){}
    public void dragGestureRecognized(DragGestureEvent ev)     
              System.out.println("recognized");
              File file=(File)hfiles.get(ev.getComponent());
    addElement(file);
    ev.startDrag(DragSource.DefaultCopyDrop,this,this);
    /* Returns the array of flavors in which it can provide the data. */
    public synchronized DataFlavor[] getTransferDataFlavors() {
         return flavors;
    /* Returns whether the requested flavor is supported by this object. */
    public boolean isDataFlavorSupported(DataFlavor flavor) {
    boolean b = false;
    b |=flavor.equals(flavors[FILE]);
    b |= flavor.equals(flavors[STRING]);
    b |= flavor.equals(flavors[PLAIN]);
         return (b);
    public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
    if(flavor.equals(flavors[FILE])){return this;}
    else if (flavor.equals(flavors[PLAIN])) {
         return new StringReader(((File)elementAt(0)).getAbsolutePath());
         } else if (flavor.equals(flavors[STRING])) {
         return((File)elementAt(0)).getAbsolutePath();
         } else {
         throw new UnsupportedFlavorException(flavor);
    //inner class for draging in the files on java frame     
    class DragDropHandler implements DropTargetListener{
    public void dragEnter(DropTargetDragEvent ev){     
    public void dragExit(DropTargetEvent ev){
    public void dragOver(DropTargetDragEvent ev){
    public void drop(DropTargetDropEvent ev){
         Transferable tf1=ev.getTransferable();
         DataFlavor fl[]=ev.getCurrentDataFlavors();
         if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
         ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
         try{
         java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
    Iterator iterator = fileList.iterator();
    while (iterator.hasNext())
    File file = (File)iterator.next();
    if(file.isFile())
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    ev.getDropTargetContext().dropComplete(true);
    addAttach(fileList);
    catch(Exception e)
    {System.out.println(e.toString() + "here");}
    public void dropActionChanged(DropTargetDragEvent ev){
    class MouseHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent me)
    TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
    if(tp!=null)
         if(tp.getPathCount()==3)
              toalias=tp.getPathComponent(2).toString();
              togroup=tp.getPathComponent(1).toString();
              System.out.println(toalias);
              if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
              System.out.println("hh " + toalias);
              label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());           
    class ButtonHandler implements ActionListener{
         private File file;
         private Object parent;
         //constructors
         public ButtonHandler()
         public ButtonHandler(File file,Object parent)
              this.file=file;
              this.parent=parent;
         //other functions      
         public void actionPerformed(ActionEvent ev){
              String s=ev.getActionCommand();
         System.out.println(s);
              if(s.equals("Send with Audio..."))
              //Audio audio=new Audio(client,false,"CAPTURE");          
              if(s.equals("Disconnect"))
              try{
              // server.disconnect(client);
              client.getSound(3);
              cp.remove(jsp);
              label6.setVisible(false);
              //UnicastRemoteObject.unexportObject(client,true);
              button3.setLabel("Connect");
              textArea2.append("\nYou have been disconnected to Server");
              client.repaint();     
              catch(Exception e)
              System.out.println(e.toString());
              if(s.equals("Connect"))
         //     clp=new ClientProperties(client,false);
         if(s.equals("Save As.."))
         savefile(file,parent);     
         if(s.equals("Open"))
         openfile(file,parent);
              if(s.equals("Attach"))
              //ExtensionFileFilter filter = new ExtensionFileFilter(false);
              //filter.addExtension(".txt",true);
              //filter.setDescription("Text Files(.txt)");
              // chooser.setFileFilter(filter);
              chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
              //chooser.setMultiSelectionEnabled(true);
              int returnVal = chooser.showOpenDialog(client);
              if(returnVal ==JFileChooser.APPROVE_OPTION)
              //File fp[]=chooser.getSelectedFiles();
              File fp[]=new File[1];
              fp[0]=chooser.getSelectedFile();
              int i=0;
              while(i<fp.length)
              try{
              File file=fp;
              Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return; }
    i++;
              java.util.List fileList=Arrays.asList(fp);
              addAttach(fileList);
              if(s.equals("Send"))
              try{
                   if(toalias==null)
                   dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
                   return;
                   if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
                   // server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
                   textArea1.setText("");
              catch(Exception e)
         e.printStackTrace();
    }//if ends
    class WindowEventHandler extends WindowAdapter{
         public void windowClosing(WindowEvent ev){
              try{
              //server.disconnect(client);
              client.getSound(3);
         //     UnicastRemoteObject.unexportObject(client,true);
              catch(Exception e){System.out.println(e.toString());}
              dispose();
    private class onshutdown extends Thread{
    public void run(){
         try{
              //server.disconnect(client);
              //UnicastRemoteObject.unexportObject(client,true);
              catch(Exception e){}      
    }//run ends          

    Here is the working code :
    There was an error line 724
    File file=fp; -> File file=fp[0];
    Several method were deprecated and try to replace the deprecated static field : DataFlavor.plainTextFlavor which was deprecated since 1.4.
    /* Client.java*/
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.rmi.*;
    import java.rmi.server.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import javax.swing.filechooser.*;
    import java.io.*;
    import java.awt.dnd.*;
    import java.awt.datatransfer.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.basic.*;
    import javax.swing.text.*;
    import javax.swing.event.*;
    public class Client extends JFrame{
    static String newline = System.getProperty("line.separator");
    static Client client;
    //ServerInterface server;
    //ClientProperties clp;
    Vector v1=new Vector();
    ByteArrayOutputStream out;
    Runtime r1;
    //file objects,together with array of bytes
    Hashtable files=new Hashtable(); //files sent
    Hashtable rfiles=new Hashtable(); //files received
    //file objects,together with button handlers
    Hashtable hfiles=new Hashtable(); //files sent,files received
    JButton button1=new JButton();
    JButton button2=new JButton();
    JButton button3=new JButton();
    JLabel label1=new JLabel();
    JLabel label2=new JLabel();
    JLabel label3=new JLabel();
    JLabel label4=new JLabel();
    JLabel label5=new JLabel();
    JLabel label6=new JLabel();
    JLabel label7=new JLabel();
    JLabel label8=new JLabel();
    JOptionPane dialog=new JOptionPane();
    JFileChooser chooser = new JFileChooser();
    JPanel panel1;
    JPanel panel2;
    DropTarget dtarget;
    DragSource dsource;
    JTextPane textArea1=new JTextPane();
    TextArea textArea2=new TextArea();
    JTextPane textpanel=new JTextPane();
    Style defstyle,style;
    StyledDocument doc,doc1;
    JPopupMenu popup;
    JTree tree;
    JScrollPane jsppane;
    JScrollPane jsp,jsp2;
    DefaultMutableTreeNode top;
    Container cp;
    private String toalias;
    private String togroup;
    private String fromalias;
    private String fromgroup;
    private boolean CONNECT;
    public Client()
    cp=getContentPane();
    cp.setLayout(null);
    setForeground(java.awt.Color.red);
    setFont(new Font("Dialog", Font.PLAIN, 14));
    setVisible(false);
    label1.setText(" CHAT APPLICATION");
    cp.add(label1);
    label1.setFont(new Font("Dialog", Font.BOLD, 16));
    label1.setBounds(72,20,319,30);
    label2.setText("List of Users Connected.");
    cp.add(label2);
    label2.setForeground(java.awt.Color.blue);
    label2.setFont(new Font("Dialog", Font.BOLD, 12));
    label2.setBounds(24,60,192,26);
    label8.setBounds(280,60,100,26);
    cp.add(label8);
    cp.add(textArea2);
    textArea2.setBounds(204,120,268,90);
    jsppane=new JScrollPane(textArea1);
    doc1=textArea1.getStyledDocument();
    jsppane.setBounds(12,264,456,109);
    cp.add(jsppane);
    label3.setText("TO::");
    cp.add(label3);
    label3.setFont(new Font("Dialog", Font.BOLD, 12));
    label3.setBounds(12,228,36,20);
    cp.add(label4);
    label4.setBackground(java.awt.Color.lightGray);
    label4.setBounds(60,228,172,19);
    label5.setText("SERVER RESPONSE");
    cp.add(label5);
    label5.setFont(new Font("Dialog", Font.BOLD, 12));
    label5.setBounds(204,96,204,21);
    label7.setText("MESSAGE FOR YOU.");
    cp.add(label7);
    label7.setFont(new Font("Dialog", Font.BOLD, 14));
    label7.setBounds(12,371,288,25);
    jsp2=new JScrollPane(textpanel);
    setTextPaneStyle();
    jsp2.setBounds(12,401,456,109);
    cp.add(jsp2);
    button1.setText("Send");
    button1.setEnabled(false);
    cp.add(button1);
    button1.setBackground(java.awt.Color.lightGray);
    button1.setForeground(java.awt.Color.black);
    button1.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button1.setBounds(60,520,78,36);
    button2.setText("Attach");
    //button2.setEnabled(false);
    cp.add(button2);
    button2.setBackground(java.awt.Color.lightGray);
    button2.setForeground(java.awt.Color.black);
    button2.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button2.setBounds(180,520,72,36);
    button3.setText("Connect");
    cp.add(button3);
    button3.setBackground(java.awt.Color.lightGray);
    button3.setForeground(java.awt.Color.black);
    button3.setFont(new Font("Dialog", Font.BOLD|Font.ITALIC, 10));
    button3.setBounds(288,520,72,33);
    setSize(500,620);
    show();
    addWindowListener(new WindowEventHandler());
    button1.addActionListener(new ButtonHandler());
    button2.addActionListener(new ButtonHandler());
    button3.addActionListener(new ButtonHandler());
    textArea1.addContainerListener(new ComponentHandler());
    dtarget=new DropTarget(textArea1,new DragDropHandler());
    textArea2.setEnabled(false);
    textpanel.setEnabled(false);
    r1=Runtime.getRuntime();
    r1.addShutdownHook(new onshutdown());
    addMenu();
    cp.repaint();
    //adds attachments to the textArea1
    synchronized private void addAttach(java.util.List fileList)
    Iterator iterator=fileList.iterator();
    JButton bw;
    while(iterator.hasNext())
    File file=(File)iterator.next();
    Icon icon=chooser.getIcon(file);
    bw=new JButton(icon);
    bw.setBackground(java.awt.Color.gray);
    bw.setToolTipText(file.getAbsolutePath());
    bw.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    bw.setMaximumSize(d1);
    hfiles.put(bw,file);
    textArea1.insertComponent(bw);
    textArea1.setCaretPosition(doc1.getLength());
    bw.setSize(icon.getIconWidth(),icon.getIconHeight());
    //only one file at a time
    break;
    cp.repaint();
    public void setAudioStream(ByteArrayOutputStream out)
    this.out=out;
    private void addMenu()
    JMenuBar mbar=new JMenuBar();
    mbar.setVisible(true);
    mbar.setBounds(0,0,500,20);
    mbar.setBackground(java.awt.Color.gray);
    //first menu
    JMenu m1=new JMenu("Connection");
    m1.setBounds(0,0,80,20);
    m1.setBackground(java.awt.Color.gray);
    JMenuItem mitem1=new JMenuItem("Connect");
    JMenuItem mitem2=new JMenuItem("Disconnect");
    m1.add(mitem1);
    m1.add(mitem2);
    mitem1.addActionListener(new ButtonHandler());
    mitem2.addActionListener(new ButtonHandler());
    mbar.add(m1);
    //second menu
    JMenu m2=new JMenu("Send...");
    m2.setBounds(90,0,80,20);
    m2.setBackground(java.awt.Color.gray);
    JMenuItem mitem3=new JMenuItem("Send");
    JMenuItem mitem4=new JMenuItem("Send with Audio...");
    mitem3.addActionListener(new ButtonHandler());
    mitem4.addActionListener(new ButtonHandler());
    m2.add(mitem3);
    m2.add(mitem4);
    mbar.add(m2);
    cp.add(mbar);
    private void setTextPaneStyle()
    StyleContext stylecontext =StyleContext.getDefaultStyleContext();
    defstyle=stylecontext.getStyle(StyleContext.DEFAULT_STYLE);
    doc= textpanel.getStyledDocument();
    //style 1
    style= textpanel.addStyle("bold",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.blue);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, true);
    StyleConstants.setFontSize(style,16);
    //style 2
    style= textpanel.addStyle("normal",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.black);
    StyleConstants.setItalic(style, false);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,14);
    //style3
    style= textpanel.addStyle("attach",defstyle);
    StyleConstants.setBackground(style,Color.white);
    StyleConstants.setForeground(style,Color.red);
    StyleConstants.setItalic(style, true);
    StyleConstants.setBold(style, false);
    StyleConstants.setFontSize(style,12);
    //remote method called by server
    public void addClient(String alias,String group,JTree tree)
    //if old client remove old tree
    if(!alias.equals(""))
    cp.remove(this.jsp);
    //add new tree
    this.tree=tree;
    setTreeModel();
    getSound(2);
    if(!alias.equals(""))
    textArea2.append("\nNew Client:" + alias + "has joined");
    else
    textArea2.append("\nYou have been connected to the Server.");
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
    jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    //remote method called by server
    public void sendMessage(String str,Hashtable rfiles,String alias,String group) throws RemoteException
    receiveMessage(str,rfiles,alias,group);
    //remote method called by server
    public void removeClient(JTree tree,String alias,String group) throws RemoteException
    cp.remove(this.jsp);
    this.tree=tree;
    setTreeModel();
    getSound(3);
    jsp=new JScrollPane(this.tree);
    jsp.setBounds(12,96,168,120);
    jsp.setBackground(java.awt.Color.lightGray);
    cp.add(jsp);
    this.tree.addMouseListener(new MouseHandler());
    textArea2.append("\nClient:" + alias + "has disconnected");
    private void receiveMessage(String str,Hashtable rfiles,String alias,String group)
    boolean flag=true;
    UIManager.put("JFrame.activeTitleBackground", new Color(64,128,255));
    UIManager.put("JFrame.activeTitleForeground", Color.white);
    UIManager.put("JFrame.inactiveTitleBackground", new Color(128,128,128));
    UIManager.put("JFrame.inactiveTitleForeground", Color.black);
    SwingUtilities.updateComponentTreeUI(this);
    try{
    if(alias.equals(""))
    doc.insertString(doc.getLength(),"CHATMASTER>>",textpanel.getStyle("bold"));
    doc.insertString(doc.getLength(),str+ newline,textpanel.getStyle("normal"));
    else
    doc.insertString(doc.getLength(),alias + "@" + group + ">>",textpanel.getStyle("bold"));
    doc.insertString(doc.getLength(),str,textpanel.getStyle("normal"));
    //add files to textpanel
    if(rfiles!=null && rfiles.size()>0)
    doc.insertString(doc.getLength(),newline+"Attachments>>",textpanel.getStyle("attach"));
    showattach(rfiles);
    addtoList(rfiles);
    doc.insertString(doc.getLength(),newline,textpanel.getStyle("normal"));
    catch(Exception e)
    e.printStackTrace();
    dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    cp.repaint();
    protected boolean ContactServer(String alias,String servername,String group)
    try{
    //UnicastRemoteObject.exportObject(this);
    //server=(ServerInterface)Naming.lookup("//gpt02d05:5500/" + servername);
    // server.notifyMe(this,alias,group);
    //change the settings of buttons
    button1.setEnabled(true);
    button2.setEnabled(true);
    button3.setText("Disconnect");
    label8.setVisible(true);
    label8.setText(" Welcome::" + alias);
    //putting values of alias and group for sending messages
    fromalias=alias;
    fromgroup=group;
    CONNECT=true;
    return true;
    catch(UnsupportedOperationException e)
    dialog.showMessageDialog(client,"Client with the Same Alias in " + group + " already exists","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    try{
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception ev){System.out.println(ev.toString());}
    catch(Exception e)
    dialog.showMessageDialog(client,"Unable to connect to Server","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    try{
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception ev){System.out.println(ev.toString());}
    return false;
    public static void main(String args[]) throws RemoteException{
    client=new Client();
    }//main ends
    public void getSound(int count)
    Toolkit t1=getToolkit();
    for(int i=0;i<count;i++)
    t1.beep();
    try{
    Thread.sleep(500);
    catch(Exception e){}
    public void setTreeModel()
    ImageIcon i1=new ImageIcon("Lock.gif","No Users");
    ImageIcon i2=new ImageIcon("Connec.gif","Users in Group");
    ImageIcon i3=new ImageIcon("authorbn.gif","An User");
    DefaultTreeCellRenderer dr1= new DefaultTreeCellRenderer();
    dr1.setClosedIcon(i1);
    dr1.setOpenIcon(i2);
    dr1.setLeafIcon(i3);
    dr1.setTextSelectionColor(java.awt.Color.red);
    tree.setCellRenderer(dr1);
    //add received files to the list
    private void addtoList(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    while(filelist.hasMoreElements())
    File file=(File)filelist.nextElement();
    this.rfiles.put(file,rfiles.get(file));
    //show the attachments received
    private void showattach(Hashtable rfiles)
    Enumeration filelist=rfiles.keys();
    dsource=DragSource.getDefaultDragSource();
    JButton b1=null;
    while(filelist.hasMoreElements())
    File file=(File)filelist.nextElement();
    Icon icon=chooser.getIcon(file);
    b1=new JButton(icon);
    b1.setBackground(java.awt.Color.gray);
    b1.setToolTipText(file.getName());
    b1.addMouseListener(new AttachmentHandler());
    Dimension d1=new Dimension(icon.getIconWidth(),icon.getIconHeight());
    b1.setMaximumSize(d1);
    hfiles.put(b1,file);
    textpanel.setCaretPosition(doc.getLength());
    textpanel.insertComponent(b1);
    b1.setSize(icon.getIconWidth(),icon.getIconHeight());
    dsource.createDefaultDragGestureRecognizer(b1, DnDConstants.ACTION_COPY_OR_MOVE,new DragGestureHandler());
    cp.repaint();
    private void savefile(File file,Object parent)
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension("txt",true);
    //chooser.setFileFilter(filter);
    int returnVal = chooser.showSaveDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
    try{
    FileOutputStream fstream=new FileOutputStream(chooser.getSelectedFile());
    //decide whether the file received or sent is to be saved
    if(((Container)parent).equals(textArea1))
    fstream.write((byte[])files.get(file));
    else
    fstream.write((byte[])rfiles.get(file));
    fstream.close();
    System.out.println(file.getName());
    catch(Exception e)
    {System.out.println(e.toString()); }
    private void openfile(File file,Object parent)
    File tempfile=null;
    try{
    String fname=file.getName();
    tempfile=File.createTempFile("temp",fname.substring(fname.lastIndexOf(".")));
    FileOutputStream fstream=new FileOutputStream(tempfile);
    System.out.println(tempfile.getAbsolutePath());
    //decide whether the file received or sent is to be saved
    if(((Container)parent).equals(textArea1))
    fstream.write((byte[])files.get(file));
    else
    fstream.write((byte[])rfiles.get(file));
    fstream.close();
    catch(Exception e){System.out.println(e.toString());}
    try{
    Process p1=r1.exec("cmd /c start " + tempfile.getAbsolutePath());
    p1.waitFor();
    catch(Exception e){System.out.println(e.toString());}
    //inner classes
    class ComponentHandler implements ContainerListener{
    public void componentRemoved(ContainerEvent ev)
    Container cont=(Container)ev.getChild();
    if(cont.getComponentCount()>0)
    JButton but=(JButton)cont.getComponent(0);
    files.remove((File)hfiles.get(but));
    hfiles.remove(but);
    public void componentAdded(ContainerEvent ev){}
    class AttachmentHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent ev){
    if(ev.getModifiers()==4)
    Component comp=(Component)ev.getSource();
    File file=(File)hfiles.get(comp);
    popup=new JPopupMenu();
    JMenuItem popopen=new JMenuItem("Open");
    JMenuItem popsave=new JMenuItem("Save As..");
    popup.add(popopen);
    System.out.println(comp.getParent().getParent().getClass().toString());
    popopen.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
    popup.add(popsave);
    popsave.addActionListener(new ButtonHandler(file,comp.getParent().getParent()));
    popup.show(comp,12,12);
    class DragGestureHandler extends Vector implements DragGestureListener,DragSourceListener,Transferable{
    final static int FILE = 0;
    final static int STRING = 1;
    final static int PLAIN = 2;
    DataFlavor flavors[] = {DataFlavor.javaFileListFlavor,DataFlavor.stringFlavor,DataFlavor.plainTextFlavor};
    public void dragDropEnd(DragSourceDropEvent ev){}
    public void dragEnter(DragSourceDragEvent ev){}
    public void dragExit(DragSourceEvent ev){}
    public void dragOver(DragSourceDragEvent ev){}
    public void dropActionChanged(DragSourceDragEvent ev){}
    public void dragGestureRecognized(DragGestureEvent ev)
    System.out.println("recognized");
    File file=(File)hfiles.get(ev.getComponent());
    addElement(file);
    ev.startDrag(DragSource.DefaultCopyDrop,this,this);
    /* Returns the array of flavors in which it can provide the data. */
    public synchronized DataFlavor[] getTransferDataFlavors() {
    return flavors;
    /* Returns whether the requested flavor is supported by this object. */
    public boolean isDataFlavorSupported(DataFlavor flavor) {
    boolean b = false;
    b |=flavor.equals(flavors[FILE]);
    b |= flavor.equals(flavors[STRING]);
    b |= flavor.equals(flavors[PLAIN]);
    return (b);
    public synchronized Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,IOException
    if(flavor.equals(flavors[FILE])){return this;}
    else if (flavor.equals(flavors[PLAIN])) {
    return new StringReader(((File)elementAt(0)).getAbsolutePath());
    } else if (flavor.equals(flavors[STRING])) {
    return((File)elementAt(0)).getAbsolutePath();
    } else {
    throw new UnsupportedFlavorException(flavor);
    //inner class for draging in the files on java frame
    class DragDropHandler implements DropTargetListener{
    public void dragEnter(DropTargetDragEvent ev){
    public void dragExit(DropTargetEvent ev){
    public void dragOver(DropTargetDragEvent ev){
    public void drop(DropTargetDropEvent ev){
    Transferable tf1=ev.getTransferable();
    DataFlavor fl[]=ev.getCurrentDataFlavors();
    if(ev.isDataFlavorSupported(DataFlavor.javaFileListFlavor))
    ev.acceptDrop (DnDConstants.ACTION_COPY_OR_MOVE);
    try{
    java.util.List fileList = (java.util.List)tf1.getTransferData(DataFlavor.javaFileListFlavor);
    Iterator iterator = fileList.iterator();
    while (iterator.hasNext())
    File file = (File)iterator.next();
    if(file.isFile())
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    ev.getDropTargetContext().dropComplete(true);
    addAttach(fileList);
    catch(Exception e)
    {System.out.println(e.toString() + "here");}
    public void dropActionChanged(DropTargetDragEvent ev){
    class MouseHandler extends MouseAdapter{
    public void mouseClicked(MouseEvent me)
    TreePath tp=tree.getPathForLocation(me.getX(),me.getY());
    if(tp!=null)
    if(tp.getPathCount()==3)
    toalias=tp.getPathComponent(2).toString();
    togroup=tp.getPathComponent(1).toString();
    System.out.println(toalias);
    if (!(toalias.equals(fromalias) && togroup.equals(fromgroup)))
    System.out.println("hh " + toalias);
    label4.setText(tp.getPathComponent(2).toString() + "_@" + tp.getPathComponent(1).toString());
    class ButtonHandler implements ActionListener{
    private File file;
    private Object parent;
    //constructors
    public ButtonHandler()
    public ButtonHandler(File file,Object parent)
    this.file=file;
    this.parent=parent;
    //other functions
    public void actionPerformed(ActionEvent ev){
    String s=ev.getActionCommand();
    System.out.println(s);
    if(s.equals("Send with Audio..."))
    //Audio audio=new Audio(client,false,"CAPTURE");
    if(s.equals("Disconnect"))
    try{
    // server.disconnect(client);
    client.getSound(3);
    cp.remove(jsp);
    label6.setVisible(false);
    //UnicastRemoteObject.unexportObject(client,true);
    button3.setText("Connect");
    textArea2.append("\nYou have been disconnected to Server");
    client.repaint();
    catch(Exception e)
    System.out.println(e.toString());
    if(s.equals("Connect"))
    // clp=new ClientProperties(client,false);
    if(s.equals("Save As.."))
    savefile(file,parent);
    if(s.equals("Open"))
    openfile(file,parent);
    if(s.equals("Attach"))
    //ExtensionFileFilter filter = new ExtensionFileFilter(false);
    //filter.addExtension(".txt",true);
    //filter.setDescription("Text Files(.txt)");
    // chooser.setFileFilter(filter);
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    //chooser.setMultiSelectionEnabled(true);
    int returnVal = chooser.showOpenDialog(client);
    if(returnVal ==JFileChooser.APPROVE_OPTION)
    //File fp[]=chooser.getSelectedFiles();
    File fp[]=new File[1];
    fp[0]=chooser.getSelectedFile();
    int i=0;
    while(i<fp.length)
    try{
    File file=fp[0];
    Icon icon=chooser.getIcon(file);
    FileInputStream fstream=new FileInputStream(file);
    int filedata=(new Double(file.length())).intValue();
    byte bytes[]=new byte[filedata];
    fstream.read(bytes);
    files.put(file,bytes);
    catch(Exception e){dialog.showMessageDialog(client,e.toString(),"Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return; }
    i++;
    java.util.List fileList=Arrays.asList(fp);
    addAttach(fileList);
    if(s.equals("Send"))
    try{
    if(toalias==null)
    dialog.showMessageDialog(client,"Select the Recepient First!!","Error:ChatApplication",JOptionPane.ERROR_MESSAGE);
    return;
    if(toalias!=null && togroup!=null && (!toalias.equals(fromalias)))
    // server.sendMessage(textArea1.getText(),files,toalias,togroup,fromalias,fromgroup);
    textArea1.setText("");
    catch(Exception e)
    e.printStackTrace();
    }//if ends
    class WindowEventHandler extends WindowAdapter{
    public void windowClosing(WindowEvent ev){
    try{
    //server.disconnect(client);
    client.getSound(3);
    // UnicastRemoteObject.unexportObject(client,true);
    catch(Exception e){System.out.println(e.toString());}
    dispose();
    private class onshutdown extends Thread{
    public void run(){
    try{
    //server.disconnect(client);
    //UnicastRemoteObject.unexportObject(client,true);
    catch(Exception e){}
    }//run ends
    I hope this helps,
    Denis

  • Im from Philippines one of our carriers here supports 4G already on selected areas, Im currently in the area where this carrier has 4G now, I couldnt see my phone on 4G signal. Can anybody give me an idea, why?

    Im from Philippines one of our carriers here supports 4G already on selected areas, Im currently in the area where this carrier has 4G now, I couldnt see my phone on 4G signal. Can anybody give me an idea, why?

    Here's why:
    The iPhone 4S does not support 4G.  Only the iPhone 5 does (of Apple's iPhones).
    Here's an iPhone comparison chart:
    http://www.apple.com/iphone/compare-iphones/

Maybe you are looking for

  • Error in external interactive activity redirection from workspace

    I'm not able to configure external interacitve activity in studio 6.0. Here what's done: -added activity, main task imlementation = external -assigned prepare(), commit() methods -added new server configuration When launching workspace, the > sign on

  • TS3451 Can't record keeps posting "DISK TO SLOW"

    Trying to record vocals in garage band, and Can't be as soon as I hit the record button posting appears saying DISK TOO SLOW. and then ask me to continue and there no recording.

  • What is missing?

    I've tried with two different cameras but this simple code does not work where could be the reason I got no image? private Component initVideo(){ try {   //gets a list of devices how support the given videoformat Vector deviceList = CaptureDeviceMana

  • SOA with E-business suite

    Hi, I want to know something about SOA, and if the same can be integrated with E-biz suite ? What would be the benefit of this ? Thx.

  • My iPod 5 won't take pictures

    my ipod 5 hasn't been letting me take pictures for a WHILE now. Probably about 2 months     its on my inner camera because when I bought my iPod it didn't even come with a back camera which I think is freaking stupid. I've tried everything! I'm done