Need help on coding

Hi everyone!
currently i am doing a match making project (networking). my project is almost done, the only problem left is on the clientView side which when either button clicked, it will hang the program if char is input on the age text field. i am only managed to show a "not funny" msg when the input is in negative. hope any kind soul can help mi on the coding which will give an error msg and will not hang the program if a char or float is input on the text field. thks in advance:)
ServerModel.java
import java.net.*;
import java.io.*;
import java.util.*;
public class ServerModel
     public static void main(String[] args)
          new ServerModel();
     ServerView sv = new ServerView();
     public ServerModel()
          try
               ServerSocket ss = new ServerSocket(8000);
               sv.jtaLog.append("Server Started .. waiting for Client\n");
               System.out.println("Server started .. waiting for Client");
               int clientNo = 1;
               while(true)
                    Socket connectToClient = ss.accept();
                    // Print the connected client number on the console
                    System.out.println("Start thread for client " + clientNo);
                    //Create a new thread for connection
                    HandleClient thread = new HandleClient(connectToClient);
                    sv.jtaLog.append("Client "+clientNo+" connected!!!\n");
                    //Start thread
                    thread.start();     
                    // Increment clientNo
          clientNo++;               
          catch(IOException e){
               sv.jtaLog.append("Server started already! \n"+e);
     class HandleClient extends Thread
          private Socket connectToClient;
          public HandleClient(Socket socket)
               connectToClient = socket;
          //Run the thread
          public void run()
               try
                    BufferedReader brFromClient = new BufferedReader(new InputStreamReader(connectToClient.getInputStream()));                    
                    PrintWriter pwToClient = new PrintWriter(connectToClient.getOutputStream(),true);
                    while(true)
                         String btn = brFromClient.readLine();     // read which button clicked
                         if(btn.equals("Register"))
                              // recieve 4 name, age , gender, country from client                              
                              String name = brFromClient.readLine();     
     int age = Integer.parseInt(brFromClient.readLine());//READ LINE FROM CLIENT N ASSIGN TO NAME               
     String gender = brFromClient.readLine();     
     String country = brFromClient.readLine();
     if (age<=0)
     pwToClient.println("Not funny");      
     else {
     sv.jtaLog.append("New customer registered!!\n"+name+"\n"+age+"\n"+gender+"\n"+country+"\n");
     PrintWriter bw = new PrintWriter(new FileWriter("Candidate.txt", true)); //write into text file
     //String success = name+"#"+age+"#"+gender+"#"+country+;
     bw.println(name+"#"+age+"#"+gender+"#"+country);//write on candidate.txt
                         //BufferedReader brFile = new BufferedReader(new FileReader("Candidate.txt"));
                         //String msg0;
                         //while((msg0= brFile.readLine())!=null)
                         //bw.println(success);
                         bw.close();
                         pwToClient.println("Registered successfully!!");
                         }     // end if
                         else {
                              int countFound=0;
                              BufferedReader brFile = new BufferedReader(new FileReader("Candidate.txt"));//READ FROM .TXT
                         int age = Integer.parseInt(brFromClient.readLine());//READ LINE FROM CLIENT N ASSIGN TO NAME
                              String gender = brFromClient.readLine();
                              String country = brFromClient.readLine();
                              String msg1;//ASSIGN TO MSG
                         while((msg1= brFile.readLine())!=null)
                         pwToClient.println("Continue Search");      
                              StringTokenizer st = new StringTokenizer(msg1,"#");
                              String nameT= st.nextToken();//BREAK N ASSIGN
               int ageT= Integer.parseInt(st.nextToken());
               String genderT= st.nextToken();
                    String countryT= st.nextToken();     
                              if((age == ageT) && gender.equals(genderT) && country.equals(countryT))
                         pwToClient.println("Found");     
                         pwToClient.println(nameT);
                         pwToClient.println(ageT);
                         pwToClient.println(genderT);
                         pwToClient.println(countryT);
                         countFound++;
                         sv.jtaLog.append("Customer searching for...\n"+age+"\n"+gender+"\n"+country+"\n");
                         else
                              pwToClient.println("Not Found Yet");
          }// end while
               pwToClient.println("End Search");
               if (countFound==0)
               pwToClient.println("Record Not Found");
               else
               pwToClient.println("Total Records Found: "+countFound);
                         }     // end else
                         }     // end while
               }catch (NumberFormatException e) {}
               catch (IOException ex) {}
clientView.java
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class ClientView extends JApplet
private JLabel jlblName = new JLabel("Name: (For Register only)");
private JLabel jlblAge = new JLabel("Age: ");
private JLabel jlblGender = new JLabel("Gender: ");
private JLabel jlblCountry = new JLabel("Country: ");
private JLabel jlbl = new JLabel("Online Match Make", JLabel.CENTER);
private JComboBox jcboGender = new JComboBox();
private JComboBox jcboCountry = new JComboBox();
private JTextField tfName = new JTextField(6);
private JTextField tfAge = new JTextField(2);
private JTextArea jta = new JTextArea(10,5);
private JButton btnSubmit = new JButton ("Submit");
private JButton btnRegister = new JButton ("Register");
private JButton btnClear = new JButton ("Clear");
private ClientModel cm=new ClientModel();
private String s1 ="F";
private String s2 ="Singapore";
public void init()
     setLayout(new GridLayout(4,1,5,5));
     JPanel jp = new JPanel();
     jp.setLayout(new GridLayout(1,1));
