Sending a value associated with a checkbox across a client/server connectio

Hello everyone,
I've been working on a coursework for uni which simulates a very simple pizza ordering system. I've built the GUI and got the prices to calculate in a single applet. I'm now required to advance my application to perform a client/server connection, and to to my limited knowledge of java, have stumped myself! Please can someone help. I need to take the value of the 5 chech boxes in the client GUI and pass them to the server, which needs to calculate the total and pass it back to the client to show in a text box. My code thus far is:
//client
import java.applet.Applet;
import java.awt.event.*;
import java.awt.*;
import java.io.*;
import java.net.*;
public class A3ClientClass_1 extends A4 {
     CheckboxGroup z;
     Checkbox tpizza, mpizza, ppizza, prpizza;
     Checkbox tomato, pepper, cheese, pepperoni, mushroom;
     String a = "";
     String b = "";
     TextField size, toppings, cost;
     double c;
Scrollbar xAxis, yAxis;
ScrollablePanel p;
public void init() {
          setBackground(Color.orange);
setLayout(new BorderLayout());
          Panel north = new Panel();
          north.add(new Label("SELECT THE PIZZA YOU WANT"));
          add(north, BorderLayout.NORTH);
          Panel outside = new Panel();
          outside.setBackground(Color.orange);
          z = new CheckboxGroup();
          tpizza = new Checkbox("Tomato Pizza", z, false);
          outside.add(tpizza);
          tpizza.addItemListener(this);
          mpizza = new Checkbox("Mushroom Pizza", z, false);
          outside.add(mpizza);
          mpizza.addItemListener(this);
          ppizza = new Checkbox("Pepper Pizza", z, false);
          outside.add(ppizza);
          ppizza.addItemListener(this);
          prpizza = new Checkbox("Pepperoni Pizza", z, false);
          outside.add(prpizza);
          prpizza.addItemListener(this);
          tomato = new Checkbox(" Tomatoes ");
          outside.add(tomato);
          tomato.addItemListener(this);
          pepper = new Checkbox(" Peppers ");
          outside.add(pepper);
          pepper.addItemListener(this);
          cheese = new Checkbox(" Cheese ");
          outside.add(cheese);
          cheese.addItemListener(this);
          pepperoni = new Checkbox(" Pepperoni ");
          outside.add(pepperoni);
          pepperoni.addItemListener(this);
          mushroom = new Checkbox(" Mushrooms");
          outside.add(mushroom);
          mushroom.addItemListener(this);
          size = new TextField(40);
          toppings = new TextField(40);
          cost = new TextField(40);
          outside.add(size);
          outside.add(toppings);
          outside.add(cost);
          tomato.disable();
          cheese.disable();
          pepper.disable();
          pepperoni.disable();
          mushroom.disable();
p = new ScrollablePanel(outside);
xAxis = new Scrollbar(Scrollbar.HORIZONTAL, 0, 50, 0, 100);
yAxis = new Scrollbar(Scrollbar.VERTICAL, 0, 50, 0, 100);
add("Center", p);
add("East", yAxis);
add("South", xAxis);
public boolean handleEvent(Event e) {
if (e.target instanceof Scrollbar) {
p.transxy(xAxis.getValue(), yAxis.getValue());
return true;
return super.handleEvent(e);
     public void itemStateChanged(ItemEvent e) {
          b = "";
          c = 0;
          if (tpizza.getState() == true) {
               a = tpizza.getLabel();
               c = c + 3.00;
               tomato.setState(true);
               cheese.setState(true);
               pepper.setState(false);
               pepperoni.setState(false);
               mushroom.setState(false);
          else if (mpizza.getState() == true) {
               a = mpizza.getLabel();
               c = c + 3.50;
               tomato.setState(false);
               cheese.setState(false);
               pepper.setState(false);
               pepperoni.setState(false);
               mushroom.setState(true);
          else if (ppizza.getState() == true) {
               a = ppizza.getLabel();
               c = c + 4.00;
               tomato.setState(false);
               cheese.setState(true);
               pepper.setState(true);
               pepperoni.setState(false);
               mushroom.setState(false);
          else if (prpizza.getState() == true) {
               a = prpizza.getLabel();
               c = c + 5.00;
               tomato.setState(false);
               cheese.setState(true);
               pepper.setState(false);
               pepperoni.setState(true);
               mushroom.setState(false);
          if (tomato.getState() == true) {
               b = b + tomato.getLabel() + " ";
               c = c + 0.25;
          if (pepper.getState() == true) {
               b = b + pepper.getLabel() + " ";
               c = c + 0.5;
          if (cheese.getState() == true) {
               b = b + cheese.getLabel() + " ";
               c = c + 0.5;
          if (pepperoni.getState() == true) {
               b = b + pepperoni.getLabel() + " ";
               c = c + 1.0;
          if (mushroom.getState() == true) {
               b = b + mushroom.getLabel() + " ";
               c = c + 0.5;
          size.setText("Pizza Type: " + a);
          toppings.setText("Toppings: " + b);
          cost.setText("Total: �" + c);
     try{
               Socket cts = new Socket(InetAddress.getLocalHost(), 6000);
               DataInputStream isfs = new DataInputStream(cts.getInputStream());
               DataOutputStream osts = new DataOutputStream(cts.getOutputStream());
               while(true) {
                    //code here
          catch (IOException e) {
                    System.out.println(e);
class ScrollablePanel extends Panel {
int transx = 0;
int transy = 0;
Panel outside;
public ScrollablePanel(Panel p) {
     setLayout(new BorderLayout());
     outside = p;
     add(outside);
public void transxy(int x, int y) {
transx = -x;
transy = -y;
     outside.move(transx, transy);
//Server
import java.io.*;
import java.net.*;
public class A3ServerClass_1 {
     public static void main(String[] args) {
          try
               ServerSocket ss = new ServerSocket(6000);
               Socket ssconnect = ss.accept();
               DataInputStream isfc = new DataInputStream(ctc.getInputStream());
               DataOutputStream ostc = new DataOutputStream(ctc.getOutputStream());
               while(true) {
//code here
          catch (IOException e) {
               System.out.println(e);
Thanks

Can't help ya there, I've never done socket programming. However, it comes up on these forums all the time. Try searching for some keywords about your problem.

Similar Messages

  • Forms.INS(72) No String value associated with this variable

    When I try to distribute my application I need to make sure that
    when my app installs it either adds or creates the environment
    variable Forms60_Path. This can be done in the project
    builder. When going through this one of the steps you have
    ability to add new environment variables. So I add on one named
    Forms60_Path with a value and contents of %PROD_HOME% and with
    the append set to yes.
    This now will give me either one or two errors when installing
    the application. The first error is that because i am choosing
    append set to yes it doesn't appear to be checking if the
    variable is already there or not. What it does do is give me a
    messages saying "A file not found while trying to translate
    Forms60_Path from '$Oracle' would u like to retry, ignore or
    process' I have choosen to process and the installer correctly
    adds the registry entry. That is a good thing but i still
    should not recieve an error when doing this it should check to
    see if the Reg entry is there if not then create it, if it is
    there then append to it. This only happens if you have append
    set to yes and the environment variable does not exist in the
    registry yet.
    The second error is more concerning because it just cancels out
    of the install all together. What it does no matter what under
    any circurmstance after you have added an environment variable
    in the delivery wizard is give u a message saying that
    "Form_Name.INS(72) No String Value associated with this
    variable" This error always comes up no matter what. After
    looking throught the INS file I took out the line
    "win32_register_map_variable(repl_var);" and I no longer
    recieved that error. My question is why do I get this error and
    what is the ramifications of taking this line out of the INS
    file?
    If no one else has had these problems I will be simply amazed!!!
    Thanks,
    Spencer Tabbert
    null

    Spencer,
    I am also getting the error you got months ago. (The second one: FORM.ins(72): No string value associated with this variable.) Can you tell me how you were able
    to fix it? I would appreciate it.
    I am new to Project Builder and pretty
    confused.
    Thanks,
    Monika

  • Can an email address be a member of an LDAP group even if it isn't associated with an object in the Directory Server?

    Can an email address be a member of an LDAP group even if it isn't
    associated with an object in the Directory Server?
    <P>
    General members of a group are the members defined in the
    Directory Server. They are full-fledged members of the group who
    may have a set of permissions associated with their membership,
    a title, or other attributes. Mail-specific users are users who
    are not full-fledged members of the group, but who receive mail
    sent to the group. Mail-specific users need not be identified as
    a user in the Directory Server--an email address is sufficient.
    An example of this is a group of salespeople, all of whom are in
    the group "North American Sales Team." They have access to a
    sales-tracking database, on-line quota information, and
    competitive information. The mail-specific users of this group
    are the admins who support the members of the sales team, who need
    to get the mail that goes out to the group, but don't need access
    to the applications and information that the salespeople do.

    Hey EllyK,
    Welcome to the BlackBerry Support Community Forums.
    Thanks for the question.
    I would suggest performing this workaround and then try to login to BlackBerry Link:
    Open BlackBerry World on the BlackBerry smartphone and sign in using the BlackBerry ID. 
    Connect the BlackBerry 10 smartphone to the computer. 
    Open BlackBerry Link
    Sign in using the BlackBerry ID. 
    Let me know if the issue still persists.
    Cheers.
    -ViciousFerret
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Like! for those who have helped you.
    Click  Accept as Solution for posts that have solved your issue(s)!

  • VC - Characterstics and Values associated with a Production Order

    Is there a way to get the variant configuration details (Characterstics and it's Values) related to a particular production order  which was created as a result of the selection of that component in the Super BOM.
    For. Ex   Let's  Say   Material A    has as super BOM containing components Material B, C, D, E
    Based on the Characterstics Values and Object dependencies Material B has been selected as the component that needs to be manufactured.
    Now i need to know dynamically the configuration values associated for the Production Order that got created for Material B.
    Something like i can pass the Production Order to some Function Module or something and get its characterstic values.
    Any thoughts or inputs is Greatly Appreciated.
    Best Regards,
    Bharat.

    Hi Mike,
    I remember your Inputs for my earlier VC Questions put in this forum back in April and Infact we made good progress based on your Great Inputs.
    However the scenario is somewhat different now,
    btw Guys, am trying to give a very detailed explanation below about the scenario, hence it might take a while to completely go through the details,  no offense -- Please be patient.
    to better explain,   We have a Multi-level Configuration Scenario.
    i.e   we are trying to follow a Top-fill model for one of our products i.e
    The Top-fill (like a wrapper )  will have two components blown in the Sales Order i.e
    Matnr A -- Top-fill 
    Matnr B - Configurable Component. 
    Matnr C - Non-Configurable Component.
    Matnr B is again a Multi-level Configurable  with configurable components i.e
    BOM of Matnr B looks like below,
    Matnr B  -- Configurable Component
    Matnr D - Configurable compoent
    Matnr D - Configurable component
    Matnr D - Configurable component
    Note: same Matnr D is repeated in the BOM  as the product structure  depends,
    and Finally this Matnr D has the actual Super BOM i.e
    --- Matnr D - Configurable compoent
    ActualComponent 1  - for which Prod. Order gets created
    Actual Component2  - for which Prod. Order gets created
    Actual Compoent 3    - for which Prod. Order gets created
    so if i explained it clearly you would understand that there is every possibility that sometimes based on the characterstic values chosen for Matnr D can endup choosing same ActualComponent.
    i.e let's say Customer has chosen certain characterstic values and based on the object dependencies it could end up something like below,
    --- Matnr A  -- Topfill          
    Matnr B - Configurble Material  
    MatnrD - Configurble material                                                       -                                                    -
    Actual Component 1
    MatnrD - Configurable material
    Actual Component 1
    MatnrD - Configurable material
    Actual Component 1
    since MatnrD and Actual Component 1 arent being blown in Sales Order but only in Configuration Results screen,  MatnrD OR Acutal Component 1 will not have any Reference Sales Order or Line Item.
    So when individual production orders get created for Actual Component 1's,  i have no idea which production order corresponds to which characterstic values of Matnr D. 
    I need to pass these characterstic values to Mfg. Systems.
    I know the above is quite complex but trying to find an Answer.
    I sincerely appreciate your Inputs.
    Please feel free to ask any Questions if you want some more clarifiction.
    Best Regards,
    Bharat.

  • How to change list of values associated with a field using Personalization?

    Hi,
    We are using the standard Oracle TeleSales ASTCDDTL.fmb form 12.0.6 version. In that form, a field called "Type of School" is associate with the look up "HZ_TYPE_OF_SCHOOL". Now we need to customize the field to list down our list of countries (list of countries through a query of value set). Is there any way in Form Personalization we can achieve this? i.e changing the already associated look up type to a query or a custom value set?
    Appreciate your help on this!
    Thanks!
    Nithya

    959061 wrote:
    Hi,
    We are using the standard Oracle TeleSales ASTCDDTL.fmb form 12.0.6 version. In that form, a field called "Type of School" is associate with the look up "HZ_TYPE_OF_SCHOOL". Now we need to customize the field to list down our list of countries (list of countries through a query of value set). Is there any way in Form Personalization we can achieve this? i.e changing the already associated look up type to a query or a custom value set?
    Appreciate your help on this!
    Thanks!
    NithyaPlease see old threads -- https://forums.oracle.com/forums/search.jspa?threadID=&q=LOV+AND+Personalization&objID=c3&dateRange=all&userID=&numResults=15&rankBy=10001
    Thanks,
    Hussein

  • Obtaining comma-separated list of text values associated with bitwise flag column

    In the table msdb.dbo.sysjobsteps, there is a [flags] column, which is a bit array with the following possible values:
    0: Overwrite output file
    2: Append to output file
    4: Write Transact-SQL job step output to step history
    8: Write log to table (overwrite existing history)
    16: Write log to table (append to existing history)
    32: Include step output in history
    64: Create a Windows event to use as a signal for the Cmd jobstep to abort
    I want to display a comma-separated list of the text values for a row. For example, if [flags] = 12, I want to display 'Write Transact-SQL job step output to step history, Write log to table (overwrite existing history)'.
    What is the most efficient way to accomplish this?

    Here is a query that gives the pattern:
    DECLARE @val int = 43
    ;WITH numbers AS (
       SELECT power(2, n) AS exp2 FROM (VALUES(0), (1), (2), (3), (4), (5), (6)) AS n(n)
    ), list(list) AS (
       SELECT
         (SELECT CASE WHEN exp2 = 1  THEN 'First flag'
                      WHEN exp2 = 2  THEN 'Flag 2'
                      WHEN exp2 = 4  THEN 'Third flag'
                      WHEN exp2 = 8  THEN 'IV Flag'
                      WHEN exp2 = 16 THEN 'Flag #5'
                      WHEN exp2 = 32 THEN 'Another flag'
                      WHEN exp2 = 64 THEN 'My lucky flag'
                 END + ', '
          FROM   numbers
          WHERE  exp2 & @val = exp2
          ORDER BY exp2
          FOR XML PATH(''), TYPE).value('.', 'nvarchar(MAX)')
    SELECT substring(list, 1, len(list) - 1)
    FROM   list
    Here I'm creating the numbers on the fly, but it is better to have a table of numbers in your database. It can be used in many places, see here for a short discussion:
    http://www.sommarskog.se/arrays-in-sql-2005.html#numbersasconcept
    (Only read down to the next header.)
    For FOR XML PATH thing is the somewhat obscure way we create concatenated lists. There is not really any using trying to explain how it works; it just works. The one thing to keep in mind is that it adds an extra comma at the end and the final query strips
    it off.
    This query does not handle that 0 has a special meaning - that is left as an exercise to the reader.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to set the Selectonechoice Value associated with MethodAction

    Hi All,
    I am using Jdeveloper 11.1.1.5 and i have a two textbox on my page and one selectonechoice.I am fetching the values from the Master Table in the dropdown by sending the supplierVatId and SupplierPostCode and the base dataSource of the selectonechoice is my transaction table(InvoiceHeaderTable).
    My jspx page source is :-
    <af:inputText value="#{bindings.Suppostcode.inputValue}"
    binding="#{backingBeanScope.backing_parkSupplierId.it7}"
    id="it7">
    </af:inputText>
    <af:inputText value="#{bindings.Suppvatid.inputValue}"
    binding="#{backingBeanScope.backing_parkSupplierId.it8}"
    id="it8">
    <f:validator binding="#{bindings.Suppvatid.validator}"/>
    </af:inputText>
    </af:panelFormLayout>
    <af:selectOneChoice value="#{bindings.supplierid.inputValue}"
    binding="#{GeneralManagedBean.suppid}"
    id="soc1">
    <f:selectItems value="#{bindings.supplierid.items}"
    binding="#{GeneralManagedBean.suppiditems}"
    id="si1"/>
    </af:selectOneChoice>
    and this is my pageDef code :-
    <attributeValues IterBinding="InvoiceheaderView1Iterator" id="Suppostcode">
    <AttrNames>
    <Item Value="Suppostcode"/>
    </AttrNames>
    </attributeValues>
    <attributeValues IterBinding="InvoiceheaderView1Iterator" id="Suppvatid">
    <AttrNames>
    <Item Value="Suppvatid"/>
    </AttrNames>
    </attributeValues>
    <methodAction id="getSupplierIdfromDB" RequiresUpdateModel="true"
    Action="invokeMethod" MethodName="getSupplierIdfromDB"
    IsViewObjectMethod="false" DataControl="SupplierDetailImpl"
    InstanceName="SupplierDetailImpl.dataProvider"
    ReturnName="data.SupplierDetailImpl.methodResults.getSupplierIdfromDB_SupplierDetailImpl_dataProvider_getSupplierIdfromDB_result">
    <NamedData NDName="supplierpostcode"
    NDValue="#{bindings.Suppostcode.inputValue}"
    NDType="java.lang.String"/>
    <NamedData NDName="suppliervatid"
    NDValue="#{bindings.Suppvatid.inputValue}"
    NDType="java.lang.String"/>
    </methodAction>
    <list IterBinding="InvoiceheaderView1Iterator" id="supplierid"
    DTSupportsMRU="true" StaticList="false"
    ListIter="getSupplierIdfromDBIterator">
    <AttrNames>
    <Item Value="Suppid"/>
    </AttrNames>
    <ListAttrNames>
    <Item Value="supplierid"/>
    </ListAttrNames>
    <ListDisplayAttrNames>
    <Item Value="supplierid"/>
    </ListDisplayAttrNames>
    </list>
    </bindings>
    And i have a button on the page called as "Clear DropDown".Now on click of Clear DropDown button  i need to clear the dropdown list and need to set a new value in the SupplierId selectonechoice.For the testing purpose it can be a static value like "Shah".
    I am trying to do like this but no help ..
    public String clearDropDown() {
    ValueExpression suppid1 = null;
    String id = "Shah";
    suppid1 =
    elFactory.createValueExpression(elContext, "#{bindings.supplierid.attributeValue}",
    Object.class);
    suppid1.setValue(elContext,id);
    AdfFacesContext.getCurrentInstance().addPartialTarget(suppid);
    AdfFacesContext.getCurrentInstance().addPartialTarget(suppiditems);
    return null;
    Please suggest!!!
    Regards,
    Shah

    While setting the value, it is giving me this warning in the logs :-
    *<FacesCtrlListBinding> <getInputValue> ADFv: Could not find selected item matching value Shah of type: java.lang.String in the list-of-values*.
    I know that the Shah is not present in the List but how do i clear the list and set the New Value which is "Shah".
    Please Suggest!!
    Regards,
    Shah

  • Issue to send email (using sp_send_dbmail) with an attachement located in other server within the same network

    I have two servers. One is for databases (DB) with the mail server configured and the other is for SSIS without mail server. Both servers are in the same network. On the SSIS server the SSIS package exports data from the DB server table
    to xls file. The file is saved in SSIS server. When I created a task to send the email (using sp_send_dbmail) to attach that file, I got the error message:
    Error: Executing the query "EXECUTE [msdb].[dbo].[sp_send_dbmail]
     @profile_na..." failed with the following error: "Attachment file H:\test.xls is invalid.".
    Any help will be appreciated. Thanks.
    A Fan of SSIS, SSRS and SSAS

    Where are you running this?
    If its in the other server (DB) you need to use UNC path to the SSIS server folder where file resides
    Also the executing account should have access to the folder as well as the file. So If you're running this from a job make sure you either provider folder and file access to sql agent job service account or create a separate proxy account with the required
    permissions and configure the job to use the account
    see
    http://www.databasejournal.com/features/mssql/article.php/3789881/Proxy-Accounts-in-SQL-Server.htm
    http://www.codeproject.com/Articles/28918/SQL-Server-Agent-Proxy
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Need combobox with a Jtable to view client & server files

    Hellow Everybody,
    I am quite new to Java, although I have experience with other
    programming languages.
    I have searched for tutorials, code, examples etc. but have not found
    much that can help me so far. I am a BCA student & I am appearing for my last year exams. I studied about various Java programs in my course and I decided to make a Swing based FTP Server. Although I not expert in Java , but I have learnt the network programming very much clearly, and that�s why by the help these I wrote a program but it not complete. I have given the program below.
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Cursor;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.event.WindowListener;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.StringTokenizer;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JPasswordField;
    import javax.swing.JProgressBar;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    import javax.swing.border.BevelBorder;
    import javax.swing.border.EmptyBorder;
    import sun.net.TelnetInputStream;
    import sun.net.ftp.FtpClient;
    public class Client extends JFrame {
    public static int BUFFER_SIZE = 10240;
    protected JTextField userNameTextField = new JTextField("anonymous");
    protected JPasswordField passwordTextField = new JPasswordField(10);
    protected JTextField urlTextField = new JTextField(20);
    protected JTextField fileTextField = new JTextField(10);
    protected JTextArea monitorTextArea = new JTextArea(5, 20);
    protected JProgressBar m_progress = new JProgressBar();
    protected JButton putButton = new JButton("Upload <<");
    protected JButton getButton;
    protected JButton fileButton = new JButton("File");
    protected JButton closeButton = new JButton("Close");
    protected JFileChooser fileChooser = new JFileChooser();
    protected FtpClient ftpClient;
    protected String localFileName;
    protected String remoteFileName;
    public Client() {
    super("FTP Client");
    JPanel p = new JPanel();
    p.setBorder(new EmptyBorder(5, 5, 5, 5));
    p.add(new JLabel("User name:"));
    p.add(userNameTextField);
    p.add(new JLabel("Password:"));
    p.add(passwordTextField);
    p.add(new JLabel("URL:"));
    p.add(urlTextField);
    p.add(new JLabel("File:"));
    p.add(fileTextField);
    monitorTextArea.setEditable(false);
    JScrollPane ps = new JScrollPane(monitorTextArea);
    p.add(ps);
    m_progress.setStringPainted(true);
    m_progress.setBorder(new BevelBorder(BevelBorder.LOWERED, Color.white,
    Color.gray));
    m_progress.setMinimum(0);
    JPanel p1 = new JPanel(new BorderLayout());
    p1.add(m_progress, BorderLayout.CENTER);
    p.add(p1);
    ActionListener lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (connect()) {
    Thread uploader = new Thread() {
    public void run() {
    putFile();
    disconnect();
    uploader.start();
    putButton.addActionListener(lst);
    putButton.setMnemonic('U');
    p.add(putButton);
    getButton = new JButton("Download >>");
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (connect()) {
    Thread downloader = new Thread() {
    public void run() {
    getFile();
    disconnect();
    downloader.start();
    getButton.addActionListener(lst);
    getButton.setMnemonic('D');
    p.add(getButton);
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (fileChooser.showSaveDialog(Client.this) != JFileChooser.APPROVE_OPTION)
    return;
    File f = fileChooser.getSelectedFile();
    fileTextField.setText(f.getPath());
    fileButton.addActionListener(lst);
    fileButton.setMnemonic('f');
    p.add(fileButton);
    lst = new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    if (ftpClient != null)
    disconnect();
    else
    System.exit(0);
    closeButton.addActionListener(lst);
    closeButton.setDefaultCapable(true);
    closeButton.setMnemonic('g');
    p.add(closeButton);
    getContentPane().add(p, BorderLayout.CENTER);
    fileChooser.setCurrentDirectory(new File("."));
    fileChooser
    .setApproveButtonToolTipText("Select file for upload/download");
    WindowListener wndCloser = new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    disconnect();
    System.exit(0);
    addWindowListener(wndCloser);
    setSize(720, 240);
    setVisible(true);
    public void setButtonStates(boolean state) {
    putButton.setEnabled(state);
    getButton.setEnabled(state);
    fileButton.setEnabled(state);
    protected boolean connect() {
    monitorTextArea.setText("");
    setButtonStates(false);
    closeButton.setText("Cancel");
    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    String user = userNameTextField.getText();
    if (user.length() == 0) {
    setMessage("Please enter user name");
    setButtonStates(true);
    return false;
    String password = new String(passwordTextField.getPassword());
    String sUrl = urlTextField.getText();
    if (sUrl.length() == 0) {
    setMessage("Please enter URL");
    setButtonStates(true);
    return false;
    localFileName = fileTextField.getText();
    // Parse URL
    int index = sUrl.indexOf("//");
    if (index >= 0)
    sUrl = sUrl.substring(index + 2);
    index = sUrl.indexOf("/");
    String host = sUrl.substring(0, index);
    sUrl = sUrl.substring(index + 1);
    String sDir = "";
    index = sUrl.lastIndexOf("/");
    if (index >= 0) {
    sDir = sUrl.substring(0, index);
    sUrl = sUrl.substring(index + 1);
    remoteFileName = sUrl;
    try {
    setMessage("Connecting to host " + host);
    ftpClient = new FtpClient(host);
    ftpClient.login(user, password);
    setMessage("User " + user + " login OK");
    setMessage(ftpClient.welcomeMsg);
    ftpClient.cd(sDir);
    setMessage("Directory: " + sDir);
    ftpClient.binary();
    return true;
    } catch (Exception ex) {
    setMessage("Error: " + ex.toString());
    setButtonStates(true);
    return false;
    protected void disconnect() {
    if (ftpClient != null) {
    try {
    ftpClient.closeServer();
    } catch (IOException ex) {
    ftpClient = null;
    Runnable runner = new Runnable() {
    public void run() {
    m_progress.setValue(0);
    putButton.setEnabled(true);
    getButton.setEnabled(true);
    fileButton.setEnabled(true);
    closeButton.setText("Close");
    Client.this.setCursor(Cursor
    .getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    SwingUtilities.invokeLater(runner);
    protected void getFile() {
    if (localFileName.length() == 0) {
    localFileName = remoteFileName;
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    fileTextField.setText(localFileName);
    byte[] buffer = new byte[BUFFER_SIZE];
    try {
    int size = getFileSize(ftpClient, remoteFileName);
    if (size > 0) {
    setMessage("File " + remoteFileName + ": " + size + " bytes");
    setProgressMaximum(size);
    } else
    setMessage("File " + remoteFileName + ": size unknown");
    FileOutputStream out = new FileOutputStream(localFileName);
    InputStream in = ftpClient.get(remoteFileName);
    int counter = 0;
    while (true) {
    int bytes = in.read(buffer);
    if (bytes < 0)
    break;
    out.write(buffer, 0, bytes);
    counter += bytes;
    if (size > 0) {
    setProgressValue(counter);
    int proc = (int) Math
    .round(m_progress.getPercentComplete() * 100);
    setProgressString(proc + " %");
    } else {
    int kb = counter / 1024;
    setProgressString(kb + " KB");
    out.close();
    in.close();
    } catch (Exception ex) {
    setMessage("Error: " + ex.toString());
    protected void putFile() {
    if (localFileName.length() == 0) {
    setMessage("Please enter file name");
    byte[] buffer = new byte[BUFFER_SIZE];
    try {
    File f = new File(localFileName);
    int size = (int) f.length();
    setMessage("File " + localFileName + ": " + size + " bytes");
    setProgressMaximum(size);
    FileInputStream in = new FileInputStream(localFileName);
    OutputStream out = ftpClient.put(remoteFileName);
    int counter = 0;
    while (true) {
    int bytes = in.read(buffer);
    if (bytes < 0)
    break;
    out.write(buffer, 0, bytes);
    counter += bytes;
    setProgressValue(counter);
    int proc = (int) Math
    .round(m_progress.getPercentComplete() * 100);
    setProgressString(proc + " %");
    out.close();
    in.close();
    } catch (Exception ex) {
    setMessage("Error: " + ex.toString());
    protected void setMessage(final String str) {
    if (str != null) {
    Runnable runner = new Runnable() {
    public void run() {
    monitorTextArea.append(str + '\n');
    monitorTextArea.repaint();
    SwingUtilities.invokeLater(runner);
    protected void setProgressValue(final int value) {
    Runnable runner = new Runnable() {
    public void run() {
    m_progress.setValue(value);
    SwingUtilities.invokeLater(runner);
    protected void setProgressMaximum(final int value) {
    Runnable runner = new Runnable() {
    public void run() {
    m_progress.setMaximum(value);
    SwingUtilities.invokeLater(runner);
    protected void setProgressString(final String string) {
    Runnable runner = new Runnable() {
    public void run() {
    m_progress.setString(string);
    SwingUtilities.invokeLater(runner);
    public static int getFileSize(FtpClient client, String fileName)
    throws IOException {
    TelnetInputStream lst = client.list();
    String str = "";
    fileName = fileName.toLowerCase();
    while (true) {
    int c = lst.read();
    char ch = (char) c;
    if (c < 0 || ch == '\n') {
    str = str.toLowerCase();
    if (str.indexOf(fileName) >= 0) {
    StringTokenizer tk = new StringTokenizer(str);
    int index = 0;
    while (tk.hasMoreTokens()) {
    String token = tk.nextToken();
    if (index == 4)
    try {
    return Integer.parseInt(token);
    } catch (NumberFormatException ex) {
    return -1;
    index++;
    str = "";
    if (c <= 0)
    break;
    str += ch;
    return -1;
    public static void main(String argv[]) {
    new Client();
    The above given code is not yet complete. I want some specific features to be implemented in this code that is given below.
    1.     A login Gridlayout or Borderlayout & within it the username & password textfield.
    2.     When the username and password will request to server and if it will success then the textfields of the username & password have to be disable.
    3 . Two Combobox. One will give client directories and files and another
    will give the server directories and files.
    4 . Below the Combobox two JTable will be given & the tables wll show the
    client and server directories and files.
    Could anybody give me the codes that I want. If anybody check this code please help me????
    With Regards,
    DILLU

    Well Mr Michael_Dunn,
    Thanks for responding my query. First of all I would like to tell that
    this FTP server is going to be my project and that's why I am submmiting my question. I told in my points that I want a Jcombobox & a JTable for displaying that files & directories. whenever I set the directories in the combobox the files will be displayed in the JTable
    I hope you understand my point

  • Deploying Oracle Forms with Plss and dlls in Client/Server

    Hi,
    I have a form application which has two plls libraries attached to it - d2kwutil.pll and d2kcomn.pll and one dll - d2kwutil.dll. All these libraries are necssary for the app to work. The issue come when I am trying to deploy them in different environments like dev,test,qa,prod. The users access the forms applications from a shared drive and all the users have forms runtime client installed on their local machines.
    If I just post my fmx in the shared drive it doesn't work as its unable to find the plls and the dll. I will really appreciate if someone can provide some feedback on this. How this should be done so that we can place these plls and dll in central location without chaning the paths etc.
    Thanks

    Oracle Application Server Release 3 can not be used to deploy forms and reports.
    If you want forms and reports you need to stay on Oracle Application Server 10g Release 2

  • Problem with entries from the ical client/server

    Hi together,
    I have the problem that my events are not longer visible in the ical-client of my assistant and I also can not see the events from her. Also I can not see this/my entries on the other clients (iphone, ipad).
    When I add an entry to my calendar on mac Book an then I look the the calendar in the wiki (to have a look on the server local) I can not see my calendar-entries there. So they are not written down. But why?
    In the log I find a lot of this entries:
    127.0.0.1 - "user as xxb" 08/Nov/2010:10:11:58 +0200 "REPORT(CalDAV:calendar-query) /calendars/_uids_/wiki-xxb/calendar/ HTTP/1.1" 207 65 "https://www.xxxx.ch/groups/xxb/" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12" i=8012 t=131.9 or=1 responses=0
    and:
    2010-11-08 09:56:29+0100 [-] caldav-8009 [-] http://twistedcaldav.method.propfind#error Error reading property ('DAV:', 'current-user-privilege-set') for resource /calendars/_uids_/wiki-xxb/calendar/: <StatusResponse 401 Access denied while reading property {DAV:}current-user-privilege-set.>
    and:
    2010-11-08 09:56:52+0100 [-] mailgateway 2010-11-08 09:56:52+0100 IMAP4DownloadProtocol,client http://twistedcaldav.mail.IMAP4DownloadProtocol#error IMAP login failed for icaladmin
    Does someone have an idea what the problem may be?
    It worked fine till the begin of last week - I can not remember to change something in this time.
    Thanks
    Marco

    COH-571 is corrected in the 3.2 pre-release. See:
    http://wiki.tangosol.com/display/COH32UG/Release+Notes
    Sorry for the inconvenience :) .. if you prefer a patch for 3.1 or 3.1.1, it will still be available from support at Tangosol.
    Peace.

  • All I want to do is get the value associated..

    All I want to do is get the value associated with a dropdown item...
    1. I have a combo box
    2. It has text values that you can click
    3. The text values have export values associated with it
    4. When I click a text value from the list, I want to get the numeric value associated with it
    Example combo box:
    "Orange" has the export value of "1234"
    When I click "orange" I want to get the export value "1234" and alert it to the screen
    I'm using javascript, here's what I have so far:
    In the combo box properties I have the following validation script:
    theFruitClicked();
    I have a function in the document javascript:
    function theFruitClicked()
         app.alert(event.value);
    This is alerting the text value not the export value.
    What else should I do to get the export value?
    Thank You.

    You may need the scripting forum http://forums.adobe.com/community/acrobat

  • Links associated with a table of names/ids

    Is there a better way to do this in faces?
    My page has a table of names, I wish to associate a modify/delete actions with each one, allowing the user to just click say the modify link on one and end up in a page to modify that entry. I ended up generate the links as something like:
    <table>
    <tr>
    <h:form>
    <input name="scoutId" type="hidden" value="${scoutBean.scoutId}"/>
    <h:commandLink action="#{scoutListActionBean.doModify}" value="Modify Scout"/>
    </h:form>
    </td>
    <td>
    <h:form>
    <input name="scoutId" type="hidden" value="${scoutBean.scoutId}"/>
    <h:commandLink action="#{scoutListActionBean.doRemove}" value="Remove Scout"/>
    </h:form>
    </tr>
    </table>
    Then in my action routine, I find the value associated with the request paramter "scoutId" to prepopulate the next modify/delete page.
    This seemed pretty clumsy to me, anybody got a better way?

    Yes. Try DBA_TRIGGER_COLS (or the USER, ALL variants)
    APC

  • Slow email send/receive for user associated with beehiveonline

    It takes hours to send/receive an email to/from the user associated with my beehiveonline workspace. Also, the number of emails that we receive has decreased, it may be not related at all, but there is no way for me to check if that's just due to low customer activity or to timeouts.

    Hi,
    If you have issues then let us know the date/time of the issue and the degree of delay you are seeeing and we can check if there may be a reason for the delay.
    Phil

  • Have multiple devices associated with one Apple ID: iPod Touch and Ipad Mini stopped sending/receiving iMessages and FaceTime all of a sudden

    This is the listing of what we have:
    Ipod Touch 4th Gen for daughter
    Ipod Touch 5th Gen for another daughter
    Ipad 3
    Ipad Mini
    Iphone 4S
    Iphone 4S
    For sharing/downloading convenience, all of these are linked to one apple ID. iMessage and FaceTime were working flowlessly when we set it up. Yes, there was a problem initially where some devices were receiving someone else's texts, but they were resolved when I went to Settings and chose a specific # or email address for each DEVICE (so there's no overlapping)
    All of a sudden, my daughter's Ipod Touch 4th Gen started having problems sending messges. Sending bar will go up to the end then stop right before it gets completely full--end result, message not delivered. I tried to facetime her, but nothing happens. Sometimes when I try facetiming ipod touch 4th, I'd get an error message '____ is not available for FaceTime'
    I've confirmed the email address associated with ipod Touch 4 has been added and verified under my apple ID. I've tried restoring the iPod in iTunes, hard resetting the unit, turning off and on iMessage/FaceTime... and still doesn't work.
    All our software is up to date. By the time I started thinking maybe ipod touch 4th gen is getting old, my husband's newly bought ipad MINI started having the same problem.
    This is really frustrating---help?

    We're screwwwwwed! Not THAT familiar to apple, just barely plugging along and dove in with two ipads and two ipod touches. Previous experience was just two ipods (160 GB) that I had to still rotate audio books out of every few months... well, for me. My wife doesn't use hers as much. ANYWAY, I lost a zillion things with the ipod classic since it didn't have a back-up option and many of the CDs I scrounged up when it first came out were already lucky to have survived college. 8 years later and the computer that had the original files had been replaced umpteen times. ipods failed and decided to quit being a tight wad. Not sure if these gifts are worth it yet.... well, two of them were.

Maybe you are looking for

  • Wrong business area assigned to the company code

    Hi All , I am getting error " Wrong business area assigned to the company code  " while posting a document in F- 02 please advise

  • Cannot print to Hp Laserjet P1102 after Mavericks update

    Help...

  • Facing troubles with "requestFocus()"

    Hi Can anyone help me telling what is wrong with my code?. I hv 2 JTextFields and both will hv their values checked when losing focus. My problem is that a MessageDialog is showed telling what's wrong for the user, but then when ok button is clicked,

  • Exchange difference on invoice posting

    Hi experts, Warehouse has done GR for material and system has generated the following transaction. Inventory Dr.  Rs. 10,000 GR/IR a/c Cr.  Rs. 10,000 When finance posted the invoice system generated following transaction based on less foreign curren

  • Show Hide Layers - Can't do "onmouseout"

    I'm trying to do a show/hide layers on an image map hot spot. I select the <area> tag from the hotspot, and can set the show layer "onmouseover" but it won't let me set the hide layer for "onmouseout". In fact when I try to set the "onmouseout", dw j