Please can someone tell me why I am getting this error?

I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
*private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
setSquare();
But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()

drew22299 wrote:
I want to call a method (setSquare()) when a JLabel is clicked by the user, the following code should work:
*private void grid11MouseClicked(java.awt.event.MouseEvent evt) {*
setSquare();
But I get this error, please can someone tell me what this means? The method is already defined in the class and I have imported javax.swing etc
Frame.java:181: setSquare(javax.swing.JLabel) in p1.Frame cannot be applied to ()
As i dont know what that method needs i can't help you there but i do know you cannot leave it blank. Try adding a number/text whatever or null and see what it does. or check the api and take a look what it needs.
Edited by: deAppel on Oct 31, 2007 10:35 PM

Similar Messages

  • Can someone tell me why i am getting this error

    helo, I am trying to write 3 seperate classes and use inheritence between them, a small brek down is class Thought is suppose to have a method messege that prints out "I'm a teacher" and slass Advice is suppose to be a subclass of Thought and suppose to have the same method ut to print out "I'm your student" and class Message is suppose to have a main method that instantiates the two other classes and makes them work. I have written the code, this should have been simple, but these are the errors i am getting when compiling Messeges:
    Messages.java [14:1] variable thought might not have been initialized
    output =thought.Message() + "\n" +advice.Message();
    ^
    Messages.java [14:1] variable advice might not have been initialized
    output =thought.Message() + "\n" +advice.Message();
    Here is the code"
    public class Thought{
    protected String message="";
    public String Message()
        message="I'm a teacher.";
        return message;
    }//end class
    public class Advice extends Thought{
    private String message="";
    public String Message()
    message="I'm your student.";
        return message;
    }//end class
    import javax.swing.JOptionPane;
    public class Messages
        public static void main(String args[])
    Thought thought;
    Advice advice;
    String output="";
    output =thought.Message() + "\n" +advice.Message();
    JOptionPane.showMessageDialog(null,output,"Inheritence",
    JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
    }//end main
    }//end classAny help would be appreciated.

    Hi,
    I had gone through the code you have posted and I agree with atmguy that the errors that were thrown were due to the fact that you have not initialized the objects from the main method. You have to use the new keyword to inityialize the objects that you are creating.
    Secondly you have stated that you have used inheritance and created three classes. But I find that the inheritance has not been practised at all. Try removing the "extends Thought" portion and then also your code would work just fine. It is as good as creating two seprate classes and using them from a third containing the main function. Hope this clears all your querries.
    cheers
    Aviroop

  • Can someone tell me why we are getting this error message when users try to open?

    It was created in LiveCycle and Reader Extensions were given before posting it to the website.  Normally if you open in Firefox or IE, it will work (sometimes).

    We would also really appreciate an answer to this question.  We are having the exact same issue with some new forms we have created.  They were created in Adobe LiveCycle Designer ES4, and then usage rights were extended in Adobe Acrobat XI Pro. 
    When this issue is encountered we send the old version of the form, it was created using the same process a number of years ago, so the only difference is that we were using older versions of both programs.  The same recipients who have an issue with the new form are always able to open the old forms.
    Help!  Does anyone have a solution. Thanks very much!

  • Can anyone tell me why I'm getting this error when trying to make visibility variables

    I have set these up in previous versions of Illustrator. CS and illustrator 10 worked just fine with Variables. Now I can't seem to switch between data sets. I just keep getting this error when I try to switch from one data set to another.

    I'll start with the permissions and see if it changes the behavior.

  • Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

  • Can anyone tell me why i'm getting this: java.lang.NullPointerException

    Please lend me your expertise.I hava a feeling its got something to
    do with the session.When I run the servlet I get this error:
    java.lang.NullPointerException
         at ConnectionPerClient.doGet(connectionperclient.java:85)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:475)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
         at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
         at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
         at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
         at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)
         at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)
         at java.lang.Thread.run(Thread.java:484)
    Here is my code:
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    class ConnectionHolder implements HttpSessionBindingListener
    private Connection con = null;
    public ConnectionHolder(Connection con)
    this.con = con;
    try
    con.setAutoCommit(false);
    catch(SQLException e)
    public Connection getConnection()
    return con;
    public void valueBound(HttpSessionBindingEvent event)
    public void valueUnbound(HttpSessionBindingEvent event)
    try
    if(con!=null)
    con.rollback();
    con.close();
    catch(SQLException e)
    public class ConnectionPerClient extends HttpServlet
    public void init(ServletConfig config)throws ServletException
    super.init(config);
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    catch(ClassNotFoundException e)
    public void doGet(HttpServletRequest req, HttpServletResponse res)throws ServletException, IOException
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    HttpSession session = req.getSession(true);
    ConnectionHolder holder = (ConnectionHolder) session.getAttribute("servletapp.connection");
    if(holder == null)
    try
    holder = new ConnectionHolder(DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:macha","username","password"));
    session.setAttribute("servletapp.connection",holder);
    catch(SQLException e)
    Connection con = holder.getConnection();
    try
    Statement stmt = con.createStatement();
    ResultSet rs = stmt.executeQuery("SELECT * FROM david.Emp");
    //Print start of table and column headers
    out.println("<TABLE CELLSPACING=\"0\" CELLPADDING=\"3\" BORDER=\"1\">");
    out.println("<TR><TH>EMPNO</TH><TH>ENAME</TH><TH>JOB</TH><TH>SAL</TH></TR>");
    //Loop through results of query.
    while(rs.next())
    out.println("<TR>");
    out.println(" <TD>" + rs.getString("EMPNO") + "</TD>");
    out.println(" <TD>" + rs.getString("ENAME") + "</TD>");
         out.println(" <TD>" + rs.getString("JOB") + "</TD>");
    out.println(" <TD>" + rs.getString("SAL") + "</TD>");
    out.println("</TR>");
    out.println("</TABLE>");
    catch(SQLException e)
    out.println("SQLException: " + e.getMessage() + "<BR>");
    while((e = e.getNextException()) != null)
    out.println(e.getMessage() + "<BR>");
    finally
    //Clean up resources, close the connection.
    if(con != null)
    try
    con.close();
    catch (Exception ignored) {}

    Take this code:
    ConnectionHolder holder = (ConnectionHolder) session.getAttribute("servletapp.connection");
    if(holder == null)
    try
    holder = new ConnectionHolder(DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:macha","username","password"));
    session.setAttribute("servletapp.connection",holder);
    catch(SQLException e)
    }and change it to:
    ConnectionHolder holder = (ConnectionHolder) session.getAttribute("servletapp.connection");
    if(holder == null)
    try
    holder = new ConnectionHolder(DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:macha","username","password"));
    session.setAttribute("servletapp.connection",holder);
    catch(SQLException e)
        e.printStackTrace(); // THIS IS THE LINE TO ADD IN

  • This should work but it doesn�t Please can someone tell me why !!!

    I have really trid to get this code to work.
    Please an some help me with find out why it will not work.
    void NewShoeOrderjButton_actionPerformed(ActionEvent e) {
       String check = TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+" "+LastNameJText.getText();
       if (check !=null){
        return ;
        else
        String[] options = {"Yes", "Cancel"};
        String d= System.getProperty("line.separator");
        int result = JOptionPane.showOptionDialog(null,
            "Do you really want to add a new shoe order for:"+ d +
            (String) TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+
            " "+LastNameJText.getText(),"New Order",
            JOptionPane.YES_OPTION,
            JOptionPane.INFORMATION_MESSAGE,
            null,
            options,
            options[0]);
        switch(result){
          case JOptionPane.YES_OPTION: // Add your code for no
            setFieldsEditable(false);
            break;
          case JOptionPane.NO_OPTION: // Add your code for yes
            // just playing with button
            setFieldsEditable(true);
            break;
      if
        (check ==null){
        return ;
        else{
          JOptionPane.showMessageDialog( null,
                                          "There is no order", "No Order",
                                         JOptionPane.WARNING_MESSAGE);
      }

    Thank you for taking the time mate ;)
    This is he code changed with your code.
    when the title,first &last name is null it still only runs the 1st JOptionPanel and dosn't pass to the 2nd ??
    here is the code
      void NewShoeOrderjButton_actionPerformed(ActionEvent e) {
        String check=null;
        if(TitleComboBox.getSelectedItem() != null &&
           FirstNameJText.getText() != null &&
           LastNameJText.getText() != null)
          check=TitleComboBox.getSelectedItem()+FirstNameJText.getText()+LastNameJText.getText(); //the rest of the thing.......;
    //then you check "check":
        if(check != null){
          //show the first optionpane
          String[] options = {"Yes", "Cancel"};
          String d= System.getProperty("line.separator");
          int result = JOptionPane.showOptionDialog(null,
              "Do you really want to add a new shoe order for:"+ d +
              (String) TitleComboBox.getSelectedItem()+" "+FirstNameJText.getText()+
              " "+LastNameJText.getText(),"New Order",
              JOptionPane.YES_OPTION,
              JOptionPane.INFORMATION_MESSAGE,
              null,
              options,
              options[0]);
          switch(result){
            case JOptionPane.YES_OPTION: // Add your code for no
              setFieldsEditable(false);
              break;
            case JOptionPane.NO_OPTION: // Add your code for yes
              // just playing with button
              setFieldsEditable(true);
              break;
        }else{
          //show the second optionpane
          JOptionPane.showMessageDialog( null,
                                         "There is no order", "No Order",
                                         JOptionPane.WARNING_MESSAGE);
      }

  • Can someone tell me why I keep getting a spinning wheel on my screen and it won't go away and I can't do anything while it is there Thank you

    I keep getting a spinning wheel in colors on my screen it will not go away and when it is there, I can't do anything it is as if the computer freezes Has anyone else had this problem or can someone help me out? Thanks very much

    the wheel comes and goes, it looks like the wheel of fortune wheel if you will it has colors all around it and keeps blinking, when it is there, I can't use the computer, it freezes up

  • Please can someone tell me what's wrong in this code

    1var a=0;
    2function main(){
    3var inFolder = Folder.selectDialog("Please select folder to process");
    4//Save the Current Preferences
    5var startRulerUnits = preferences.rulerUnits;
    6preferences.rulerUnits = Units.PIXELS;
    7//Get all the files in the folder
    8var filelist=inFolder.getFiles()
    9n=filelist.length;
    10//Open each file
    11for(a=0; a<n; a++){
    12// The fileList is folders and files so open only files
    13if (fileList[a] instanceof File) {
    14open(fileList[i])
    15var docName = app.activeDocument.name;
    16app.activeDocument.flatten();
    17activedocument.save();
    18}
    19}
    20}
    21main();
    Says the error is "filelist is not recognized".    on line 14.   I thought I had fully defined 'filelist' on line8
    I thought filelist was a one-D array variable.
    Peterkal

    Also, in lines 8 and 9 you use a variable called "filelist" but in lines 13 and 14 you call it "fileList" (notice the capital-L).
    JavaScript is case-sensitive, so you must be consistent with your variable names throughout.

  • Can someone tell me why i cant get music videos on my ipod?

    i just downloaded a couple of music videos onto my computer from limewire and put it into my file in i-tunes. i can play the music videos on i-tunes but i can not transfer them to my ipod. i tried to convert them using vidoria and still i can not get them into my video ipod. i have no problems with converting dvd but dont know what i am doing wrong on the music videos? can anyone give me some direction?

    Try projecting one of the images without using Powerpoint.  Just open the original jpeg file in Preview or something.  What's the quality?  If it's good then it's likely something Powerpoint is doing to the image.  For that you'd have to ask on a Microsoft forum or be lucky and somebody here might be more familiar with Pp than I.
    I don't think it should be a matter of Mac vs Dell.  I'm not very familiar with projectors but probably by the time it is coming out of your computer it is just a video signal and people have been using non-Mac displays with Macs for 15+ years.

  • Can someone tell my why I cant get my Iphone to connect to Itunes

    Having trouble getting IPhone to connect to Itunes

    Unless you provide more details, we would just be guessing.
    Let's start with the obvious.....
    Your computer is turned on, correct?
    The iPhone is powered on, correct?
    You plugged the cable into the iPhone and the computer, correct?

  • Can't figure out why I'm getting this error on New-ADUser

    The command is:
    New-ADUser –SamAccountName “TestProvider” -UserPrincipalName "[email protected]” -GivenName “Test” -Surname “Provider” -DisplayName “Test Provider” -Name "Test Provider" -Enabled $true -path “ou=CompanyName,ou=Users,ou=Providers,DN=intranet,DN=CompanyName,DN=com” -AccountPassword (ConvertTo-SecureString "TEST123test" -AsPlainText -force) -PasswordNeverExpires $True
    The error is: 
    New-ADUser : No superior reference has been configured for the directory service. The directory service is therefore un
    able to issue referrals to objects outside this forest
    At line:1 char:11
    + New-ADUser <<<< -SamAccountName "TestProvider" -UserPrincipalName "[email protected]" -GivenName "Test" -
    Surname "Provider" -DisplayName "Test Provider" -Name "Test Provider" -Enabled $true -path "ou=CompanyName,ou=Users,ou=
    Providers,DN=intranet,DN=CompanyName,DN=com" -AccountPassword (ConvertTo-SecureString "TEST123test" -AsPlainText -force
    ) -PasswordNeverExpires $True
    + CategoryInfo : NotSpecified: (CN=Test Provide...panyName,DN=com:String) [New-ADUser], ADException
    + FullyQualifiedErrorId : No superior reference has been configured for the directory service. The directory servi
    ce is therefore unable to issue referrals to objects outside this forest,Microsoft.ActiveDirectory.Management.Comm
    ands.NewADUser
    I think it has something to do with the way I'm specifying the "path" but i'm not sure.
    The user should be created in an OU: CompanyName > Users > Providers
    The domain is intranet.companyname.com

    Hi,
    Instead of ou=CompanyName,ou=Users,ou=Providers,DN=intranet,DN=CompanyName,DN=com, try ou=CompanyName,ou=Users,ou=Providers,DC=intranet,DC=CompanyName,DC=com.
    Don't retire TechNet! -
    (Don't give up yet - 12,700+ strong and growing)

  • Plerase can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I

    Please can someone tell me why I cannot reinstall my upgrade from lightroom 4 (lightroom 3 installed off disc with serial no) my hard drive crashed, and I am trying to get lightroom 3; 4 and 5 back on so that I can link my catalogues and continue work. I cannot install lightroom 5 until the upgrades from 4 are on the pc, (lightroom 3 installed off disc but 4 is a copy of the upgrade download I got when I bought it) These serial no's are legit and  are registered under my account with adobe, but it still gives me the Big Red Cross when I put my serial no in! Please can someone help. I am at a loss. Thx Heidi

    BrightBluephotograph wrote:
    I cannot install lightroom 5 until the upgrades from 4 are on the pc,
    You don't need to have Lightroom 3 and 4 installed on your computer to install Lightroom 5.  Just install Lightroom 5 and input your serial number for 3 in the previous version box and your serial number for 5 in the upgrade box.

  • Please can someone tell me what cable I need to connect my Macbook Pro 15'' Retina display to a Yamakasi Catleap Monitor?

    Hi all,
    I have a Macbook Pro 15'' Retina and I'm thinking of getting a Yamaksai Catleap Monitor, please can someone tell me the best way to connect this? Do I need a thunderbolt to DVI connector, or Thunderbolt to VGA? Im assuning the former would be superior! Please can someone advise?
    Thanks very much in advance,
    Cheers,
    Guy

    Hello, 
    Some UK links... You can use any of the following to get the video signal out of the iMac and into a standard format:
    Mini DVI - DVI
    Mini DVI - VGA
    Mini DVI - Composite/S-Video.
    The DVI will give you best quality, but VGA will be simpler. The DVI to HDMI connector is:
    Buy a DVI to HDMI connector (link). Long HDMI cables are pretty expensive though.
    Although HDMI can handle sound as neither DVI, MiniDVI nor VGA do you'll need to connect the sound separately. Simply connect the sound out on the iMac to the input on the TV using a cable like this:
    3.5mm to RCA.
    If you use the miniDVI to VGA connector here's a long VGA cable (link).
    All Macs since about 1999 have had +DVD Player+ installed. I'm not at my Mac right now to check Front Row in Leopard but Front Row in Tiger certainly played DVDs (but +DVD Player+ is a better, more flexible DVD Player).
    cheers
    mrtotes

  • HT1766 i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5 but the apps do not appear to have come across, have I done something wrong?  Please can someone tell me how to move my apps

    i have moved from an iphone 4 to iphone 5 and have done a back up of my iphone 4 and restored this back up to the iphone 5, but the apps do not appear to have come across.  Have I done something wrong?  Please can someone tell me how to move my apps across?

    After you Restore from backup, sync the iPhone.

Maybe you are looking for

  • My Safari keeps crashing on me! Can someone help?

    Every time I try to open Safari, it crashes while my homepage is loading.  This started happening today.  Please help! Date/Time:  2012-01-11 09:03:26.958 -0500 OS Version: 10.4.11 (Build 8S2167) Report Version: 4 Command: Safari Path: /Applications/

  • Import WORD document with pics - half the pages are missing?

    I've got a 100 page Word document, 3 storyboard pics per page. I import it into a Pages word processing or a layout document ... and I'm missing half the pages. Random chunks have just disappeared. I wonder what this might be? Ben

  • IPhone4S Interlacing effect(dark horizontal scan lines)

    I bought an IPhone4 last year and noticed that I have faint interlacing lines on my screen.I got 2 replaced iphone,both of them have this issues. Actually,many people found this problem with their iphones.(https://discussions.apple.com/thread/3170657

  • Advance Loan

    Hello Sir, I want to create the wage type for advance loan.Can you please suggest me where i can create the wage type for advance loan.Please provide the configuration path for this. After the advance loan will be created it will be updated in offcyc

  • Dynamic Train Creation

    Hi, I have urgent requirement where i need to create the dynamic train based on the selected values. The POF for the requirement is as below: There is a shuttle component with 5 services. When the user selects 2 services and click on a command button