jp.add(jlbl);
JPanel jp1 = new JPanel();
//add(new JLabel("Online Match Make", JLabel.CENTER),BorderLayout.NORTH);
//jp1.add(new JLabel("Online Match Make", JLabel.CENTER),BorderLayout.NORTH);
jp1.setLayout(new GridLayout(4,2,5,5));
jp1.add(jlblName);
jp1.add(tfName);
tfName.setEditable(false);
tfName.setText("");
jp1.add(jlblAge);
jp1.add(tfAge);
jp1.add(jlblGender);
jp1.add(jcboGender);
jcboGender.addItem("F");
     jcboGender.addItem("M");
     jp1.add(jlblCountry);
jp1.add(jcboCountry);
jcboCountry.addItem("Singapore");
     jcboCountry.addItem("Malaysia");
     jcboCountry.addItem("Hong Kong");
     JPanel jp2 = new JPanel();
jp2.setLayout(new GridLayout(1,3,20,20));
jp2.add(btnSubmit);
jp2.add(btnRegister);
jp2.add(btnClear);
JPanel jp3 = new JPanel();
jp3.setLayout(new GridLayout(1,1,10,10));
jp3.add(new JScrollPane(jta));
//jp1.add(jta);
               jlblName.setForeground(Color.RED);
                    jlblAge.setForeground(Color.BLUE);
                    jlblGender.setForeground(Color.BLUE);
                    jlblCountry.setForeground(Color.BLUE);
