Error 1136: expects 0 arguments but constructor needs 2

Hi. In my project I have a Box class that extends MovieClip, and Box has instances of the Egg class. The Egg class receives two arguments on instantiation, month (a string) and size (an int).
Here's my code:
package com.stuff {
import flash.display.MovieClip;
import com.stuff.Egg;
public class Box extends MovieClip {
     private var Egg1:Egg = new Egg("jan", 2);
     private var Egg2:Egg = new Egg("feb", 5);
     public function Box():void {
package com.stuff {
public class Egg {
     public function Egg(m:String, s:int):void {
When I test the movie I get the following error: 1136: Incorrect number of arguments. Expected 0.
What am I doing wrong? Thank you.

I would still remove the :void on the constructors - it's not really a standard and makes the constructor stand out.
That said, maybe the error isn't with your constructor? Are you calling any functions inside of the Egg constructor in your actual code? I would watch for that. Try commenting lines out and adding them back 1 by 1 until you get the error.

Similar Messages

  • File Source Error [CrystalEnterprise.DiskUnmanaged] : [Invalid argument]

    Hello
    We have several reports scheduled with pdf or xls as outputs.
    Sometimes they are not refreshed due to the error : Source File Error [ CrystalEnterprise.DiskUnmanaged ] : [ Invalid argument ]
    But sometimes it's ok.
    And when we use the "refresh now" on the scheduled reports, it works.
    How can I fix it ?
    Thanks
    Edited by: VINCENT BARNIER on Jan 20, 2011 11:02 AM

    Hi Vince,
    Did you happen to find any solution for this?
    Because we seem to have come across the same error and it works absolutely fine when we run the report instantly, but when on the schedule, some of the reports are failing with this error.
    Any help/pointers would be greatly appreciated.
    Thanks,
    Jasmine.

  • Just downloaded Numbers spreadsheet... I entered a simple "if" statement...If(c2=0,9,7) just to see how it works.... But I get an error message "Argument 1 of if expects a Boolean but found "c2=0....This if statement works fine in Excel

    Just downloaded the Apple Numbers spreadsheet app... I entered this simple 'if' statement to see how it works.... "if(c2=0,9,7)...
    I got an error message.. "Argument 1 of if statement expects a Boolean but found "c2=0".
    This if statement works fine in Excel.....What am I doing wrong ????

    Just downloaded the Apple Numbers spreadsheet app... I entered this simple 'if' statement to see how it works.... "if(c2=0,9,7)...
    I got an error message.. "Argument 1 of if statement expects a Boolean but found "c2=0".
    This if statement works fine in Excel.....What am I doing wrong ????

  • Help with error message: Expected end of line but got identifier

    The following is a calculated applescript step in a Filemaker script. It tells iCal to go to the date of an iCal event that the script has previously created from Filemaker. The code below keeps generating an error message: "Expected end of line but got identifier." Note: "ACTIVITY::Date" below is Filemaker's way of indicating the file name (ACTIVITY) and the field in question (date). Help appreciated.
    "tell application \" iCal\" ¶
    activate ¶
    switch view to month view ¶
    set theDate to date \"" & ACTIVITY::Date & "\" ¶
    view calendar at theDate ¶
    end tell"

    It's not clear exactly what you're aiming for here, so it's not easy to tell you how to fix it.
    At first glance I'd say you're missing a quote symbol or two, but even then it doesn't make a lot of sense without more context - for example, 'ACTIVITY::Date' isn't valid as an AppleScript variable name (you can't have a : in a variable name), and your code isn't within a Filemaker block, so it doesn't appear to relate to Filemaker, either.
    In either case the only thing that looks remotely valid to me would be:
    set theDate to date "\"" & ACTIVITY::date & "\""
    but without knowing the context of ACTIVITY::Date it's impossible to tell if this is valid, or how it differs from:
    set theDate to date ACTIVITY::Date
    (i.e., why the quotes are needed at all)

  • I'm getting a Download Error warning after attempting to download and install CC. No error code – just a button prompt to Reload Applications which takes me straight back to the Download Error. All my previously installed CC apps work fine but I need to u

    I'm getting a Download Error warning after attempting to download and install CC. No error code – just a button prompt to Reload Applications which takes me straight back to the Download Error. All my previously installed CC apps work fine but I need to upgrde to be compatible with colleagues. Thanks

    I'm having exactly the same problem......I'm running an iMac with OS X 10.10.1. We have BT fibre optic business broadband. Everything has been running just fine until about 2 weeks ago when the apps in my CC panel just disappeared. I have made no changes to our systems and I am the only person to administer it all.....

  • Error:   expected 241664 bytes, but got 65536

    Dear All,
    I am getting the following error when I run an application to assign properties to documents on KM:
    #1.5#001321CCE41F00DC00000144000088A8000456ADC2016101#1221204191125#com.sapportals.wcm.protocol.webdav.server.WDServlet#sap.com/irj#com.sapportals.wcm.protocol.webdav.server.WDServlet#index_service#15729##INBRC_IN7_21412850#index_service#b465de40808a11dd88de001321cce41f#SAPEngine_Application_Thread[impl:3]_107##0#0#Error##Plain###serving request (-> 500) - java.lang.IllegalStateException: GET on http://inbrc:50200/irj/go/km/docs/KM/PROJECTS/HM/020%20ASAP%20Deliverables/024-%20Final%20Preparation/040-%20Authorization/Roles_HM/Roles-final-all/All%20SSC-Roles-28-July-02.xls expected 241664 bytes, but got 65536
    What could be the problem? Is there any size restrictions for documents on KM? If yes, how can this be increased?
    Thanks and Regards,
    Shyam.

    Dear Bobu,
    I have already cheched that. I commented that part of the code where it was trying to modify/set the properties. Then i tried just to print the size of the documents. I used the following code:
    ICollection currentFolder = (ICollection) ResourceFactory.getInstance().getResource(rid,irCtx);
    if (currentFolder != null)
         IResourceList children = null;
         children = currentFolder.getChildren();
         IResourceListIterator it = children.listIterator();
         while (it.hasNext())
                                            com.sapportals.wcm.repository.IResource childRes =it.next();
         IPropertyFilter predecessorFilter;
         IPropertyMap propMap;
         propMap = childRes.getProperties();
         long si =0;
         com.sapportals.wcm.util.content.IContent content = childRes.getContent();
         si = content.getContentLength();
         wdComponentAPI.getMessageManager().reportSuccess("size"+si);
    Even this is also giving the same error. So I think its clear from this that the error has not got anything to do with the properties. It seems the system cant retrieve the file.
    This is the complete trace for one file:
    #1.5#001321CCE41F0069000000160000CC7C000456EB920E1D95#1221469674562#com.sapportals.wcm.protocol.webdav.server.WDServlet#sap.com/irj#com.sapportals.wcm.protocol.webdav.server.WDServlet#index_service#590##INBRC_IN7_21412850#index_service#c1015220830411ddcf5d001321cce41f#SAPEngine_Application_Thread[impl:3]_3##0#0#Error##Plain###serving request (-> 500) - java.lang.IllegalStateException: GET on http://inbrc:50200/irj/go/km/docs/KM/PROJECTS/AD/010%20Project%20Management/012%20-%20Planning%20Phase/010%20-%20Project%20Plan/07_03_18_AD%20Effort%20Cost%20Estimate%20final.xls expected 108544 bytes, but got 65536
         at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.copy(WDGetHandler.java:653)
         at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.internalHandle(WDGetHandler.java:558)
         at com.sapportals.wcm.protocol.webdav.server.WDGetHandler.handle(WDGetHandler.java:257)
         at com.sapportals.wcm.protocol.webdav.server.WDServlet.doGet(WDServlet.java:763)
         at com.sapportals.wcm.protocol.webdav.server.WDServlet.service(WDServlet.java:454)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.wcm.portal.proxy.PCProxyServlet.service(PCProxyServlet.java:331)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sapportals.portal.prt.core.broker.ServletComponentItem$ServletWrapperComponent.doContent(ServletComponentItem.java:110)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
         at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
         at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
         at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
         at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Thanks,
    Shyam.

  • HT1926 Have new generation 6 nano.  Was able to install version 8 of itunes but error reads that this version with Vista needs newer version.  Have tried to install 10.1 but it installs only part way then installs itself part way through.  Help.

    Has anyone had problems downloading itunes 10.1 with the generation 6 nano?  I have
    Windows Vista on my computer.  Was able to install version 8.1 but nano needs newest version. Help anyone???

    The solution Lijoesat posted above worked for me!
    First I found the private/var/folders/ (and then lots of gibberish folders) and singled out two garageband files and deleted them. This did not work.
    I then deleted everything which may or may not be a good thing, I am an idiot, I have no idea if these are extremely important files or not!
    I tried to empty the trash bin after but many files was locked and Garageband would still not install.
    I did a restart of the computer, emptied the bin successfully and tried to install Garageband again and it worked fine!
    The inserted picture show some of the folder structure, I deleted everything after private/var/folders/

  • Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.gemstone.gemfire.cache.GemFireCache] is defined: expected single bean but found

    Hi!
    I'm trying to configure java gemfire template to query data in spring application.
    To create spring template I need to create client-region, to create client-region I need to create client-cache, to create client-cache I need to create pool.
    One of the pool parameters is server-goup. I need gemfire template(s) to query several of them.
    I didn't find pool to be configurable for several server goups, thus I've created two pools (with different server goups) two client caches two client regions and two templates and got an error.
    Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.gemstone.gemfire.cache.GemFireCache] is defined: expected single bean but found
    What I'm missing? How could I fix the error or manage to setup client region for several server groups?
    Thanks.

    Try posting this in the WLS EJB forum:
    WebLogic Server - EJB

  • Error - '.' expected - while database insert thru JSP & javabeans & JDBC

    I get the following error when i try to compile the below mentioned code in JDEVELOPER 10.1.2
    Error : '.' expected
    ===================
    have error in my code. I am trying to do a simple database insert program using javabeans and jsp. I get a value to be inserted in database through the jsp page in a text box and would like to be inserted into database using beans The connection to database and mysql query are in java file.
    Here is the code.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page language="Java" import="java.sql.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <html>
    <head>
    </head>
    <body>
    <form name="form1" action="beancode" method="POST">
    Emp ID: <input type="text" name ="emplid"> <br><br><br>
    <input type = "submit" value="Submit">
    <jsp:useBean id="sampl" class="beancode" scope="page">
    <jsp:setProperty name="sampl" property="*"/>
    </jsp:useBean>
    </form>
    </body>
    </html>
    I know i might have made a mistake here in using the bean. Here is the java code which does the insert part.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    * @author Trainees
    public class beancode
    private String employid;
    private Connection con = null;
    private ResultSet rs = null;
    private PreparedStatement st = null;
    /** Creates a new instance of beancode */
    public beancode()
    try
              Class.forName("org.gjt.mm.mysql.Driver");
              Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
    catch(Exception e)
              System.out.println(e.getMessage());
    public void setemployid(String empid)
              employid = empid;
         public String getemployid()
              return (employid);
    public void insert()
    try
    String s1="insert into samp values('"+employid+"')";
    st = con.prepareStatement(s1);
    st.executeUpdate();
    st.clearParameters();
    st.close();
    catch(Exception m)
    }

    It's pretty hard to spot any errors the way it's currently formatted. But, you're trying to call the beancode when submitting your form, but the beancode isn't a servlet. Try to find a working example, run it, and then change it to implement your requirements.
    The following example shows you have to use the jstl sql tags: http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jsps/jstlsql.html. If you want to do an insert when a user submits a form, you need 2 pages. The first will contain your form, the second will insert the record.
    (once you've got that running, look for some examples using an mvc framework, and how to use bind variables with jdbc)

  • SPD 2013 WF Error: Maximum number of arguments per activity (50).

    Hi,
    We have hit a limit with using variables in SPD Designer workflow in SP2013. The following is the error message that we receive:
    "Microsoft.Workflow.Client.ActivityValidationException: Workflow XAML failed validation due to the following errors: Activity 'DynamicActivity' has 52 arguments, which exceeds the maximum number of arguments per activity (50)."
    The following thread >>here
    did provide a solution but we need a solution that's based on Powershell or Server Object Model. Is there an approach for changing the variable limit for workflows with Server Object Model/Powershell?
    Blog: http://dotnetupdate.blogspot.com |

    Hi Vikram,
    as i know if you want to change this, there is no other way then to update the database directly, that we strongly not recommend this to be done.
    they may not have any powershell or server object modal command to update the database value directly, instead you need to try on your environment, here is the example to access sql from powershell:
    http://technet.microsoft.com/en-us/magazine/hh289310.aspx
    to check the database, you can use the database explorer to develop the code:
    http://moresharepoints.blogspot.in/2014/01/sharepoint-designer-2013-workflow-error.html
    Regards,
    Aries
    Microsoft Online Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • (error:type expected) help!!!,please!!!

    i have a program i am working on, but the compiler tells me i
    have a "error:type expected" here is the line of code:
    System.out.println("descending order sort"); it says i need a
    "type" right where the first parenthesis is. If someone could help
    me it would be great.

    Black Prince, why don't you sign on with a new ID - for the NEXT time you're stuck with your code (people probably know this one too well, so you've blown it on this - though) try 'javaranch' as the second best, to my knowledge java forum on the planet for this one.
    - I think you've blown it as the romantic Black_Prince, but at least now you've learned how to behave. See you in the the next (java forum) life then and ...
    ... keep at it, java really is fun!

  • Dummy mx:Window file show Error 1136.

    Hello,
    I have a problem with mxml file show 1136: Incorrect number of arguments. Expected 1. Show Error line which not existed in the file.
    URL below is simple project create to reproduce that error
    http://f1.uploadfile.biz/file/?i=MDENMEIEEIEHDW
    http://www.upload-thai.com/download.php?id=1dbed8449857e3caff22c4e9ad98dcc7
    http://www.upfile2day.com/uploads/1280153958.zip
    ============
    I try to make Twitter Client which use Actionscript as start-up script. this actionscript is check if setting file exists.
    In condition of no setting file, it show Login window, otherwise, it show Twitter feed window.
    As I see in Adobe AIR Reference below,
    http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7e0a. html
    what I understand is that I cannot create 2 WindowedApplication because WindowedApplication does not design to communicate each other.
    The reference suggust to use Window class instead of that.
    So, I change WindowedApplication to mx:Window and make ActionScript to run that Window.
    However, it show Error 1136 on the line which not existed.
    So, below is a simple application project screenshot that reproduce this topic problem
    1136: Incorrect number of arguments.  Expected 1.   TestError      line 28   Flex Problem
    How can i fix this problem?
    This is my short list may make more understand
    * Adobe AIR - Desktop Application
    * Want to open more than 1 window
    * Window show up is condition of startup script
    My System
    * Adobe Flash Builder 4
    * Flex 4
    * AIR 1.5

    You (or your users) shouldn't see the window when you run non-debug version of Flash Player.
    Also since FP 10.1 you can handle uncaught errors like this:
            private function onCreationComplete(event:Event):void {
                if (loaderInfo.hasOwnProperty("uncaughtErrorEvents")) {
                    IEventDispatcher(loaderInfo["uncaughtErrorEvents"]).addEventListener("uncaughtError", uncaughtErrorHandler);
            private function uncaughtErrorHandler(event:Event):void {
                // Do something about the error, like:
                var error:Object = event["error"];
                 log.error("Uncaught Error. ErrorID={0}, Name={1} Message={2}", error.errorID, error.name, error.message);
                 event.preventDefault(); // to stop the error dialog appear in debug FP
    Andrei.

  • Warning this is very long code but i need help to see if I am on right trac

    I have done all the following code myself and it is the buisiness layer for my application. I have tried to follow recommendations on previous posts and I would like to be told where I can clean up my code and how? This is not complete and it looks very long to me but I need help in order to be better. There are 4 button vlivks and I have not completed them all. The criteria for application is that phonebook will accept new entries if they have names surnames and phone numbers that are not longer than 10 characters for display purposes but can change this. No duplicates are allowed. No editing of a existing entry must lead to a duplicate entry either. No new entry or edit may result in a new contact having no phone numbers.
    Many thanks for your time in advance,.....
    import javax.swing.JOptionPane;
    import java.util.ArrayList;
    public class Contact
    {// Start of the Contact class
         ArrayList<ContactDetails> phoneList = new ArrayList<ContactDetails>();          // To hold all the contacts
         ArrayList<ContactDetails> searchList = new ArrayList<ContactDetails>();          // To hold all contacts that return true on search
         ArrayList<ContactDetails> list = new ArrayList<ContactDetails>();
         String newName;                                                                                // To hold the new name
         String newSurname;                                                                           // to hold the new surname
         String newHome;                                                                                // To hold the new home number if any
         String newWork;                                                                                // To hold the new work number
         String newCell;                                                                                // To hold the new cell number
         final int MAX_LENGTH = 10;
         public boolean addToPhoneList;                                                            // Sets to false if there is an invalid entry
         public boolean addToSearchList;                                                            // Sets to false if there is an invlid search
         public boolean modifyContact;                                                            // Sets to false if there is an invalid modification
         // Method to create a new contact
         public void createNew()
         {// Start of create new()
              addToPhoneList = true;                                                                 // Set boolean to true each time the method is executed
              getNewContactsName();                                                                 // Get new name
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsSurname();                                                            //Get new surname
              if(addToPhoneList == false)
                   createNew();
                   return;
              String checkName = newName;                                                            //Creates copies to be used in the checkIfDuplicate method
              String checkSurname = newSurname;
              addToPhoneList = checkIfDuplicate(checkName, checkSurname);                    //Check if the entries are duplicate
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsHomeNum();                                                            // Get new home number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsWorkNum();                                                            // Get new work number
              if(addToPhoneList == false)
                   createNew();
                   return;
              getNewContactsCellNum();                                                            // Get new cell number
              if(addToPhoneList == false)
                   createNew();
                   return;
              checkAtLeastOneNumEntered();                                                       // Check that at least one phone number was entered
              if(addToPhoneList == true)
                   updateListWithNew();
         }// End of createNew()
         // Method to search for an existing contact
         public void searchExisting()
         {// Start of searchExisting()
              addToSearchList = true;                                                                 // Set the boolean true
              searchList.clear();                                                                      // Clear list from any previous searches
              if(phoneList.size() > 0)                                                            // Check if any contacts are in the list
                   getExistingDetailsAndSearch();                                                  // If there are entries then continue to search
              else
                   JOptionPane.showMessageDialog(null,"There are no contacts to search for. Please use this option when you have added a contact to the list.","Error",JOptionPane.ERROR_MESSAGE);
         }// End of searchExisting()
         // Method to modify an existing contact
         public void modifyExisting()
         {// Start of modifyExisting()
              modifyContact = true;                                                                 // Set the boolean to true
              if(phoneList.size() <= 0)                                                            // Check if the phonelist is not empty
                   JOptionPane.showMessageDialog(null,"There are no contacts to modify. Please use this option when there have been contacts added to the list.","Error",JOptionPane.ERROR_MESSAGE);
              else
                   getExistingDetailsAndModify();                                                  // If phonelist not emty continue to modify method
         }// End of modifyExisting()
         //Method to delete a contact from the list
         public void deleteExisting()
         //Method to get new contacts name
         public void getNewContactsName()
              newName = JOptionPane.showInputDialog("Please enter the new contacts name or press cancel to exit without saving.");
              if(newName == null)
                   finish();
              if(newName.trim().length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
                   return;
              addToPhoneList = checkLengthValid(newName, "name");
         //Method to get a new contacts surname
         public void getNewContactsSurname()
              newSurname = JOptionPane.showInputDialog("Please enter the new contacts surnname or press cancel to exit without saving.");
              if(newSurname == null)
                   finish();
              addToPhoneList = checkLengthValid(newSurname, "surname");
         //Method to get a new contacts home number
         public void getNewContactsHomeNum()
              newHome = JOptionPane.showInputDialog("Please enter the new contacts home number or press cancel to exit without saving.");
              if(newHome == null)
                   finish();
              if(newHome.trim().length() > 0)
                   try
                        Long homeNum = Long.parseLong(newHome);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid phone number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newHome, "home number");
         //Method to get a new contacst work number
         public void getNewContactsWorkNum()
              newWork = JOptionPane.showInputDialog("Please enter the new contacts work number or press cancel to exit without saving");
              if(newWork == null)
                   finish();
              if(newWork.trim().length()> 0)
                   try
                        Long workNum = Long.parseLong(newWork);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newWork, "work number");
         //Method to get a new contacts cell number
         public void getNewContactsCellNum()
              newCell = JOptionPane.showInputDialog("Please enter the new contacts cell number or press cancel to exit without saving");
              if(newCell == null)
                   finish();
              if(newCell.trim().length() > 0)
                   try
                        Long cellNum = Long.parseLong(newCell);
                   catch(Exception e)
                        JOptionPane.showMessageDialog(null,"You may only use numbers for a valid number. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                        addToPhoneList = false;
                        return;
              addToPhoneList = checkLengthValid(newCell, "cell number");
         //Method to get the details for an existing contact
         public void getExistingDetailsAndSearch()
              String existingName = getExistingName("search for");
              if(existingName == null)
                   addToSearchList = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   addToSearchList = false;
                   searchExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(addToSearchList == true)
                   searchAndAddIfFound(existingName, existingSurname);
         //Method to get existing details and modify contact
         public void getExistingDetailsAndModify()
              String existingName = getExistingName("modify");
              if(existingName == null)
                   modifyContact = false;
                   return;
              if(existingName.length()<=0)
                   JOptionPane.showMessageDialog(null,"You have not entered a name please try again","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   modifyExisting();
              String existingSurname = getExistingSurname();
                   if(existingSurname == null)
                        return;
              if(modifyContact == true)
                   getContactBySearch(existingName.trim().toUpperCase(), existingSurname.trim().toUpperCase());
         //Method to get the contact from list and modify details
         public void getContactBySearch(String currentName, String currentSurname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if((cd.name.equals(currentName))&&(cd.surname.equals(currentSurname)))
                        numFound ++;
                        changeDetails(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts matching the name and surname you entered found. Press the modify button to try again.","Information",JOptionPane.INFORMATION_MESSAGE);
         //Method to get existing contacts name
         public String getExistingName(String whatWasClicked)
              String name = JOptionPane.showInputDialog("Please enter the contacts name that you wish to "+whatWasClicked);
              return name;
         //Method to get an existing contacts surname
         public String getExistingSurname()
              String surname = JOptionPane.showInputDialog("Please enter the contacts surname.");
              return surname;
         //Method to change the details of contact
         public void changeDetails(ContactDetails conToChange)
              String currentName = conToChange.name;
              String currentSurname = conToChange.surname;
              String currentHome = conToChange.home;
              String currentWork = conToChange.work;
              String currentCell = conToChange.cell;
              String newNameForContact = getNewModName(currentName);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newSurnameForContact = getNewModSurname(currentSurname);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newHomeForContact = getNewModHome(currentHome);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newWorkForContact = getNewModWork(currentWork);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              String newCellForContact = getNewModCell(currentCell);
              if(modifyContact == false)
                   modifyExisting();
                   return;
              if(modifyContact == true)
                   conToChange.name = newNameForContact;
         //Method to get the modified name
         public String getNewModName(String currentName)
              String newModifiedName = JOptionPane.showInputDialog("Please enter the new name for contact or press cancel to keep it as is.");
              if(newModifiedName == null)
                   return currentName;
              if(newModifiedName.trim().length() <= 0)
                   JOptionPane.showMessageDialog(null,"You may not replace the existing name with a blank name. Please try again.","Error",JOptionPane.ERROR_MESSAGE);
                   modifyContact = false;
                   return currentName;
              modifyContact = checkLengthValid(newModifiedName, "modified name");
              return newModifiedName;
         //Method to get the modified surname
         public String getNewModSurname(String currentSurname)
              String newModifiedSurname = JOptionPane.showInputDialog("Please enter the new surname for the contact or press cancel to keep it as is.");
              if(newModifiedSurname == null)
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              if(modifyContact == false)
                   JOptionPane.showMessageDialog(null,"Surname not changed.","Information",JOptionPane.INFORMATION_MESSAGE);
                   return currentSurname;
              modifyContact = checkLengthValid(newModifiedSurname, "modified surname");
              return newModifiedSurname;
         //Method to search and update the list with a succesfull search
         private void searchAndAddIfFound(String name, String surname)
              int count = 0;
              int numFound = 0;
              for(ContactDetails cd: phoneList)
                   cd = phoneList.get(count);
                   if(cd.name.equals(name.trim().toUpperCase()))
                        numFound ++;
                        searchList.add(cd);
                   count ++;
              if(numFound <= 0)
                   JOptionPane.showMessageDialog(null,"No contacts were found matching the dat you entered.","Information",JOptionPane.INFORMATION_MESSAGE);
              else
                   list.clear();
                   list.addAll(searchList);
         //Method that check all entries are a valid logical length
         //Method is based on assumption that a normal name, surname, and phone numbers are not longer than 10 characters long.
         //IF This method is changed please change the layout in the GUI as this is also set to fit with the layout that gives a neat //apperance
         private boolean checkLengthValid(String detailEntered, String whatWasEntered)
              boolean validLength = true;
              if(detailEntered.trim().length() >= MAX_LENGTH)
                   JOptionPane.showMessageDialog(null,"The " +whatWasEntered+" you entered is too long. Please try again and use a "+whatWasEntered+" that is less than "+MAX_LENGTH+" characters long.","Error",JOptionPane.ERROR_MESSAGE);
                   validLength = false;
              return validLength;
         private void finish()
              System.exit(0);
         //Method to update the list with a new entry
         private void updateListWithNew()
              try
                   ContactDetails cd = new ContactDetails();
                   cd.name = newName.trim().toUpperCase();
                   cd.surname = newSurname.trim().toUpperCase();
                   cd.home = newHome.trim();
                   cd.work = newWork.trim();
                   cd.cell = newCell.trim();
                   phoneList.add(cd);
                   JOptionPane.showMessageDialog(null,"Contact succesfully entered. To save this change press exit to save or use the save option in the toolbar menu.","Information",JOptionPane.INFORMATION_MESSAGE);
              catch(Exception e)
                   JOptionPane.showMessageDialog(null,"Failed to add contact to list. If problem persists please contact the software developer.","Error",JOptionPane.ERROR_MESSAGE);
              list.clear();
              list.addAll(phoneList);
         //Method to check for duplicate
         public boolean  checkIfDuplicate(String nameToCheck, String surnameToCheck)
              int count = 0;
              boolean valid = true;
              for(ContactDetails cd : phoneList)
                   cd = phoneList.get(count);
                   if(((nameToCheck.trim().toUpperCase()).equals(cd.name))&&((surnameToCheck.trim().toUpperCase()).equals(cd.surname)))
                        JOptionPane.showMessageDialog(null,"You may not enter a duplicate contact. Please try again and change the name and surname.","Error",JOptionPane.ERROR_MESSAGE);
                        valid = false;
                        break;
                   count ++;
              return valid;
         //Method to check that at least one phone number exists for contact
         public void checkAtLeastOneNumEntered()
              if((newHome.trim().length()<=0)&&(newWork.trim().length()<=0)&&(newCell.trim().length()<=0))
                   JOptionPane.showMessageDialog(null,"You have not entered any phone number at all. You must enter at least one phone number for a new contact.","Error",JOptionPane.ERROR_MESSAGE);
                   addToPhoneList = false;
         //Method that returns the list to the GUI
         public ArrayList<ContactDetails> getList()
              return list;
    }

    Should I start over from scratch? Can I get help with links to tutorials on following? How to create a java CRUD application (google not useful) and how to layer in java(google not useful)
    This is my pres layer as is is this wrong too?
         Filename:     ContactsListInterface.java
         Date:           16 March 2008
         Programmer:     Yucca Nel
         Purpose:     Provides a GUI for entering names and contact numbers into a telephone directory.
                        Also allows options for searching for a specific name and deleting of data from the record
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.io.*;
    import java.util.*;
    import java.text.*;
    public class Phonebook1 extends JFrame implements ActionListener
    { //start of class
         // construct fields, buttons, labels,text boxes, ArrayLists etc
         JTextPane displayPane = new JTextPane();
         JLabel listOfContacts = new JLabel("List Of Contacts");               // creates a label for the scrollpane
         JButton createButton = new JButton("Create");
         JButton searchButton = new JButton("Search");
         JButton modifyButton = new JButton("Modify");
         JButton deleteButton = new JButton("Delete");
         Contact c = new Contact();
         ArrayList<ContactDetails> contactList = c.getList();
         // create an instance of the ContactsListInterface
         public Phonebook1()
         { // start of cli()
              super("Phonebook Interface");
         } // end of cli()
         public JMenuBar createMenuBar()
         { // start of the createMenuBar()
              // construct and populate a menu bar
              JMenuBar mnuBar = new JMenuBar();                              // creates a menu bar
              setJMenuBar(mnuBar);
              JMenu mnuFile = new JMenu("File",true);                         // creates a file menu in the menu bar which is visible
                   mnuFile.setMnemonic(KeyEvent.VK_F);
                   mnuFile.setDisplayedMnemonicIndex(0);
                   mnuFile.setToolTipText("File Options");
                   mnuBar.add(mnuFile);
              JMenuItem mnuFileExit = new JMenuItem("Save And Exit");     // creates an exit option in the file menu
                   mnuFileExit.setMnemonic(KeyEvent.VK_X);
                   mnuFileExit.setDisplayedMnemonicIndex(1);
                   mnuFileExit.setToolTipText("Close Application");
                   mnuFile.add(mnuFileExit);
                   mnuFileExit.setActionCommand("Exit");
                   mnuFileExit.addActionListener(this);
              JMenu mnuEdit = new JMenu("Edit",true);                         // creates a menu for editing options
                   mnuEdit.setMnemonic(KeyEvent.VK_E);
                   mnuEdit.setDisplayedMnemonicIndex(0);
                   mnuEdit.setToolTipText("Edit Options");
                   mnuBar.add(mnuEdit);
              JMenu mnuEditSort = new JMenu("Sort",true);                    // creates an option for sorting entries
                   mnuEditSort.setMnemonic(KeyEvent.VK_S);
                   mnuEditSort.setDisplayedMnemonicIndex(0);
                   mnuEdit.add(mnuEditSort);
              JMenuItem mnuEditSortByName = new JMenuItem("Sort By Name");          // to sort entries by name
                   mnuEditSortByName.setMnemonic(KeyEvent.VK_N);
                   mnuEditSortByName.setDisplayedMnemonicIndex(8);
                   mnuEditSortByName.setToolTipText("Sort entries by first name");
                   mnuEditSortByName.setActionCommand("Name");
                   mnuEditSortByName.addActionListener(this);
                   mnuEditSort.add(mnuEditSortByName);
              JMenuItem mnuEditSortBySurname = new JMenuItem("Sort By Surname");     // to sort entries by surname
                   mnuEditSortBySurname.setMnemonic(KeyEvent.VK_R);
                   mnuEditSortBySurname.setDisplayedMnemonicIndex(10);
                   mnuEditSortBySurname.setToolTipText("Sort entries by surname");
                   mnuEditSortBySurname.setActionCommand("Surname");
                   mnuEditSortBySurname.addActionListener(this);
                   mnuEditSort.add(mnuEditSortBySurname);
              JMenu mnuHelp = new JMenu("Help",true);                                        // creates a menu for help options
                   mnuHelp.setMnemonic(KeyEvent.VK_H);
                   mnuHelp.setDisplayedMnemonicIndex(0);
                   mnuHelp.setToolTipText("Help options");
                   mnuBar.add(mnuHelp);
              JMenuItem mnuHelpHelp = new JMenuItem("Help");                              // creates a help option for help topic
                   mnuHelpHelp.setMnemonic(KeyEvent.VK_P);
                   mnuHelpHelp.setDisplayedMnemonicIndex(3);
                   mnuHelpHelp.setToolTipText("Help Topic");
                   mnuHelpHelp.setActionCommand("Help");
                   mnuHelpHelp.addActionListener(this);
                   mnuHelp.add(mnuHelpHelp);
              JMenuItem mnuHelpAbout = new JMenuItem("About");                         // creates a about option for info about api
                   mnuHelpAbout.setMnemonic(KeyEvent.VK_T);
                   mnuHelpAbout.setDisplayedMnemonicIndex(4);
                   mnuHelpAbout.setToolTipText("About this program");
                   mnuHelpAbout.setActionCommand("About");
                   mnuHelpAbout.addActionListener(this);
                   mnuHelp.add(mnuHelpAbout);
              return mnuBar;
         } // end of the createMenuBar()
         // create the content pane
         public Container createContentPane()
         { // start of createContentPane()
              //construct and populate panels and content pane
              JPanel labelPanel = new JPanel(); // panel is only used to put the label for the textpane in
                   labelPanel.setLayout(new FlowLayout());
                   labelPanel.add(listOfContacts);
              JPanel displayPanel = new JPanel();// panel is used to display all the contacts and thier numbers
                   setTabsAndStyles(displayPane);
                   displayPane = addTextToTextPane();
                   displayPane.setEditable(false);
              JScrollPane scrollPane = new JScrollPane(displayPane);
                   scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // pane is scrollable vertically
                   scrollPane.setWheelScrollingEnabled(true);// pane is scrollable by use of the mouse wheel
                   scrollPane.setPreferredSize(new Dimension(400,320));
              displayPanel.add(scrollPane);
              JPanel workPanel = new JPanel();// panel is used to enter, edit and delete data
                   workPanel.setLayout(new FlowLayout());
                   workPanel.add(createButton);
                        createButton.setToolTipText("Create a new entry");
                        createButton.addActionListener(this);
                   workPanel.add(searchButton);
                        searchButton.setToolTipText("Search for an entry by name number or surname");
                        searchButton.addActionListener(this);
                   workPanel.add(modifyButton);
                        modifyButton.setToolTipText("Modify an existing entry");
                        modifyButton.addActionListener(this);
                   workPanel.add(deleteButton);
                        deleteButton.setToolTipText("Delete an existing entry");
                        deleteButton.addActionListener(this);
              labelPanel.setBackground(Color.red);
              displayPanel.setBackground(Color.red);
              workPanel.setBackground(Color.red);
              // create container and set attributes
              Container c = getContentPane();
                   c.setLayout(new BorderLayout(30,30));
                   c.add(labelPanel,BorderLayout.NORTH);
                   c.add(displayPanel,BorderLayout.CENTER);
                   c.add(workPanel,BorderLayout.SOUTH);
                   c.setBackground(Color.red);
              // add a listener for the window closing and save
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing(WindowEvent e)
                             int answer = JOptionPane.showConfirmDialog(null,"Are you sure you would like to save all changes and exit?","File submission",JOptionPane.YES_NO_OPTION);
                             if(answer == JOptionPane.YES_OPTION)
                                  System.exit(0);
              return c;
         } // end of createContentPane()
         protected void setTabsAndStyles(JTextPane displayPane)
         { // Start of setTabsAndStyles()
              // set Font style
              Style fontStyle = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
              Style regular = displayPane.addStyle("regular", fontStyle);
              StyleConstants.setFontFamily(fontStyle, "SansSerif");
              Style s = displayPane.addStyle("bold", regular);
              StyleConstants.setBold(s,true);
         } // End of setTabsAndStyles()
         public JTextPane addTextToTextPane()
         { // start of addTextToTextPane()
              int numberOfEntries = contactList.size();
              int count = 0;
              Document doc = displayPane.getDocument();
              try
              { // start of tryblock
                   // clear previous text
                   doc.remove(0,doc.getLength());
                   // insert titles of columns
                   doc.insertString(0,"NAME\tSURNAME\tHOME NO\tWORK NO\tCELL NO\n",displayPane.getStyle("bold"));
                   for(ContactDetails cd : contactList)
                        cd = contactList.get(count);
                        doc.insertString(doc.getLength(),cd.name+"\t"+cd.surname+"\t"+cd.home+"\t"+cd.work+"\t"+cd.cell+"\n",displayPane.getStyle("regular"));
                        count ++;
              } // end of try block
              catch(BadLocationException ble)
              { // start of ble exception handler
                   System.err.println("Could not insert text.");
              } // end of ble exception handler
              return displayPane;
         } // end of addTextToTextPane()
         // code to process user clicks
         public void actionPerformed(ActionEvent e)
         { // start of actionPerformed()
              String arg = e.getActionCommand();
              // user clicks create button
              if(arg.equals("Create"))
                   c.createNew();                                                  // method to create a new Contact
                   addTextToTextPane();
              if(arg.equals("Search"))
                   c.searchExisting();                                             // method to search for an existing entry
                   addTextToTextPane();
              if(arg.equals("Modify"))
                   c.modifyExisting();                                             // method to modify contact
                   addTextToTextPane();
              if(arg.equals("Delete"))
                   c.deleteExisting();
                   addTextToTextPane();
              if(arg.equals("Exit"))
         } // end of actionPerformed()
         // method to create a new contact
         public static void main(String[] args)
         { // start of main()
              // Set look and feel of interface
              try
              { // start of try block
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
              } // end of try block
              catch(Exception e)
              { // start of catch block
                   JOptionPane.showMessageDialog(null,"There was an error in setting the look and feel of this application","Error",JOptionPane.INFORMATION_MESSAGE);
              } // end  of catch block
              Phonebook1 pb = new Phonebook1();
              pb.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
              pb.setJMenuBar(pb.createMenuBar());
              pb.setContentPane(pb.createContentPane());
              pb.setSize(520,500);
              pb.setVisible(true);
              pb.setResizable(false);
         } // end of main()
    } //end of class

  • My iphone 4 wont turn on unless its on charge, but i need ios 6 update? whilst its on charge it says i have to connect to itunes but the phone turns off before i have plugged it in the computer

    NEED HELP UPDATING
    MY PHONE WONT TURN ON ONLY WHILE IT ON CHARGE
    BUT I NEED IOS 6 UPDATE

    Hello, chloea_2012. 
    Thank you for using Apple Support Communities. 
    Here are a couple articles that will help troubleshoot this issue. 
    iOS: Unable to update or restore
    http://support.apple.com/kb/HT1808
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    If you receive any error messages while updating your iOS device, this article provides some helpful troubleshooting steps. 
    iTunes: Specific update-and-restore error messages and advanced troubleshooting
    http://support.apple.com/kb/TS3694
    Regards,
    Jason H. 

  • After installing Leopard, my G4 will no longer boot in OS 9.22. (Classic still works, but I need it to boot in OS 9.)  Any clues about what the Leopard installer might have done to my machine that rendered OS 9 boot unusable? What can I do to fix it?

    After installing Leopard, my G4 will no longer boot in OS 9.22.
    (Classic still works, but I need it to boot in OS 9.)
    Any clues about what the Leopard installer might have done to my machine that rendered OS 9 boot unusable? (And what can I do to fix it?)
    Details:
    G4 Gigabit Ethernet
    Boot ROM version: 4.2.8fl
    Accelerator card added: 1.6 MHz
    1.5 Gig Ram
    I have erased the partition that had Leopard installed on it.
    I zapped the pram.
    In Open Firmware, I "reset-nvram", and then "reset-all"
    I tried to reinstall G4 FW Update 4.2.8, but that must be done when booted from OS 9, and of course, that's the problem: it won't boot into 9.
    I tried restarting from 9.2.1 DVD.
    I tried restarting from an external firewire drive containing OS 9.2.2.
    I tried moving a fresh OS 9.2.2 system folder into an empty partition on an internal hard drive. (Partition was created WITH OS 9 drivers installed.)
    All attempts to boot into OS 9 give me the same results - grey screen - no spinning beach ball, no icons or logos - just a blank grey screen.
    This machine still works fine in OS 10.3 and 10.4, and it worked fine for many years booting into OS 9, until I installed Leopard, and I haven't been able to boot into OS 9 since then, although I have done considerable research online and tried many things.
    I have since learned that this machine does not support Leopard - 10.5. Fine, but how did it break 9.2.2?
    Any help greatly appreciated.

    Thanks for checking in, BDAQua.
    Problem solved.
    In the docs that came with my Powerlogix accelerator card, I found this sentence buried:
    "If you reset the PRAM, the NVRAM code for OS9 compatibility is cleared, so you will have to boot from the Firmawre Update CD and perform this process again in order to boot in OS9."
    The "process" it's referring to is the process of setting up the NVRAM for booting into OS9 from the CD.
    Fortunately, I was able to find the disk, and it worked as expected. I can now, once again boot into OS9.
    Conclusion: My (unadvised) attempt to load Leopard on this old machine apparently reset the PRAM on the accelerator card and cleared the NVRAM code for OS9 boot. Although I did attempt to reset the NVRAM via Open Firmware, it did not reset it on the accelerator card.
    So, thank you BDAQua, for your "Ah yes" . . . that's all I needed to steer me in the right direction.
    Gratefully,
    tupester

Maybe you are looking for

  • Read AVI Example.vi error #107439597​5

    I was trying to run the  Read AVI Example.vi with those avi files shipped within Vision package. But no success. While the CompressorComparison.avi showed "Error -1074395993 occurred at IMAQ AVI Open File I/O error.", all the others stated "Error -10

  • OINM not balancing to trial balance (JDT1)

    I have written a report that produces sales and purchases per item from the OINM table using the InQty, OutQty and Price fields.  The quantities are 100% correct but if I compare the total sales figure to the trial balance figures I get different res

  • Report : To display VBRP details based on BSID Records

    Dear All,        I have to display the Item details from VBRP based on the BSID Table. So Now I am selecting the VBRP details based on the VBELN in BSID. But For some BSID records there is no vbeln value. Then 1 )  How can I display the item details

  • Can you run continuous queries via Java Extend

    I currently am access a Coherence cluster via a Java Extend proxy. All seems fine but I do not see any events coming back from a CQ. I do when using a simple cache listener though. Does Extend support CQ's or am I doing something stupid? The code is

  • "block change tracking" equivalent in sql server

    Hi All, If someone has expertise in both oracle and sql server, pls let me know if there is " block change tracking" equivalent in sql server. I know sql server has incremental/differential backup, curious to know whether it got this equivalent featu