How to use clear field options?

I am having trouble figuring out what to do with this else statement error.........I can't seem to see where I am going wrong...............can anyone help?
Program Name:     Transfer
import java.io.*;
import java.awt.*;
import java.awt.event.*;
public class Transfer extends Frame implements ActionListener
DataOutputStream output;
//Construct components
Panel dataFields = new Panel();
Panel firstRow = new Panel();
Panel secondRow = new Panel();
Panel thirdRow = new Panel();
Panel fourthRow = new Panel();
Panel buttonArea = new Panel();
Button submit = new Button("Submit");
Button exit = new Button("Exit");
Label firstNameLabel = new Label("Name:");
TextField firstName = new TextField(15);
Label studentIdLabel = new Label("Student ID:");
TextField studentId = new TextField(15);
Label transferCourseLabel = new Label("Transfer Course Number:");
TextField transferCourse = new TextField (15);
Label localCourseLabel = new Label("Local Course Number:");
TextField localCourses = new TextField (15);
public static void main(String args[])
Transfer window = new Transfer();
window.setTitle("Transfer Course Substitutions");
window.setSize(450, 250);
window.setVisible(true);
public Transfer()
//set backgound and layout managers
setBackground(Color.magenta);
setLayout(new BorderLayout());
dataFields.setLayout(new GridLayout(4,2));
FlowLayout rowSetup = new FlowLayout(FlowLayout.LEFT,4,2);
firstRow.setLayout(rowSetup);
secondRow.setLayout(rowSetup);
thirdRow.setLayout(rowSetup);
fourthRow.setLayout(rowSetup);
buttonArea.setLayout(new FlowLayout());
//Add fields to rows
firstRow.add(firstNameLabel);
secondRow.add(studentIdLabel);
thirdRow.add(transferCourseLabel);
fourthRow.add(localCourseLabel);
//Add rows to panel
dataFields.add(firstRow);
dataFields.add(secondRow);
dataFields.add(thirdRow);
dataFields.add(fourthRow);
//Add buttons to panel
buttonArea.add(submit);
buttonArea.add(exit);
//Add panels to frame
add(dataFields, BorderLayout.NORTH);
add(buttonArea, BorderLayout.SOUTH);
//Add functionality to buttons
submit.addActionListener(this);
exit.addActionListener(this);
// output states
try
output = new DataOuputStream(new FileOUtputStream("Transfer.dat"));
catch(IOException ex)
System.exit(1);
//construct window listener
addWindowListener(
new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
public void actionPerformed(ActionEvent e)
String arg = e.getActionCommand();
if (arg == "Submit")
try
output.writeUTF(code);
output.writeUTF(firstName.getText());
output.writeUTF(studentId.getText());
output.writeUTF(transferCourse.getText());
output.writeUTF(localCourse.getText());
catch(IOException ex)
System.exit(1);
clearFields();
else //code to execute if the user clicks Exit
try
output.close();
catch(IOException c)
System.exit(1);
System.exit(0);
public void clearFields()
firstName.setText("");
studentId.setText("");
transferCourse.setText("");
localCourse.setText("");
firstName.requestFocus();

This is the actual error I am getting.........................now that I look at it, it is with the else statement but I am still having trouble fixing it.........
***********************************ERROR***********************
A:\>javac Transfer.java
Transfer.java:143: Type expected.
else //code to execute if the user clicks Exit
^
1 error
*********************************************************this is the program below********************
Program Name:     Transfer
import java.io.*;
import java.awt.*;
import java.awt.event.*;
public class Transfer extends Frame implements ActionListener
DataOutputStream output;
//Construct components
Panel dataFields = new Panel();
Panel firstRow = new Panel();
Panel secondRow = new Panel();
Panel thirdRow = new Panel();
Panel fourthRow = new Panel();
Panel buttonArea = new Panel();
Button submit = new Button("Submit");
Button exit = new Button("Exit");
Label firstNameLabel = new Label("Name:");
TextField firstName = new TextField(15);
Label studentIdLabel = new Label("Student ID:");
TextField studentId = new TextField(15);
Label transferCourseLabel = new Label("Transfer Course Number:");
TextField transferCourse = new TextField (15);
Label localCourseLabel = new Label("Local Course Number:");
TextField localCourses = new TextField (15);
public static void main(String args[])
Transfer window = new Transfer();
window.setTitle("Transfer Course Substitutions");
window.setSize(450, 250);
window.setVisible(true);
public Transfer()
//set backgound and layout managers
setBackground(Color.magenta);
setLayout(new BorderLayout());
dataFields.setLayout(new GridLayout(4,2));
FlowLayout rowSetup = new FlowLayout(FlowLayout.LEFT,4,2);
firstRow.setLayout(rowSetup);
secondRow.setLayout(rowSetup);
thirdRow.setLayout(rowSetup);
fourthRow.setLayout(rowSetup);
buttonArea.setLayout(new FlowLayout());
//Add fields to rows
firstRow.add(firstNameLabel);
secondRow.add(studentIdLabel);
thirdRow.add(transferCourseLabel);
fourthRow.add(localCourseLabel);
//Add rows to panel
dataFields.add(firstRow);
dataFields.add(secondRow);
dataFields.add(thirdRow);
dataFields.add(fourthRow);
//Add buttons to panel
buttonArea.add(submit);
buttonArea.add(exit);
//Add panels to frame
add(dataFields, BorderLayout.NORTH);
add(buttonArea, BorderLayout.SOUTH);
//Add functionality to buttons
submit.addActionListener(this);
exit.addActionListener(this);
// output states
try
output = new DataOuputStream(new FileOUtputStream("Transfer.dat"));
catch(IOException ex)
System.exit(1);
//construct window listener
addWindowListener(
new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
public void actionPerformed(ActionEvent e)
String arg = e.getActionCommand();
if (arg == "Submit")
try
output.writeUTF(code);
output.writeUTF(firstName.getText());
output.writeUTF(studentId.getText());
output.writeUTF(transferCourse.getText());
output.writeUTF(localCourse.getText());
catch(IOException ex)
System.exit(1);
clearFields();
else //code to execute if the user clicks Exit
try
output.close();
catch(IOException c)
System.exit(1);
System.exit(0);
public void clearFields()
firstName.setText("");
studentId.setText("");
transferCourse.setText("");
localCourse.setText("");
firstName.requestFocus();

Similar Messages

  • How to use drill down option in Crystal Report

    Dear all,
            I want to know how to use drill down option in Crystal report 2008.  In below i have explained my screnario
    For example
       My scenario is.  In crystal report I have Purchase order like PO101,PO102.  Each purchase order have 5 line items.  If i drill down each purchase order it should display line item in crystal report. 
    Regards,
    Baskaran.

    hi,
    Create a Group on 'Purchase order'.
    Group Expert -> Select the Purchase Order and Click the arrow button such that it appears right side. Click ok.
    GH1 is inserted.
    Your detail section should include 'Line items' fields.
    Right Click 'Detail' section on left hand side,  Click 'Hide (Drill down Ok)'.
    Now you will see only 'Purchase order's in Group Headers.
    Now when you click on a particular order, you will see respective line items.
    Regards,
    Vamsee

  • How to use the print option for photos?

    How to use the print option for photos.  I have a wireless printer but how do I set it up?

    http://www.apple.com/support/iphone/assistant/airprint/

  • [Forum FAQ] How to use multiple field terminators in BULK INSERT or BCP command line

    Introduction
    Some people want to know if we can have multiple field terminators in BULK INSERT or BCP commands, and how to implement multiple field terminators in BULK INSERT or BCP commands.
    Solution
    For character data fields, optional terminating characters allow you to mark the end of each field in a data file with a field terminator, as well as the end of each row with a row terminator. If a terminator character occurs within the data, it is interpreted
    as a terminator, not as data, and the data after that character is interpreted and belongs to the next field or record. I have done a test, if you use BULK INSERT or BCP commands and set the multiple field terminators, you can refer to the following command.
    In Windows command line,
    bcp <Databasename.schema.tablename> out “<path>” –c –t –r –T
    For example, you can export data from the Department table with bcp command and use the comma and colon (,:) as one field terminator.
    bcp AdventureWorks.HumanResources.Department out C:\myDepartment.txt -c -t ,: -r \n –T
    The txt file as follows:
    However, if you want to bcp by using multiple field terminators the same as the following command, which will still use the last terminator defined by default.
    bcp AdventureWorks.HumanResources.Department in C:\myDepartment.txt -c -t , -r \n -t: –T
    The txt file as follows:
    When multiple field terminators means multiple fields, you use the below comma separated format,
    column1,,column2,,,column3
    In this occasion, you only separate 3 fields (column1, column2 and column3). In fact, after testing, there will be 6 fields here. That is the significance of a field terminator (comma in this case).
    Meanwhile, using BULK INSERT to import the data of the data file into the SQL table, if you specify terminator for BULK import, you can only set multiple characters as one terminator in the BULK INSERT statement.
    USE <testdatabase>;
    GO
    BULK INSERT <your table> FROM ‘<Path>’
     WITH (
    DATAFILETYPE = ' char/native/ widechar /widenative',
     FIELDTERMINATOR = ' field_terminator',
    For example, using BULK INSERT to import the data of C:\myDepartment.txt data file into the DepartmentTest table, the field terminator (,:) must be declared in the statement.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,:’,
    The new table contains like as follows:  
    We could not declare multiple field terminators (, and :) in the Query statement,  as the following format, a duplicate error will occur.
    In SQL Server Management Studio Query Editor:
    BULK INSERT AdventureWorks.HumanResources.DepartmentTest FROM ‘C:\myDepartment.txt’
     WITH (
    DATAFILETYPE = ‘char',
    FIELDTERMINATOR = ‘,’,
    FIELDTERMINATOR = ‘:’
    However, if you want to use a data file with fewer or more fields, we can implement via setting extra field length to 0 for fewer fields or omitting or skipping more fields during the bulk copy procedure.  
    More Information
    For more information about filed terminators, you can review the following article.
    http://technet.microsoft.com/en-us/library/aa196735(v=sql.80).aspx
    http://social.technet.microsoft.com/Forums/en-US/d2fa4b1e-3bd4-4379-bc30-389202a99ae2/multiple-field-terminators-in-bulk-insert-or-bcp?forum=sqlgetsta
    http://technet.microsoft.com/en-us/library/ms191485.aspx
    http://technet.microsoft.com/en-us/library/aa173858(v=sql.80).aspx
    http://technet.microsoft.com/en-us/library/aa173842(v=sql.80).aspx
    Applies to
    SQL Server 2012
    SQL Server 2008R2
    SQL Server 2005
    SQL Server 2000
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • When & how to use default settings option in job scheduling with BO 4.1

    Hi,
    With BO 4.1 we got new features and one of them is "Default Settings" option in the job scheduling. While scheduling a report in CMC we are getting below attached screen. I want to know when and how to use this option? while scheduling job on queries.
    Please guide me to, thanks in advance.
    Regards,
    Mithun Pati.

    Hi Mithun,
    Below thread may give you clear idea.
    The Purpose of the default settings is to have customized default settings for the enterprise. These settings would apply to any user who has access to Info view and wants to schedule a report. For example you can setup default values for "From" section of email so any scheduled reports use those settings. Similarly another setting we have defaulted is the number of retires involved and the seconds for each retry. Business Objects will not send out a failure emails unless the last retry has failed. The default settings should only be modified by an admin.
    Purpose of Default Settings when scheduling a WebI report?

  • How to use the chart option in bex analyzer

    Hi Expert
    i want to know how to use the Chart in Bex Analyzer.
    Next week i hve End user Training. my user wanthow to use the chart option in Analyzer.
    plz let me know how to use chart & any Document on that plz reply me.
    Reagards
    siva
    Edited by: patel siva on Sep 16, 2008 4:34 PM

    Check here:
    https://reporting.uky.edu/BWBExContextMenu.pdf
    http://help.sap.com/saphelp_nw70/helpdata/EN/8b/4ffd9b07474279b3bbee75a60db41f/content.htm
    http://help.sap.com/erp2005_ehp_03/helpdata/EN/5b/30d43b0527a17be10000000a114084/frameset.htm
    Thanks..
    Shambhu

  • How to use Resever Field for Customer Master

    Hi
    My Client Requirement. Price should be determine with Sales ORG, Distribution channel, Division, Districts, Talukas and Villages.
    But Talukas and villages are not available in SAP standard systems.
    Is it possible to use reserver field in Customer Master for this purpose?
    If it is ok then please give suggestion how to use this reserve fields.
    Thanks in Advance
    Madhu

    Hello,
    the system-behavior that you describe is standard behaviour, because   
    the fields which you are describe (village and ..) doesn't exist in structure KOMG.                                                                               
    For using this field in the field catalog you can proceed like this:   
    1. create a new field for example ZZvillage...                             
    2. add the new field in the table T681F for the application 'V' and the
       usage 'A'                                                           
    3. add the field to the include-structure KOMKAZ                       
    4. fill the new fields in the userexit for pricing                     
       (Pricing_Prepare_TKOMK (TKOMP)                                                                               
    I hope that the information are helpful for you.    
    regards
    Claudia

  • How to use the field of 'FM for Determining Address' in report RSWUWFML2?

    Dear gurus,
    In the selection screen of report RSWUWFML2, there is a field named 'FM for Determining Address' . How to use it? Is it for sending e-mail to specific e-mail addresses?
    Regards
    David

    I will test soon. Thanks to all involved.

  • How i use header fields in soap adapter

    Hi Experts,
    I need use  header fields http  in soap adapter receiver but i don't know where's the Variable Header
    Do you know where i find this?
    Somebody know how i put header fields http in soap adapter receiver?
    Thanks for all,

    It is similar like in this blog:
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    Find in the online help the values for the SOAP adapter.
    You can only add additional fields, you cannot influence the standard field like content-type and content-id.
    Regards
    Stefan

  • Making Useful life field optional in Asset master creation(AS01)

    Hi all,
    I want to make 'Useful life' field in 'Depreciation area' tab as optional in AS01 (Asset master).
    1. I made the screen layout changes using AO21 and made Useful life optional
    2. I assigned the above screen layout in OAYZ
    Despite doing this, during asset master creation, the field still shows as 'Required' and not as 'optional'.
    Am I missing anything else?  Kindly provide some pointers.
    Thanks,
    Sridevi

    Hi Sridevi
    Please check your depreciation key. If your depreciation is based on useful life, the key is required regardless the field status.
    Thanks
    Sanjeev

  • How to use Image field in SQL-7 for curvs

    I sampling data from a NI-card. There will be a lot of data so I thought I should use Image-field in SQL-7 to save the hole curve. How do you do that?

    I would suggest looking into the Database Connectivity Toolset. It has complete SQL functionality and uses ADO to connect to many types of databases. I have it and it comes with example programs which demonstrate how to write to and read from databases using SQL.
    J.R. Allen

  • How to disable 'Clear Record' option in Oracle Forms deployed in Orcl Apps

    Dear Members,
    I have developed a custom form which is deployed in Oracle Applications.
    In this form I want to disable the 'Clear Record' option to prevent users from clearing the record.
    Can any one please tell me how can I do it?
    Thanks in advance.
    Best Regards,
    Arun Reddy D.

    Hi,
    In your Forms---> trigger--> KEY-CLRREC-----> NULL;
    You cant clear any record.

  • How to use "Routing Table" option in Proxy service in OSB ?

    Hi,
    I have created Business and Proxy services in my OSB console. I have used "Custom Query" option while creating the Database Adapter and I'm passing one input parameter to the query. My input parameter is "Name".
    Based on the input values for this parameter, I need to pass a corresponding values to the query. For example, If I pass the following values to "Name" input parameter (India) I need to pass "Value1" to my query -
    India --> Value1
    China --> Value2
    America --> Value3
    To achieve this requirement, I have used "Routing Table" option. I have specified the values as follows -
    Expression - $body/fet:FetchCustDataInput/fet:Name
    Operator- '='
    Compare value - India
    Service - "My Webservice"
    Operaton- "My Service Operation"
    In the "Request Actions:" I have added the "Add an Action --> Messaging Processing --> Replace" and provided the following values -
    Replace <XPath> = $body/fet:FetchCustDataInput/fet:Name
    in Variable = "Name"
    with Expression = xs:string('Value1')
    and selected "Replace node contents" option.
    No validation errors I faced. I have created the Routing table in Proxy service. But when I try to execute the proxy service in my Test Console, I get the following error message -
    "The invocation resulted in an error: Unknown error while processing message for service ProxyService OSBQueryService/FetchByCustomQuery/FetchByCustomQueryPS."
    I have even enabled "Direct call" and "Include Tracing" options as well. The message under "Tracing" give "(echoing request)
    Routed Service. No Service has been invoked, the request is echoed.".
    Can anyone please help me to resolve this issue.
    Thanks in Advance,
    Udaya

    Did you put any loggers in the proxy at request pipeline prior to route node ? Can you trace if the request has entered request pipeline aleast.
    If not just check the transport headers under the request window in the test console. There should be a text box for entering username/password which should be left blank. I have faced this unknown exception from test console in some browsers where an incorrect username/password used to get populated here. Check this ..
    Edited by: atheek1 on Jul 22, 2010 2:02 AM

  • How to use two "field separator" in the same Comunication Channel

    Hi experts,
    I  upload flat files with XI, and my Comunication Channel is configured to use the field separator "~".
    FILA.fieldSeparator     ~
    Is posible to configure that Comunication Channel to accept two field separator. I want that upload flat files that has as separator "~" and flat files that has "|" .
    thanks
    regards

    IT IS not possible to have 2 fieldseparator to identify the fields of a record.

  • How to use varaibke manager option at RPD in obiee 10g

    Hi
    At RPD level , can anyone please help on uderstanding how to use the variable manager.
    thank you

    Hi,
    System session variables:
    System session variables have reserved names, that cannot be used for other kinds of variables (such as static or dynamic repository variables and non-system session variables).
    e.x:
    1)
    if u want to get and display user login ID,group,timezone...Date and time...etc... can be done by using session variable
    2) Exteranl application integration ( java -jsp) by using go url.
    here u can specify the session variable and it will passed into Java apps.
    3) setting log level by using session varaible
    4) u can use it report tittle/header..etc
    for more:
    http://obiee101.blogspot.com/2008/02/obiee-adding-session-variables-to.html
    http://obiee-blog.info/administration-tool/how-to-set-session-variables-using-url-variables/
    http://sureshotstrategies.blogspot.com/2008/07/about-session-variables-in-obiee.html
    http://inetskills.com/obiee/obiee_11.php
    Thanks
    Deva
    Edited by: Devarasu on Dec 6, 2011 5:10 PM

Maybe you are looking for

  • Passing parameters

    I am getting the error message <identifier expected> when I try to pass two parameters, projectID and projectName from the first class below to the second class. What is the problem with this? import javax.swing.*; import java.awt.*; import java.awt.

  • Gridbag layout positions

    Hello, I am creating a gui with various swing objects. I put a grouping of various objects within some panels as to allow for simpler layout. The problem however is spaning a jpanel over 2 rows. basically i want one panel on the left that spans 2 row

  • Equivalence of CLM cl_gui_frontend_services= directory_browse for SAP V.40B

    Hi guys. I hope you can help as well as many opportunities before. It looks stupid, but we need to make our ABAP programs from 6.0 to an older version like 40B. And one of the problems is that we have to read the directory in windows in order to down

  • Error on installing Studio Standard 5 update 1

    When I tried to install Studio Standard 5 update 1, I get an error message A suitable JVM could not be found. Please run the instller again using the option -is:javahome <JAVA HOME DIR> I'm using: Redhat 9.0, Java 2 Runtime 1.4.2 I used the -is:javah

  • BEA 10.2 proxy plugin

    Dear all, i don't know that i am a correct place, but i have a question about a bea weblogic proxy plugin. The situation is, that we have a BEA 10.2 32 bit application server in use, and want to use 64 bit iPlanet webserver. I have an error message w