add(jp);
add(jp1);
add(jp2);
add(jp3);
btnSubmit.addActionListener(new Submit());
btnRegister.addActionListener(new Register());
btnClear.addActionListener(new Clear());
     class Submit implements ActionListener
          public void actionPerformed(ActionEvent e)
          {     // tells the server Submit button is clicked
          String result="";String endOfSearch="";
               cm.sendToServer("Submit");
                         // sends age, gender, country to server
               cm.sendToServer(tfAge.getText());
     cm.sendToServer(s1);
               cm.sendToServer(s2);
               s1= (String)jcboGender.getSelectedItem();
     s2= (String)jcboCountry.getSelectedItem();
               // gets result from server
                    while (true){
                    endOfSearch= cm.getFromServer(); //pwToClient.println("Continue Search");
                    if (endOfSearch.equals("End Search")) break;
                    result= cm.getFromServer();
               if (result.equals("Found"))
                    String name = cm.getFromServer();
                    String age= cm.getFromServer();
                    String gender= cm.getFromServer();
                    String country= cm.getFromServer();
               jta.append("Found"+"\n");
                    jta.append("Name: "+name+"\n");
                    jta.append("Age: "+age+"\n");
                    jta.append("Gender: "+gender+"\n");
                    jta.append("Country: "+country+"\n");
               }//end while
                    jta.append(cm.getFromServer()+"\n");
     }//end of submit
     public class Clear implements ActionListener
               public void actionPerformed(ActionEvent e)
                    /*Clearing TextFields*/
                    tfName.setText("");
                    tfAge.setText("");
                    jta.setText("");
     public class Register implements ActionListener
               public void actionPerformed(ActionEvent e)
               {     // tells the server Register button is clicked
                    jlblName.setForeground(Color.RED);
                    jlblAge.setForeground(Color.RED);
jlblGender.setForeground(Color.RED);
jlblCountry.setForeground(Color.RED);
                    if(tfName.getText().equals(""))
                    tfName.setEditable(true);
                    tfAge.setText("");
                    jta.setText("");
                    jta.append("Pls enter both Name & Age\n");
                    else
                    if (tfAge.getText().equals(""))
                         jta.append("Pls enter age\n");
                    else{
                    cm.sendToServer("Register");
                    // sends name, age, gender, country to server
                    cm.sendToServer(tfName.getText());
                    cm.sendToServer(tfAge.getText());
                    s1= (String)jcboGender.getSelectedItem();
               s2= (String)jcboCountry.getSelectedItem();
          cm.sendToServer(s1);
                    cm.sendToServer(s2);
                    String msg = cm.getFromServer();
                    if (msg.equals("Not funny"))
                         jta.append("Not funny");
                    else{
                    jta.setText("");
                    jta.append("Registered successfully!!");
                    tfName.setText("");
                    tfName.setEditable(false);
                    jlblName.setForeground(Color.RED);
                    jlblAge.setForeground(Color.BLUE);
                    jlblGender.setForeground(Color.BLUE);
                    jlblCountry.setForeground(Color.BLUE);     
Message was edited by:
aces1799

jus shut up if u dont wanna help. i only asked for
the part which i do not know, not the whole
program,OK?!! hope at least some guide from anyone
here, i am in the process of learning not listening
to your nonsense!Yes sir. Problem for you is, that everyone else is probably shutting up too.
Um, good luck with that sir.
P.S. Will it be another 12 hours or so before you come back with another snappy retort?

Similar Messages

  • Need help with coding for HTML5 Video with Flash fallback

    Hello, need help with my coding in Dreamweaver CS5.5 for HTML5 video with Flash fallback. Not sure if the coding is correct. Do I need anything else Javascipt etc?

    The reason you see a blank page is because it's trying to load the file that is pretty humungous and there is no preloader. So, you see a white screen till it complets loading.
    Also, the reason why its loading a SWF file and not any of HTML5 type video is because your doctype declaration is XHTML1.0 and not HTML5.
    Change the 1st line in your .html file from:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    to:
    <!DOCTYPE html>
    Then see if your HTML5 video types load with <video> tag.

  • Need help in coding

    hi,
    i have a problem in this coding.it is only the part of coding.
    declare
    TYPE invhdr1 IS RECORD (
    customer_trx_id NUMBER,
    trx_number VARCHAR2(20),
    trx_date DATE,
    bill_to_customer_id NUMBER,
    remit_to_address_id NUMBER,
    term_id NUMBER,
    bill_to_site_use_id NUMBER,
    primary_salesrep_id NUMBER,
    interface_header_context VARCHAR2(40),
    cust_trx_type_id NUMBER);
    invhdr invhdr1;
    TYPE inv_rec1 is REF CURSOR RETURN invhdr1;
    inv_rec inv_rec1;
    begin
    if ((p_date is null) and ((p_trx_type is null) or (p_trx_type is not null))) then
    OPEN inv_rec
    FOR select
    r.customer_trx_id customer_trx_id,
    r.trx_number trx_number,
    r.trx_date trx_date,
    r.bill_to_customer_id bill_to_customer_id,
    r.remit_to_address_id remit_to_address_id,
    r.term_id term_id,
    r.bill_to_site_use_id bill_to_site_use_id,
    r.primary_salesrep_id primary_salesrep_id,
    r.interface_header_context interface_header_context,
    r.cust_trx_type_id cust_trx_type_id
    from ra_customer_trx_all r
    where (
    (nvl(r.interface_header_context,'X')=nvl(p_context_new,nvl(r.interface_header_context,'X')))OR
    (nvl(r.interface_header_context,'X')=nvl(p_context_new_oe,nvl(r.interface_header_context,'X')))
    and r.trx_number >= p_trx_from
    and r.trx_number <=p_trx_to
    order by r.trx_number;
    end if;
    loop
    FETCH inv_rec INTO invhdr;
    --EXIT   WHEN inv_rec%NOTFOUND ;
    if inv_rec%notfound then
    dbms_output.put_line('No Selection made for the parameters passed') ;
    dbms_output.put_line('Cursor Name '||v_cursor) ;
         gresult := fnd_concurrent.set_completion_status ('WARNING','*** No Selection made for the parameters passed');
    return ;
    EXIT;
    end if;
    end loop;
    end ;
    here
    if inv_rec%notfound then
    end if;
    even if record exists for the cursor it is passing in side the if condition.iam using cursor variable here.
    i don't want to use exit when%notfound condition ,because i want to use
    fnd_concurrent.set_completion_status ('WARNING','*** No Selection made for the parameters passed');
    return ;
    for this exit condition.If someone can help me out.It is an urgent .
    thanks,
    vr.

    I don't think you can do it exactly as you want. An alternative is to select a separate count of the same query you will use in your ref cursor and check for 0. Please see the modification of your code below.
    declare
      TYPE invhdr1 IS RECORD (
      customer_trx_id NUMBER,
      trx_number VARCHAR2(20),
      trx_date DATE,
      bill_to_customer_id NUMBER,
      remit_to_address_id NUMBER,
      term_id NUMBER,
      bill_to_site_use_id NUMBER,
      primary_salesrep_id NUMBER,
      interface_header_context VARCHAR2(40),
      cust_trx_type_id NUMBER);
      invhdr invhdr1;
      TYPE inv_rec1 is REF CURSOR RETURN invhdr1;
      inv_rec inv_rec1;
      v_count NUMBER := 0;
    begin
      if ((p_date is null) and ((p_trx_type is null) or (p_trx_type is not null))) then
        SELECT COUNT(*) INTO v_count FROM
        (select
         r.customer_trx_id customer_trx_id,
         r.trx_number trx_number,
         r.trx_date trx_date,
         r.bill_to_customer_id bill_to_customer_id,
         r.remit_to_address_id remit_to_address_id,
         r.term_id term_id,
         r.bill_to_site_use_id bill_to_site_use_id,
         r.primary_salesrep_id primary_salesrep_id,
         r.interface_header_context interface_header_context,
         r.cust_trx_type_id cust_trx_type_id
         from ra_customer_trx_all r
         where (
         (nvl(r.interface_header_context,'X')=nvl(p_context_new,nvl(r.interface_header_context,'X')))OR
         (nvl(r.interface_header_context,'X')=nvl(p_context_new_oe,nvl(r.interface_header_context,'X')))
         and r.trx_number >= p_trx_from
         and r.trx_number <=p_trx_to);
        IF v_count = 0 THEN
          dbms_output.put_line('No Selection made for the parameters passed') ;
          dbms_output.put_line('Cursor Name '||v_cursor) ;
          gresult := fnd_concurrent.set_completion_status ('WARNING','*** No Selection made for the parameters passed');
          EXIT;
        end if;
        OPEN inv_rec
        FOR select
        r.customer_trx_id customer_trx_id,
        r.trx_number trx_number,
        r.trx_date trx_date,
        r.bill_to_customer_id bill_to_customer_id,
        r.remit_to_address_id remit_to_address_id,
        r.term_id term_id,
        r.bill_to_site_use_id bill_to_site_use_id,
        r.primary_salesrep_id primary_salesrep_id,
        r.interface_header_context interface_header_context,
        r.cust_trx_type_id cust_trx_type_id
        from ra_customer_trx_all r
        where (
        (nvl(r.interface_header_context,'X')=nvl(p_context_new,nvl(r.interface_header_context,'X')))OR
        (nvl(r.interface_header_context,'X')=nvl(p_context_new_oe,nvl(r.interface_header_context,'X')))
        and r.trx_number >= p_trx_from
        and r.trx_number <=p_trx_to
        order by r.trx_number;
      end if;
      loop
        FETCH inv_rec INTO invhdr;
        EXIT WHEN inv_rec%NOTFOUND ;
      end loop;
    end;

  • Need help with coding

    Hi
    I created a Flash photo gallery in Photoshop CS2, but when I go to load the page the following page comes up first:
    It asks me to upgrade my Flash Player. Followed by a line saying: Already have Flash Player. Click here if you already have Flash Player 6 installed.
    Hit the link and there is my gallery.
    I'm hoping there is a simple bit of code that needs deleting.  I have enclosed the code from the flashobject.js file, does anyone know what needs tweaking to resolve this issue?
    Thanks
    * FlashObject embed
    * by Geoff Stearns ([email protected], http://www.choppingblock.com/)
    * v1.0.7 - 11-17-2004
    * Create and write a flash movie to the page, includes detection
    * Usage:
    *    myFlash = new FlashObject("path/to/swf.swf", "swfid", "width", "height", flashversion, "backgroundcolor");
    *    myFlash.addParam("wmode", "transparent");                     // optional
    *    myFlash.addVariable("varname1", "varvalue");                  // optional
    *    myFlash.addVariable("varname2", getQueryParamValue("myvar")); // optional
    *    myFlash.write();
    FlashObject = function(swf, id, w, h, ver, c) {
        this.swf = swf;
        this.id = id;
        this.width = w;
        this.height = h;
        this.version = ver || 6; // default to 6
        this.align = "middle"; // default to middle
        this.redirect = "";
        this.sq = document.location.search.split("?")[1] || "";
        this.altTxt = "Please <a href='http://www.macromedia.com/go/getflashplayer'>upgrade your Flash Player</a>.";
        this.bypassTxt = "<p>Already have Flash Player? <a href='?detectflash=false&"+ this.sq +"'>Click here if you have Flash Player "+ this.version +" installed</a>.</p>";
        this.params = new Object();
        this.variables = new Object();
        if (c) this.color = this.addParam('bgcolor', c);
        this.addParam('quality', 'high'); // default to high
        this.doDetect = getQueryParamValue('detectflash');
    FlashObject.prototype.addParam = function(name, value) {
        this.params[name] = value;
    FlashObject.prototype.getParams = function() {
        return this.params;
    FlashObject.prototype.getParam = function(name) {
        return this.params[name];
    FlashObject.prototype.addVariable = function(name, value) {
        this.variables[name] = value;
    FlashObject.prototype.getVariable = function(name) {
        return this.variables[name];
    FlashObject.prototype.getVariables = function() {
        return this.variables;
    FlashObject.prototype.getParamTags = function() {
        var paramTags = "";
        for (var param in this.getParams()) {
            paramTags += '<param name="' + param + '" value="' + this.getParam(param) + '" />';
        if (paramTags == "") {
            paramTags = null;
        return paramTags;
    FlashObject.prototype.getHTML = function() {
        var flashHTML = "";
        if (window.ActiveXObject && navigator.userAgent.indexOf('Mac') == -1) { // PC IE
            flashHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '">';
            flashHTML += '<param name="movie" value="' + this.swf + '" />';
            if (this.getParamTags() != null) {
                flashHTML += this.getParamTags();
            if (this.getVariablePairs() != null) {
                flashHTML += '<param name="flashVars" value="' + this.getVariablePairs() + '" />';
            flashHTML += '</object>';
        else { // Everyone else
            flashHTML += '<embed type="application/x-shockwave-flash" src="' + this.swf + '" width="' + this.width + '" height="' + this.height + '" id="' + this.id + '" align="' + this.align + '"';
            for (var param in this.getParams()) {
                flashHTML += ' ' + param + '="' + this.getParam(param) + '"';
            if (this.getVariablePairs() != null) {
                flashHTML += ' flashVars="' + this.getVariablePairs() + '"';
            flashHTML += '></embed>';
        return flashHTML;   
    FlashObject.prototype.getVariablePairs = function() {
        var variablePairs = new Array();
        for (var name in this.getVariables()) {
            variablePairs.push(name + "=" + escape(this.getVariable(name)));
        if (variablePairs.length > 0) {
            return variablePairs.join("&");
        else {
            return null;
    FlashObject.prototype.write = function(elementId) {
        if(detectFlash(this.version) || this.doDetect=='false') {
            if (elementId) {
                document.getElementById(elementId).innerHTML = this.getHTML();
            } else {
                document.write(this.getHTML());
        } else {
            if (this.redirect != "") {
                document.location.replace(this.redirect);
            } else {
                if (elementId) {
                    document.getElementById(elementId).innerHTML = this.altTxt +""+ this.bypassTxt;
                } else {
                    document.write(this.altTxt +""+ this.bypassTxt);
    function getFlashVersion() {
        var flashversion = 0;
        if (navigator.plugins && navigator.plugins.length) {
            var x = navigator.plugins["Shockwave Flash"];
            if(x){
                if (x.description) {
                    var y = x.description;
                       flashversion = y.charAt(y.indexOf('.')-1);
        } else {
            result = false;
            for(var i = 15; i >= 3 && result != true; i--){
                   execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
                   flashversion = i;
        return flashversion;
    function detectFlash(ver) {   
        if (getFlashVersion() >= ver) {
            return true;
        } else {
            return false;
    // get value of querystring param
    function getQueryParamValue(param) {
        var q = document.location.search;
        var detectIndex = q.indexOf(param);
        var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
        if(q.length > 1 && detectIndex != -1) {
            return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
        } else {
            return "";
    /* add Array.push if needed */
    if(Array.prototype.push == null){
        Array.prototype.push = function(item){
            this[this.length] = item;
            return this.length;

    i'm getting the same error.  please help!  thanks.

  • Urgent - Need help on Coding in Forms

    I created a Master/Detail form. I now wish to create a field to display the sum total of a Detail field.
    I wrote a loop in a Program Unit which has the count upto last_record (Restricted Built-in) but cannot use this call from a Post Query due to Forms' limitation of not using a Restricted Built-in/Procedure in a Pre/Post trigger.
    I also cannot use the call to the Program Unit in a Key-ExeQry trigger as Oracle Apps. has the Ctrl+F11 key for Execute Query. Since the form is built for query purpose for now, I wish to display the totals upon Execute Query.
    Where can I make the call for this Program Unit or what code do I need to write and where in order to display the total upon Execute Query.
    Any help would be greatly appreciated.

    hi,
    sorry to hurt you. Sometimes you can solve a problem in forms without writing any code
    create a field with number datatype
    in the property pallette
    calculation mode = summary
    summary function = sum
    summarized field = <name of the field of which you want a sum>
    Set the block level property
    Query all records = yes
    now ctrl + r
    F8
    HTH
    vinayak
    (if you want the test form that i created for you you can mail me)
    null

  • Need help for coding and designing

    Hi All,
    Problem Statement
    A financial institution is in the verge of automating their existing “customer data management” system. Currently they are maintaining their
    customer data in a comma separated file (CSV) format. You, as a software consultant have been requested to create a system that is flexible,
    extensible and maintainable. Your proposed system should also take care of moving the data from the old system to the new one.
    Customer has following specific requirements
    1.This is an internal offline application and need not be a web based solution
    2.The new application should be cost effective
    3.The application should have good response time as compared to the ones suggested by other vendors
    4.Phase 1 work should concentrate mainly on building a simple system which moves the data from CSV to the new one and display the
    moved data on the screen.
    Sample CSV file containing customer data
    <first name>, <age>, <pan number>, <date of registration>
    Ramesh, 28, JWSLP1987, 30/01/2006
    Rajesh, 32, POCVT2087, 23/10/2005
    Shankar, 39, TRYUP3945, 24/7/2003
    Shyam, 45 BLIWP5612, 15/3/2004
    Requirements for coding DOJO
    •Ensure that your solution is built around open source frameworks and tools to avoid licensing issues. (Ex: Eclipse, MySQL, etc)
    •Please give me any idea to write code for this issue.
    Thank you.
    Edited by: user636482 on Oct 28, 2008 2:03 AM

    The first requirement is to NOT use software like "Oracle".
    The specifications are to use a CSV file as the "data source". The case asks you to "move" the data from CSV to "the new one" and display the moved data.
    So this sounds more like a data load routine -- but not to load into Oracle.
    You are in the wrong forum.

  • Need help with coding: getting an error

    Hi there everyone, this would be my first post here, and my first post on any forum related to programming. Im taking a highschool computer science course, in which we are learning J2SE. I have read ahead a bit, and am having trouble with the following program:
    //=============================================================================
    //Converts US Dollars To Euros
    //=============================================================================
    public class currencyconverter1
         private Double dollarRate = 1.00000;
         private Double conversionRate = 1.22990;
         private Double dollarAmount = 0.0;
         private Double euroAmount = 0.0;
              public static void main convert Double(euroAmount)
                   dollarAmount = euroAmount*conversionRate;
                   System.out.println(dollarAmount);
                   return euroAmount
                   }JCreator is telling me I need a '(' on the "main" line. I simply cannot find where this is needed. Can anyone help, or recommend another forum where I may find some help? Thanks in advance!

    Thanks for the reply... I tested out your code, and it didn't compile, so after playing with it, heres what I got to compile (please read past the code):
    public class currencyconverter1
         private Double dollarRate = 1.00000;
         private Double conversionRate = 1.22990;
         private Double dollarAmount = 0.0;
         private Double euroAmount = 0.0;
         public Double convert (Double euroAmount)
              dollarAmount = euroAmount * conversionRate;
              System.out.println(dollarAmount);
              return euroAmount;
    }It gives me the following message when I execute the .exe: "Exception in thread "main" Java.Lang.NoSuchMethodError: Main" ....
    Does anyone know what the deal is and can explain wnat my source code error is? Thanks again in advance.

  • I need help with coding

    public void run()
           System.out.println(
                "What is the difference between a\' and a \"?");
            System.out.println(
                "Or between a\" and a \\\"?");
            System.out.println(
                 "One is what we see  when we\'re typing our program.");
            System.out.println(
                "The other is what appears on the \"console.\"");{code}
    If i run this, it would come out to be
    What is the difference between a' and a "?
    Or between a" and a \"?
    One is what we see  when we're typing our program.
    The other is what appears on the "console."
    I want it to be
    What is the difference between a' and a "?
    Or between a" and a \"?
    One is what we see  when we're typing our program.
    The other is what appears on the "console."
    like that.
    Can someone help me with this? this is my first time using java.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    misterjohnvu wrote:
    public void run()
           System.out.println(
    "What is the difference between a\' and a \"?");
    System.out.println(
    "Or between a\" and a \\\"?");you will need to print a line after those two lines
    {code}
    System.out.println(
    "What is the difference between a\' and a \"?");
    System.out.println(
    "Or between a\" and a \\\"?");
    System.out.println();
    System.out.println(
    "One is what we see when we\'re typing our program.");
    System.out.println(
    "The other is what appears on the \"console.\"");

  • HI GURUS NEED HELP in CODING in SAP SCRIPT

    Hi Gurus,
    here i hav some complication for displaying data in output of a sap script form .In output I have to show characteristics(ysd-characteristics,,,, ysd is a customized tablehaving fields vbeln, matnr, posnr, characteristics......) of material with respect to sales document number(vbap-vbeln).
    I am  below SELECT statement for arry fetching----
    select distinct
    ysd~vbeln
    ysdposnr ysdmatnr
    ysd~characteristic
    vbapposnr vbapmatnr
    vbap~arktx
    vbap~kwmeng
    into corresponding fields of table itab1
    from ysd_famd_chrctcs as ysd inner join vbap
    on ysdvbeln = vbapvbeln
    and ysdposnr = vbapposnr
    where vbap~vbeln = p_vbeln.
    For data to be write in the form's output im using below code
    LOOP AT itab1.
    PERFORM write_form USING 'ITEM_LINE' 'SET' 'BODY' 'MAIN'.
      ENDLOOP.
    using perform write_form i am calling function module " WRITE_FORM" for script.
    After looping itab1 it is giving output like below.
    -->>
    Sr | MatNum | MatDesc | Charecteristics | Quantity
    no |              |                |                       |
    1 | 00000012 | CCslab | Moisture | 50
    1 | 00000012 | CCslab | over size | 50
    1 | 00000012 | CCslab | under size | 50
    1 | 00000012 | CCslab | phos percnt | 50
    1 | 00000012 | CCslab | chrome | 50
    1 | 00000012 | CCslab | Ferrous | 50
    but I want the output should be like below
    -->>
    Sr | MatNum | MatDesc | Charecteristics | Quantity
    no |              |               |                        |
    1 | 00000012 | CCslab | Moisture     | 50
    over size
    under size
    phos percnt
    chrome
    Ferrous
    I tried using DELETE ADJACENT after PERFORM write_form USING 'ITEM_LINE' 'SET' 'BODY' 'MAIN'....... but it is deletin all characteristics from output.
    I tried using below format ->>>
    At new arktx
    PERFORM write_form USING 'ITEM_LINE' 'SET' 'BODY' 'MAIN'.
    ENDAT.
    but it is keeping data upto arktx sfter that it is showing "*********" for characteristic field and all other remaining field.
    I want to know what approach i should use before/after PERFORM write_form USING 'ITEM_LINE' 'SET' 'BODY' 'MAIN'.
    to get my output like above
    pls help...
    Regard
    Saifur rahaman

    Thnx all for your kind co operation
    i hav solved this problem just adding following code before ferform write_form using '' 'SET' 'BODY' 'MAIN'
    DATA : lv_matnr LIKE mara-matnr.
      DATA : itab2 LIKE itab1 OCCURS 0 WITH HEADER LINE .
      DATA : itab3 LIKE itab1 OCCURS 0 WITH HEADER LINE .
      DATA : index TYPE sy-index .
      LOOP AT itab1 .
        AT NEW matnr .
          APPEND itab1 TO itab2 .
        ENDAT .
      ENDLOOP .
      LOOP AT itab2 .
        READ TABLE itab1 WITH KEY matnr = itab2-matnr .
        IF sy-subrc = 0 .
          index = sy-tabix .
          index = index + 1 .
          APPEND itab1 TO itab3 .
          LOOP AT itab1 FROM index .
            IF itab1-matnr <> itab2-matnr .
              EXIT .
            ENDIF .
            CLEAR :  itab1-posnr ,
              itab1-matnr ,
              itab1-arktx ,
              itab1-kwmeng .
            APPEND itab1 TO itab3 .
          ENDLOOP .
        ENDIF .
      ENDLOOP .
      REFRESH : itab1 .
      itab1[] = itab3[] .
      LOOP AT itab1.
        PERFORM write_form USING 'ITEM_HEADER' 'SET' 'TOP' 'MAIN'.
        SHIFT itab1-posnr LEFT DELETING LEADING '0'.
        PERFORM write_form USING 'ITEM_LINE' 'SET' 'BODY' 'MAIN'.
      ENDLOOP.

  • Need help in GUI

    I need help in coding for GUI
    I have created 4 classes which are car, car4sale,dealer and the GUI.
    in dealer class I have created a hash table and I want my data to be stored in this hash table can any one help me plz
    my GUI should be build on text field.
    But I don't know how can I link the GUI to the classes.
    this is the GUI but not complete.
    package Carsale;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    class Button extends JFrame implements ActionListener {
    private JButton button;
    private JTextField textField;
    public static void main(String[] args){
    Button frame = new Button();
    frame.setSize(400,300);
    frame.createGUI();
    frame.show();
    private void createGUI(){
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    Container window = getContentPane();
    window.setLayout(new FlowLayout());
    button = new JButton("VRN");
    window.add(button);
    button.addActionListener(this);
    textField = new JTextField(10);
    window.add(textField);
    public void actionPerformed(ActionEvent event) {
    textField.setText("Button clicked");
    }

    In the future, Swing related questions should be posted in the Swing forum.
    Your question does not have enough information to help you. We can't write a GUI for you. You need to write your own and then ask a specific question when you have a problem.
    Start by reading the [url http://java.sun.com/docs/books/tutorial/uiswing/TOC.html]Swing Tutorial which has lots of examples of creating simple GUIs.
    If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the posted code retains its original formatting.

  • Hi need help..very urgent..

    Hi ABAPers,
    I am very new to ABAP..i need help in coding this following logic,,,
    Can anyone help me in coding this following logic..
    Step 1.  Retrieve customer number KUNNR from VBAK
    Step 2.  Pass customer number KUNNR to KNA1 and retrieve address number-ADANR value
    Step 3.  Pass ADANR value to ADRC table to retrieve NAME3
    Please do reply guys..
    full marks would be given for the right answer.
    Regards
    Sahil

    If Windows Live Mail can export the mailboxes in .mbox format then they can be imported into Mail. Otherwise, you would need to export the accounts to Thunderbird, Netscape, or Office Entourage in order to directly import into Mail.

  • Need help with transfer routine.

    I am doing this enhancement in BW 3.5 version.
    There is an object in ODS - > ZPATHNM (Pathname)
    It gets data from ZPTDIR object.
    Now, 0MATERIAL infoobject has text data. For PATH type materials it has descriptions like pt/dat/fafg.2.0 , pt/dat/ovg.2c ... so on.
    The content after pt/dat/ for example fafq.2.0, ovg.2c is available in ODS object ZPATHNM (Pathname)
    Since I have to extract PATH material numbers. So I created another object ZPATHMAT and mapping it to ZPTDIR.
    I have to write a transfer routine when the 0MATERIAL text description had description beginning with pt/dat/ and the text after pt/dat/ is equal to data in ZPATHNM. i should get material number in ZPATHMAT.
    This is the transfer routine, I have written between ZPATHMAT  and ZPTDIR . This is working fine.
    Data : ZDIRNAM type String,
                ZCONT1 type string,
                ZCONT2 type string,
                ZMATERIAL(18) type C.
    ZDIRNAM = TRAN_STRUCTURE-ZPTDIR.
    IF ZDIRNAM is not Initial.
    Concatenate 'pt/dat/' ZDIRNAM into ZCONT1.
      Select single MATERIAL
        into ZMATERIAL from /BI0/TMATERIAL
    where TXTMD = ZCONT1.
    RESULT = ZMATERIAL.
      ENDIF.
    Now there is another requirement, where I have to create one more object, ZPATHDES. This object should get Material description for path type materials from 0PROD_HIER text table.
    This object, 0PROD_HIER is an attribute of 0MATERIAL.
    So the logic to get the material description into ZPATHDES, is when the material number in 0MATERIAL is equal to material number in  ZPATHMAT (generated from above routine), I should get description (TXTMD) from text table of 0PROD_HIER (/BI0/TPROD_HIER) into this ZPATHDES object.
    I able not to connect this logic in the code and it is throwing errors.
    I need help in coding.
    Thanks.

    Very hard to understand the logic in a thread. Can you please write your code, which is throwing errors? May be that will help us.
    Regards
    amandeep sharma

  • Need help in writing coding in HTML?

    HI All
    I have requirement like this.
    1st RFC i pass Plant and i will get trasportation point.
    in display template i need to display trasportation point in dropdown box and user will select the trasportation point and iam passing this trasportation  to aother RFC and gettting shipment cost.
    i need help in how to write coding in .IRPT
    i created the transactions for both the RFC and its working fine.First RFC iam getting trasportaion point ...i created Xecute query.
    I need how to display !st one in dropdown box and pass that data into 2nd RFC.
    Regards,
    Phani

    Phani,
    You have to use the iBrowser displaytemplate.
    Map the transportion point Xacute qquery in iBrowser displaytemplate.
    In code use : 
    document.APP1.getBrowserObject().getSelectedItem();
    Store the value of above code in a variable.
    And pass this variable in other appalet which displays the R/3 details as below:
    document.APP2.getQueryObject().setParam(1,var);
    document.APP2.refresh();
    -Suresh

  • Help needed - Advanced Chart Coding

    Hi all,
    I am currently developing some charts that have to be coded as wizard is not enough for this. Any idea where to find some advanced chart coding for using random colors for bars and adding values on top of bars, etc.
    This is my current code that I need to extend:
    chart:
    <Graph depthAngle="50" depthRadius="8" pieDepth="30" pieTilt="20" seriesEffect="SE_AUTO_GRADIENT" graphType="BAR_VERT_CLUST">
    <LegendArea visible="true" />
    <LocalGridData colCount="3" rowCount="1"><RowLabels>
    <MarkerText visible="true" markerTextPlace="MTP_CENTER"/>
    <Label>Number of Hours</Label>
    </RowLabels>
    <ColLabels>
    <xsl:for-each select="current-group()" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:if test="../@name='Hours_Demand_Daily'or ../@name='Hours_Scheduled_Daily' or ../@name='Hours_Budget_Daily'">
    <Label>
    <xsl:value-of select="translate(../@name,'_',' ')"/>
    </Label>
    </xsl:if>
    </xsl:for-each>
    </ColLabels>
    <DataValues>
    <RowData>
    <xsl:for-each select="current-group()" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:if test="../@name='Hours_Demand_Daily'or ../@name='Hours_Scheduled_Daily' or ../@name='Hours_Budget_Daily'">
    <Cell>
    <xsl:value-of select="ows:Quantity"/>
    </Cell>
    </xsl:if>
    </xsl:for-each>
    </RowData>
    </DataValues>
    </LocalGridData>
    </Graph>

    To add color<SeriesItems>
    <Series id="0" color="#ffcc00"/>
    <Series id="1" color="#ff6600"/>
    </SeriesItems>Add the series as how many needed in it.
    refer Re: Need help to create BAR chart with two sets of data
    To add, the value on top of the bar
    <MarkerText visible="true">
    <Y1ViewFormat>
    <ViewFormat numberType="NUMTYPE_GENERAL" numberTypeUsed="true"  />
    </Y1ViewFormat>
    </MarkerText>

  • Need help in doing coding

    how to attach a file? i need to do coding for my user interface subject. my file in pdf format.

    >
    how to attach a file? >Here? Don't.
    >
    ..i need to do coding for my user interface subject. my file in pdf format.>I don't understand. Perhaps you are:
    - Making software to do email, and asking how to attach a PDF to an email message.
    - Expecting to dump a PDF describing your project to this forum and get someone to complete it for you.
    Can you clarify?

Maybe you are looking for

  • No error, just doesn't transfer purchases.

    I keep trying to transfer my purchases from my iPad to my computer for backup and the iPad says "Sync in Progress" and iTunes shows the names of the items and acts like it is working through them but nothing actually transfers. Other than the items n

  • Replacing a audio file and locking it to the video to allow editing

    I used a gopro for an incar vid and an external "zoom H2" recorder for sound. How do I delete the gopro sound and replace with the new audio? I have the gopro audio muted and the new audio file in sync and behind the clip but now need to  lock it to

  • Can We Create Custom Dimension ontop of BI Infocube

    Hello Guys, I need help on below questions. i appreciate all your help in advance. Can we create Custom Dimension ontop of SAP BI Infocube ? Does it support all functions like SQL and ORACLE database supports ? Can any body have list what kind of fun

  • IDOC error while receiving

    Hi Friends, In my scenario, I have to receive P.O. message from partner in to my R/3 system. I am using PI 7.1 When partner is sending me message I am getting error , "Only asynchronous processing supported for IDoc adapter outbound processg" in SXMB

  • Packet per packet load sharing

    hi, my question: i have two routers which are connected over two links (same type, same speed). now i want to change from per destination to per packet load-sharing. i know there is the command "ip load-shar per packet" but my question: must i use th