How to define method  witch returning an array in View, using method wizard

Dear experts.
I would  like to define method  which returning an array in View.
When View is opened, in "Methods" tab push "new" button, then select "Method" in Method Type window,
push "Next" but in Method Properties window Array Type checkbox is disabled. So, it is not possible to
define method with returning array type.
Please anybody, help me to resolve this problem.

Hi
While creating method, you can see a check box over there as array type just check it that array type check box,
or
You can selet java native type as array by selecting "java native type"
thanks
anup
Edited by: Anup Bharti on Oct 15, 2008 8:50 AM
Edited by: Anup Bharti on Oct 15, 2008 8:51 AM

Similar Messages

  • How to map the method action return value directly into screen using variables?

    Hi,
    My JDev version is 11.1.1.6.3.
    I have a 'MethodAction' defined in PageDef file, that goes to model layer and return String value. As this needs to be executed during initializing of pageDef, I have also added an 'InvokeAction' for that.
    <executables>
               <invokeAction id="invokeSayHelloId" Refresh="ifNeeded"
                                    Binds="sayHello"/>
               <variableIterator id="variables">
                    <variable Name="Name" Type="java.lang.String"/>
               </variableIterator>
    </executables>
    <bindings>
              <methodAction id="sayHello" InstanceName="HrAMDataControl.dataProvider"
                                     DataControl="HrAMDataControl" RequiresUpdateModel="true"
                                     Action="invokeMethod" MethodName="sayHello"
                                     IsViewObjectMethod="false"
                                     ReturnName="data.HrAMDataControl.methodResults.sayHello_HrAMDataControl_dataProvider_sayHello_result">
                                        <NamedData NDName="pName" NDValue="Michael John" NDType="java.lang.String"/>
             </methodAction>
    </bindings?
    Requirement:
    I want to map the return value of this method action directly into screen by making use of PageDef variables.
    Question:
    I. I need to know how to map this return value direcly as exprssion against PageDef variable.
    2. If Question 1 is achievable, assuming the method action returls List instead of String (I know well it returns 2 items), can I map the 1st Item against Variable 1 and 2nd Item against Variable 2 directly?
    Thanks in Advance.
    Ragu

    Thanks Frank, but If I directly map the MethodAction's result to UI, there are chances where it might get executed whenever I refresh the UIComponent (UIComponent to which the methodAction result is mapped. Isn't so??). Instead, If I invoke the MethodAction using InvokeAction, I can get the control on when it should get invoked (using RefreshCondition). If I assign the variable to UIComponent (Assume I've mapped the method action result to variable using expression), refreshing of UIComponent will not cause any performance issue I feel.
    Correct me If I am wrong.

  • How to trap null return values from getters when using Method.invoke()?

    Hi,
    I am using Method.invoke() to access getters in an Object. I need to know which getters return a value and which return null. However, irrespective of the actual return value, I am always getting non-null return value when using Method.invoke().
    Unfortunately, the API documentation of Method.invoke() does not specify how it treats null return values.
    Can someone help?
    Thanks

    What do you get as a result?I think I know what the problem is.
    I tested this using following and it worked fine:
    public class TestMethodInvoke {
    public String getName() {
    return null;
    public static void main(String args[]) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {
    Object o = new TestMethodInvoke();
    Class cls = o.getClass();
    Method m = cls.getMethod("getName", (Class[]) null);
    Object result = m.invoke(o, (Object[])null);
    if (result == null) {
    System.err.println("OK: Return value was null as expected");
    else {
    System.err.println("FAILED: Return value was NOT null as expected");
    However, when I use the same technique with an EJB 3.0 Entity class, the null return value is not returned. Instead, I get a String() object. Clearly, the problem is the the EJB 3.0 implementation (Glassfish/Toplink) which is manipulating the getters.
    Regards
    Dibyendu

  • Calling a method that returns values in a map - using JSTL

    Hi I have a method within an object that returns a List for a particular category
    public List<String> getFieldsInCategory(String categoryName){
        return _categoryFieldsMap.get(categoryName); //This is a map that returns a list                                                             
      }Trying to call the above function in jsp, the object is available as "document",
    how do i pass a key to the above function to return a List.
       <c:forEach items="${document.fieldsInCategory('ABSTRACT')}" var="temp">How do i get the list by passing a string key to my method,
    please let me know how to go about this.
    Thanks

    JSTL can not directly call methods that take parameters.
    All it can do is access javabean properties - ie via the revealed get/set methods.
    You can fudge it by having a seperate variable to set:
    Map  _categoryFieldsMap;
    String category = null;
    public void setCategory(String category){
      this.category = category;
    public String getCategory(String category){
      return category;
    public List<String> getFieldsInCategory(){
        return _categoryFieldsMap.get(categoryName); //This is a map that returns a list                          
      }You would then do it like this in your JSP:
    <c:set target="document.category" value="ABSTRACT"/>
    <c:forEach items="${document.fieldsInCategory}" var="temp">
    ...The other alternative is to return the entire map to the page.
    EL accesses maps quite handily.
    so given a method that returns the map:
    public Map getCategoryFieldsMap(){
    return _categoryFieldsMap;
    then the expression: ${document.categoryFieldsMap.ABSTRACT} returns what you are after.
    Hope this helps,
    evnafets

  • How to print the report directly without previewing (report viewer) using c# windows application

    Hi,
    Currently, we are using crystal report to all of our reporting applications, but since I/users have encountered some issues about CR's speed to load only a simple report, maybe it is now time for us to adopt a new reporting environment in which I think SSRS
    can fill this problem.
    To start with, I have here a sample code, that uses the crystal report to print the report directly without previewing:
    csCashInvoiceCal csCashCal; --Crystal report name .rpt
    dsCsReceipt dsCs; --created dataset
    DataTable u;
    DataRow s;
    private System.Drawing.Printing.PrintDocument printDocument1;
    private System.Windows.Forms.PrintDialog printDialog1;
    ParameterValues paramValue;
    ParameterDiscreteValue discreteValue;
    ParameterFieldDefinition fieldDefinition;
    private void btnPrint_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt2();
    print2();
    csCashCal.Close();
    this.Cursor = Cursors.Default;
    private void loadReceipt2()
    dsCs = new dsCsReceipt(); --created dataset
    u = dsCs.Tables.Add("DtCsReceipt");
    u.Columns.Add("Qty", Type.GetType("System.String"));
    u.Columns.Add("UOM", Type.GetType("System.String"));
    u.Columns.Add("Description", Type.GetType("System.String"));
    u.Columns.Add("UnitPrice", Type.GetType("System.String"));
    u.Columns.Add("Discount", Type.GetType("System.String"));
    u.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    s = u.NewRow(); double.TryParse(dgvDesc.Rows[i].Cells[Discount2.Name].Value.ToString(), out discount);
    s["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    s["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    s["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    s["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    s["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    s["Discount"] = "";
    s["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    u.Rows.Add(s);
    catch (Exception) { }
    csCashCal = new csCashInvoiceCal();
    csCashCal.SetDataSource(dsCs.Tables[1]);
    //csCashCal.Refresh();
    loadParameter2();
    private void loadParameter2()
    ParameterFieldDefinitions paramFieldDefinitions;
    paramValue = new ParameterValues();
    discreteValue = new ParameterDiscreteValue();
    paramFieldDefinitions = csCashCal.DataDefinition.ParameterFields;
    discreteValue.Value = date;
    fieldDefinition = paramFieldDefinitions["Date"];
    commonParam();
    discreteValue.Value = txtcsno.Text;
    fieldDefinition = paramFieldDefinitions["InvoiceNo"];
    commonParam();
    discreteValue.Value = txtNameTo.Text;
    fieldDefinition = paramFieldDefinitions["CustomerName"];
    commonParam();
    discreteValue.Value = txtAdd.Text;
    fieldDefinition = paramFieldDefinitions["CustomerAddress"];
    commonParam();
    ------other parameters----
    private void commonParam()
    paramValue.Clear();
    paramValue.Add(discreteValue);
    fieldDefinition.ApplyCurrentValues(paramValue);
    private void print2()
    using (printDocument1 = new System.Drawing.Printing.PrintDocument())
    using (this.printDialog1 = new PrintDialog())
    //this.printDialog1.UseEXDialog = true;
    this.printDialog1.Document = this.printDocument1;
    DialogResult dr = this.printDialog1.ShowDialog();
    if (dr == DialogResult.OK)
    int nCopy = this.printDocument1.PrinterSettings.Copies;
    int sPage = this.printDocument1.PrinterSettings.FromPage;
    int ePage = this.printDocument1.PrinterSettings.ToPage;
    string PrinterName = this.printDocument1.PrinterSettings.PrinterName;
    try
    csCashCal.PrintOptions.PrinterName = PrinterName;
    csCashCal.PrintToPrinter(nCopy, false, sPage, ePage);
    printcount++;
    //saveCountPrint();
    catch (Exception err)
    MessageBox.Show(err.ToString());
    This is only a simple sales receipt application that uses dgv and textboxes to push its data to dataset to the crystal report, a simple one but there are instances that it is very slow.
    But I'm having trouble implementing this using SSRS, since I'm only new to this one, wherein I created the report using report wizard, with two button options inside the form for print preview or direct print selection. Actually, it is very easy to implement
    with print preview because it uses reportviewer. My problem is that how can I print the report directly without using a reportviewer?
    So here is my code so far which I don't know what's next:
    private void button2_Click(object sender, EventArgs e)
    this.Cursor = Cursors.WaitCursor;
    loadReceipt3();
    //print3();
    this.Cursor = Cursors.Default;
    ReportParameter[] parameter = new ReportParameter[11];
    private void loadParameter3()
    parameter[0] = new ReportParameter("InvoiceNo", txtcsno.Text);
    parameter[1] = new ReportParameter("Date", date);
    parameter[2] = new ReportParameter("CustomerTin", txtTin.Text);
    parameter[3] = new ReportParameter("CustomerName", txtNameTo.Text);
    parameter[4] = new ReportParameter("CustomerAddress", txtAdd.Text);
    parameter[5] = new ReportParameter("Agent", agent);
    parameter[6] = new ReportParameter("Discount", "Discount: ");
    parameter[7] = new ReportParameter("TotalDiscount", lblDiscount.Text + "%");
    parameter[8] = new ReportParameter("TotalSales", rdtotal);
    parameter[9] = new ReportParameter("Tax", rdtax);
    parameter[10] = new ReportParameter("TotalAmount", rdnet);
    private void loadReceipt3()
    DataSet dsrs = new DataSet();
    DataTable dtrs = new DataTable();
    DataRow drs;
    dtrs.Columns.Add("Qty", Type.GetType("System.String"));
    dtrs.Columns.Add("UOM", Type.GetType("System.String"));
    dtrs.Columns.Add("Description", Type.GetType("System.String"));
    dtrs.Columns.Add("UnitPrice", Type.GetType("System.String"));
    dtrs.Columns.Add("Discount", Type.GetType("System.String"));
    dtrs.Columns.Add("Amount", Type.GetType("System.String"));
    try
    for (int i = 0; i < dgvDesc.Rows.Count - 1; i++)
    drs = dtrs.NewRow();
    drs["Qty"] = double.Parse(dgvDesc.Rows[i].Cells[Qty.Name].Value.ToString());
    drs["UOM"] = dgvDesc.Rows[i].Cells[Uom2.Name].Value.ToString();
    drs["Description"] = invcode + dgvDesc.Rows[i].Cells[Description.Name].Value.ToString();
    drs["UnitPrice"] = dgvDesc.Rows[i].Cells[UnitPrice.Name].Value.ToString();
    if (discount != 0)
    drs["Discount"] = "(" + string.Format("{0:0.##}", discount) + "%)";
    else
    drs["Discount"] = "";
    drs["Amount"] = dgvDesc.Rows[i].Cells[Amount2.Name].Value.ToString();
    dtrs.Rows.Add(s);
    catch (Exception) { }
    int addtlRow = 7;
    if (addtlRow > (count - 1))
    addtlRow = addtlRow - (count - 1);
    for (int i = 0; i < addtlRow; i++)
    dtrs.Rows.Add();
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    localreport.Refresh();
    //what's next....
    So what's next after local..refresh()? Actually, I have googled a lot but I didn't found the exact solution that I'm looking for which confuses me a lot.
    Anyway I'm using VS 2010 with sql server 2012 express.
    You're help will be greatly appreciated.
    Thank you,
    Hardz

    After some further studies with ReportViewer controls and with the use of this tutorial @ : http://msdn.microsoft.com/en-us/library/ms252091.aspx, which helps me a lot on how to print a report without using a report viewer, I found out what is missing
    with my code above and helps solve my question.
    Here's the continuation of the code above:
    private void loadReceipt3()
    loadParameter3();
    LocalReport localreport = new LocalReport();
    localreport.ReportPath = @"..\..\SsrsCashReceipt.rdlc";
    localreport.SetParameters(parameter);
    localreport.DataSources.Clear();
    localreport.DataSources.Add(new ReportDataSource("dsSalesReceiptSsrs", dtrs));
    Export(localreport);
    print4();
    private IList<Stream> m_streams;
    private int m_currentPageIndex;
    private void Export(LocalReport report)
    string deviceInfo =
    @"<DeviceInfo>
    <OutputFormat>EMF</OutputFormat>
    <PageWidth>8.5in</PageWidth>
    <PageHeight>11in</PageHeight>
    <MarginTop>0.25in</MarginTop>
    <MarginLeft>0.25in</MarginLeft>
    <MarginRight>0.25in</MarginRight>
    <MarginBottom>0.25in</MarginBottom>
    </DeviceInfo>";
    Warning[] warnings;
    m_streams = new List<Stream>();
    report.Render("Image", deviceInfo, CreateStream,
    out warnings);
    foreach (Stream stream in m_streams)
    stream.Position = 0;
    private void print4()
    if (m_streams == null || m_streams.Count == 0)
    throw new Exception("Error: no stream to print.");
    PrintDocument printDoc = new PrintDocument();
    PrintDialog printDlg = new PrintDialog();
    printDlg.Document = printDoc;
    DialogResult dr = printDlg.ShowDialog();
    if (dr == DialogResult.OK)
    if (!printDoc.PrinterSettings.IsValid)
    throw new Exception("Error: cannot find the default printer.");
    else
    printDoc.PrintPage += new PrintPageEventHandler(PrintPage);
    m_currentPageIndex = 0;
    printDoc.Print();
    Dispose();
    public void Dispose()
    if (m_streams != null)
    foreach (Stream stream in m_streams)
    stream.Close();
    m_streams = null;
    private Stream CreateStream(string name, string fileNameExtension, Encoding encoding, string mimeType, bool willSeek)
    Stream stream = new FileStream(name + "." + fileNameExtension,
    FileMode.Create);
    m_streams.Add(stream);
    return stream;
    private void PrintPage(object sender, PrintPageEventArgs ev)
    Metafile pageImage = new
    Metafile(m_streams[m_currentPageIndex]);
    // Adjust rectangular area with printer margins.
    Rectangle adjustedRect = new Rectangle(
    ev.PageBounds.Left - (int)ev.PageSettings.HardMarginX,
    ev.PageBounds.Top - (int)ev.PageSettings.HardMarginY,
    ev.PageBounds.Width,
    ev.PageBounds.Height);
    // Draw a white background for the report
    ev.Graphics.FillRectangle(Brushes.White, adjustedRect);
    // Draw the report content
    ev.Graphics.DrawImage(pageImage, adjustedRect);
    // Prepare for the next page. Make sure we haven't hit the end.
    m_currentPageIndex++;
    ev.HasMorePages = (m_currentPageIndex < m_streams.Count);
    Thank you very much for this wonderful tutorial. :)

  • Unable to print the array method that returns an array

    public class ReturnAtrray {
         public static void main(String[] args) {
              int[] b= {1, 3, 5};
              System.out.println(incrementArray(b,2));
         public static int[] incrementArray(int [] a, int increment)
              int[] tmp = new int[a.length];
              for(int i = 0; i <a.length; i++ )
                   tmp= tmp[i] + increment;
              return tmp;     

    You are correct: Java is always pass by value. In the case of an array it is a reference to the array that is passed by value. This means that there is a way to increment the array values "in place". As an alternative to what you are doing now consider:
    // untested
    public class ReturnAtrray {
        public static void main(String[] args)
            int[] b= {1, 3, 5};
            incrementArray(b,2);
            for(int i = 0; i < b.length; i++)
                System.out.print(b[i] + " ");
        public static void incrementArray(int [] a, int increment)
            for(int i = 0; i <a.length; i++)
                a[i] = a[i] + increment;
    }

  • How to generate xml file from an array of data using jQuery

    Hi All,
    Iam facing the problem with diaplaying array of data into a xml file, Actually iam using SAPUI5 commons table to display the backend data, each row in the table has checkbox. If we select each checkbox, iam getting the particular record and push it into an empty array and then i should show that array of data into xml file.

    OData.request 
    requestUri: url,  
    method: "POST",
    headers: {                    
    "X-Requested-With": "XMLHttpRequest",                  
    "Content-Type": "application/atom+xml",
    "DataServiceVersion": "2.0", 
    "Accept": "application/atom+xml,application/atomsvc+xml,application/xml",  
    "X-CSRF-Token": header_xcsrf_token   
    data: requestTableDATAArray
    // Response after posting and set message
    function (data, response) 
    alert(response.body);//gives xml format

  • How can I check the return status of a request using URLConnection?

    Hi,
    I am using the classes URL and URLConnection to connect to a remote server and make a POST request. The code extract is:
    URL u = new URL("http://.....");
    URLConnection con = u.openConnection();
    con.setDoInput(true);
    con.setDoOutput(true);
    con.setUseCaches(false);
    con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
    DataOutputStream out = new DataOutputStream(con.getOutputStream());
    out.writeBytes(........);
    out.flush();
    out.close();
    Next, I would like to check the return status of my request. I need to see if the server returned status 200 (OK) or an error (e.g. 404). Is there a way to check this?
    If you are aware of another way I can achieve this whole thing I would be grateful if you could let me know.
    Thanks very much for your help!

    URLConnection doesn't have a getResponseCode
    method...
    But I found a link
    http://bugs.sun.com/bugdatabase/view_bug.do;:WuuT?bug_
    id=4191207
    that helped me found out that there is another class
    called HttpURLConnection:
    ((HttpURLConnection)conn).getResponseCode( )You should read the API:
    http://java.sun.com/j2se/1.5.0/docs/api/java/net/URL.html#openConnection()
    "If for the URL's protocol (such as HTTP or JAR), there exists a public, specialized URLConnection subclass belonging to one of the following packages or one of their subpackages: java.lang, java.io, java.util, java.net, the connection returned will be of that subclass. For example, for HTTP an HttpURLConnection will be returned,..."

  • Screen View has changed to plain text and I don't know why or how to get it to return to a normal view

    My screen view has changed to a plain text yesterday and I do not understand why. I did not make any changes. I did not install any new programs. I did install to updates from Neat Works and Quick Time. Also ran PC clean up by AVG.

    -> Tap '''ALT''' key or press '''F10''' to show the Menu Bar
    -> go to View Menu -> '''Zoom''' -> click '''Reset''' -> '''Page Style''' -> select '''Basic Page Style'''
    -> go to Tools Menu -> Clear Recent History -> '''Time range to clear: select "EVERYTHING"''' -> click Details (small arrow) button -> place Checkmarks on '''Cookies, Cache, Site Preferences''' -> click '''Clear Now'''
    -> go to Tools Menu -> Options -> Security -> place Checkmarks on:
    1) Warn me when sites try to install add-ons 2) Block reported attack sites 3) Block reported web forgeries
    -> go to Tools Menu -> Options -> Advanced -> Network -> Offline Storage (Cache): click '''Clear Now''' button
    -> Click OK on Options window -> Restart Firefox
    Check and tell if its working.

  • HT201304 how do i bypass my childs lock screen to view use and content

    My husband, my daughter, and myself have iphones all on the same account. i want to be able to view my daughters contacts, times of use, and even content of texts if I need to. 

    The only way to do it without restoring the iPhone is to have your daughter provide the passcode to you. There is no way to circumvent the passcode, that's the point of having one.
    The iPhone should have a passcode, to prevent its use in the event it is lost or stolen. If you want access to her data, she must share the passcode with you.

  • Returning an array type from a local method in Web Dynpro Java application

    Hi,
    In my project, we have a requirement to display 18 rolling months along with the year, starting from current month.
    How I am going to approach is that I will get the system date and get the current month and send the month and year value to a local method which will return 18 rolling months along with the year.
    But, when I tried to create a new method there is no option to return an array type. It was greyed out.
    So, we can not return an array type from a method from Web Dynpro for Java application?
    If so, what is the alternative and how am I going to achieve it?
    I will appreciate your help!
    Regards
    Ram

    HI
    You can create new methods in
      //@@begin others
      private ArrayList MyMethod(){
           // ** Put your code here
           return new ArrayList();
      //@@end
    Other option are create a context node with cardinality 0...n with one or more attributes, and in your method create the needed registers into this node. To read this values, you only need to read your context node.
    Best regards
    Edited by: Xavier Aranda on Dec 2, 2010 9:41 AM

  • How do I access array elements in one method from another method?

    Hi all!
    How do I access the array's elements from another method so that method 2 can have access to method 1's array elements? Thanks for any help!
    I am trying to create a simply program that will use a method to create an array and a SEPARATE method that will sort the array's elements (without using java's built in array features). I can create the program by simply having one method and sorting the array within that same method, BUT I want to sort the array from another method.
    Here's my code so far:
    public class ArraySort {
       public static void createArray(int size){
           double myArray[] = new double[size];    //create my new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);   //fill the array with random numbers
       public static void sortArray(){
           // I WANT THIS METHOD TO ACCESS THE ARRAY ELEMENTS IN THE METHOD ABOVE, BUT DON'T KNOW
          //  HOW???? Please help!
        public static void main(String[] args) {
            createArray(4);    //call to create the array
    }Thanks again!
    - Johnny

    Thanks for the help all! I ve managed to get the program working, using java's built in array sort, but when i try to call on the array sort method from WITHIN my main method, nothing happens!
    Can somebody please tell me why I am not able to call on the sort method from within my main class???? Thanks!
    public class ArraySort {
       public void createArray(double[] arrayName, int size){
           double myArray[] = new double[size];  //create new array
           for(int j=0; j < myArray.length; j++)
              myArray[j] = (200.0 * Math.random() + 1.0);    //populate array with
           }                                                 //random Numbers
           sortArray(myArray); 
       } //Sort array(if I delete this & try to use it in Main method --> doesn't work???
       public void sortArray(double[] arrayName){
           DecimalFormat time = new DecimalFormat("0.00");
           Arrays.sort(arrayName);      //sort array using Java's built in array method
           for(int i = 0; i <arrayName.length; i++)
               System.out.println(time.format(arrayName)); //print arary elements
    public static void main(String[] args) {
    ArraySort newArray = new ArraySort(); //create a new instance
    double myArray[] = new double[0]; //create a new double array
    newArray.createArray(myArray,4); //build the array of indicated size
    //newArray.sortArray(myArray); //This will not work???? WHY?????//

  • How can I use method?

    These codes are not complete. But I am just wondering if I can use methods to write these. I am writing a menu to sell chairs and buy parts (of the chairs). So when user enter 1, it invoke method sell chair, enter 2 to invoke buy parts, and calculate the addition/reduction of inventory and monies. But I am not quite sure how I can do that.
    import java.util.*;
    public class Test {
         public static void main (String[] args) {
            Scanner sc = new Scanner (System.in);
            int frame = 10;
            int legs = 50;
            double money = 500.0;
            int opt = 0;
            do {
                 System.out.println("Press 1 to sell chair.");
                 System.out.println("Press 2 to buy parts.");
                 System.out.println("Press 3 to display summary.");
                 System.out.println("Press 4 to end program.");
                 opt=sc.nextInt();
                 switch (opt) {
                      case 1:
                           sellChair();
                          break;
                 case 2:
                           //invoke buy parts method
                           break;
                 case 3:
                           //display current frames and legs in inventory and cash on hand
                           break;
                 case 4:
                           System.out.println ("You have end the program.");
                           break;
                 default:
                           System.out.println ("Invalid option. Try again.");
                           break;
            } while (opt!=4);
            } //main
         public static void sellChair() {
              Scanner sc = new Scanner (System.in);
              int f = 0;
                 int l = 0;
                 double m = 0;
              System.out.println("Enter quantity");
              int qty = sc.nextInt();
              f--;
              l-=4;
              m+=15;
         //buy parts method
    } //class

    If you want your methods to have access to your variables, consider passing the variables as parameters to the method. If you want to change the variables from within the method (care must be taken here as bad side-effects can occur), then the variables need to be declared in the class not in the main method. I would like to dissuade you from doing the latter unless necessary. If you want your method to return something that can be used by the calling method, then make it a non-void method and have it return something.
    good luck.

  • How to define the default thumbnail, appearing after exporting a video in Premiere Pro?

    Hi community,
    When I export a video in Premiere Pro, the default thumbnail (appearing in windows file explorer for example) is never the best.
    At my job, I need to create a lot of video that I publish through a CMS. Every time, i need to reset the preview thumbnail of the video because the default one is not accurate.
    How to define which frame of my video will be used as a preview thumbnail after the video is exported?

    This is not something you can control with PP.

  • Setting the 'Return-Path' of emails sent using the send email behaviour

    Hi,
    How do I set the 'Return-Path' of emails sent using the send email behaviour? I am having troubles because the emails sent from my page are being filtered out as spam when they should be coming through. the text is the following (it is the notification of an e-card to the recipient):
    Dear Bart
    We've decided this year to share our holiday greetings while also showing our commitment to protect the planet. Since it takes 24 mature trees to
    produce one ton of greeting cards, this e-card shares our holiday wishes with both you and future generations.
    Please follow the link below.
    Best Wishes,
    John
    http://www.jdgcsfiles.com/_ecards/viewcard.php?ID_cnt=297
    I suspect that it has something to do with the return path setting.
    Can anyone help me on this one and get it through the spam filters of most email clients?!
    Thanks,
    NIk

    Hi Nik,
    so far the only "flagged as spam" reason I know of is, that ADDT curreently misses to insert the current date/time -- please try the fix mentioned in the thread http://www.adobeforums.com/webx/.3c034953/5 and see if it helps
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

Maybe you are looking for

  • MSI X48C PLATINUM BIOS PROBLEM

    Hello, i post this topic cause i don't saw any end for my problem, i got the same problem then a lot of people CPU work at half speed i send already message to MSI Customer Service, but what they tell me to do don't solve my problem: MSI Customer: As

  • Can't save illustrator documents

    iMac 3.6 GHz Intel Core i5 OS X 10.9.4 Whenever I try and save a document just recently, I get this message "Can't save the illustration. You do not have enough access privileges. ID: -5000" HELP

  • Cannot open online pdf

    I "upgraded" to Firefox 4 today, and I'm now unable to open online pdf documents. They start to load (Acrobat appears, and I start to see a small portion of the document), and then the screen within that tab goes blank. This did not occur in the prev

  • FTP SERVER DOUBT

    hi this is giri. i have one doubt. if my scenario is file to idoc.iam having legacy system, ftp server, xi server and sap r/3.now 1.how can i pull a specific file from legacy system to FTP server. is there any doc means please farward it to me .... t

  • How to get Current User Group NAME

    I am using the com.sun.security.auth.module.NTSystem to obtain information on the current user logged into the NT System. This class gives me the user name, all the group SIDs associated with the current user and also the current user's primary group