Why do I get this MyClass$1.class

Hello,
I have the following simple class:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class HelloJava2
extends JComponent implements MouseMotionListener {
// Coordinates for the message
int messageX = 125, messageY = 95;
String theMessage;
public HelloJava2(String message) {
theMessage = message;
addMouseMotionListener(this);
public void paintComponent(Graphics g) {
g.drawString(theMessage, messageX, messageY);
public void mouseDragged(MouseEvent e) {
// Save the mouse coordinates and paint the message.
messageX = e.getX( );
messageY = e.getY( );
repaint( );
public void mouseMoved(MouseEvent e) {}
public static void main(String[] args) {
JFrame f = new JFrame("HelloJava2");
// Make the application exit when the window is closed.
f.addWindowListener(new WindowAdapter( ) {
public void windowClosing(WindowEvent we) { System.exit(0); }
f.setSize(300, 300);
f.getContentPane( ).add(new HelloJava2("Hello, Java!"));
f.setVisible(true);
I don't understand what the file called HelloJava2$1.class comes from. There is only one class definition in the source so where does this xx$1.class file comes from?
Thanks in advance,
Balteo.

If you wrote it like this:
f.addWindowListener(new MyWindowCloser());
class MyWindowCloser extends WindowAdapter {
   public void windowClosing(WindowEvent we) {
      System.exit(0);
}then it would be more obvious where the file came from.
These are basicly the same except one can be referenced.

Similar Messages

  • Why am I getting this error?

    Hello,
    I am trying to call my Java class from a JSP page. I am getting this error:
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\em\jsp\Test_0005fSummarySBU_0005fscreen$jsp.java:82: Wrong number of arguments in constructor.
    strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
    I don't understand why I am getting this error as I pass three paramters to the Java class, and I accept three parameters in the constructor.
    JSP:
    <!-- META TAG is necessary to ensure page recompiles--------------->
    <META Http-Equiv="Expires" Content="0">
    <META Http-Equiv="Pragma" Content="no-cache">
    <HTML>
    <!-- The two Java Classes used to build the AlphaBlox query -->
    <%@ page import="com.home.tool.reporting.*" %>
    <%@ page errorPage="run_error.jsp" %>
    <%@ page import="java.util.List,
                     java.util.Collection,
                java.net.URLDecoder" %>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE>Economic Model - Summary SBU Report</TITLE>
    <!--Run the onload here, re-retrieve params BM and Breport, pass to onload---------->
    <BODY bgcolor=#ffffff>
    <%
                    Collection strQuery = null;
                    String strEssUser = "test";
                    String strProcessingMonth = "JUL";
                    String strProcessingYear = "2002";
                    strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
                    System.out.println(strQuery);
    %>
    </BODY>
    </HTML>Java class:
    package com.home.tool.reporting;
    import java.net.URL;
    import java.sql.*;
    import java.io.*;
    import java.util.*;
    public class ListReturn extends ReportQueryBuilder
            public void ListReturn()
            public Collection ListReturn(String userID, String pMonth, String pYear)
                throws ReportQueryBuilderException
                //declare Collection store Value-Object pairs
                Collection c = new ArrayList();
                //declare and initialize variables
                CallableStatement cs = null;
                ResultSet rs = null;
                // declare call for stored procedure to pass in three parameters
                String pass = "{Call dbo.p_rep_srSbuList(?, ?, ?)}";
                try
                    //open CallableStatement using JDBC connection to SQL database
                    cs = con.prepareCall(pass);
                    //set IN parameters
                    cs.setString(1, userID);
                    cs.setString(2, pMonth);
                    cs.setString(3, pYear);
                    //execute call and return result set
                    rs = cs.executeQuery();
                    //loop through result set storing each record as a Value-Object pair
                    while(rs.next())
                        c.add(new ListBoxValueObjects(rs.getString(1), rs.getString(2)));
                catch (SQLException sqle)
              throw new ReportQueryBuilderException(replaceToken("Problems executing query: "+sqle.getMessage(), "'", "\\'"));
                finally
                    try
                        //close the Result Set and CallableStatement
                        rs.close();
                        cs.close();
                    catch(Exception e)
                        System.out.print("\nFATAL   : " + e);
                        System.out.print("\nFATAL   : " + e);
                return c;
    }Does anyone see whay I am getting this error??
    I can't figure out the problem!

    change this:
    <%
         Collection strQuery = null;
         String strEssUser = "test";
         String strProcessingMonth = "JUL";
         String strProcessingYear = "2002";
         strQuery=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
         System.out.println(strQuery);
    %>To this:
    <%
         Collection strQuery=null;
         String strEssUser="test";
         String strProcessingMonth="JUL";
         String strProcessingYear="2002";
         lr=new ListReturn(strEssUser, strProcessingMonth, strProcessingYear);
         System.out.println(lr.getQuery())
    %>Then make a new public method in your Java called getQuery()
    public Collection getQuery();Do what you need to do to process it and return the value in getQuery. You will also probably need to make private variables in you declaration to do the processing on.

  • Why do I get this error when I want to run a test using Ant?

    Why do I get this error when I run the Ant build file?
    Testsuite: JUnit
    Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec
    Caused an ERROR
    JUnit
    java.lang.ClassNotFoundException: JUnit
    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:242)
    at org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
    at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
    at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)

    Abder-Rahman wrote:
    In the "XML" file, I was giving the name of the test as JUnit ---> <test name="JUnit">Well, do you have a class called just "JUnit" that contains a test?

  • TS1702 "The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    The feature you are trying to use is on a network resource that is unabailable" Why am I getting this message when I try to updaate itunes or quicktime?

    Before trying the update again, use Microsoft's Fix it solution at http://support.microsoft.com/mats/Program_Install_and_Uninstall. Use it to uninstall iTunes and Quicktime. It bypasses this not uncommon problem. When the solution finishes, the selected program will be uninstalled. It can take several minutes and I have seen as much as half an hour.
    After iTunes & Quicktime are uninstalled, try the update again.

  • I get missing plug-in error when opening my online bill which is in PDF format. I am using a 2010 Macbook with the latest version of Safari and Adobe suite installed in my computer. Why do I get this error? What should I do?

    I get missing plug-in error when opening my online bill which is in PDF format. I am using a 2010 Macbook with the latest version of Safari and Adobe suite installed in my computer. Why do I get this error? What should I do?

    In relation to my previous inquiry regarding inability to view a pdf file using Safari...
    Is it possible that I can view other online bills from other website but not this particular bill from one specific website?
    Sorry if I missed any important point in this article -->Apple Safari 5.1 and Adobe Reader/Acrobat Advisory
    Thanks again!

  • Why do I get this error message when I open Organizer in Photoshop Elements 11 "Elements Organizer has stopped working"? My only option is to Close Program so I am effectively locked out of my photo catalogue.  I have reinstalled the program to no avail.

    Why do I get this error message when I open Organizer in Photoshop Elements 11 "Elements Organizer has stopped working"? My only option is to Close Program so I am effectively locked out of my photo catalogue. I have tried reinstalling the program but it made no difference to the error message.
    Could someone help please?  Steph

    Hi,
    Please give a try to Photoshop Elements (PSE) knowledge base. steps mentioned on this and see if it works.
    Regards
    Kishan

  • Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    Why do I get this error when trying to use my bluetooth headset as a listening device? There was an error connecting to your audio device. Make sure it is turned on and in range. The audio portion of the program you were using may have to be restarted.

    I may have already resolved this issue buy removing the device from my computer and re-pairing it. It is currently working just fine.

  • I received an error "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened b4

    i received an error message "iTunes requires 64-bit mode" says to go into my iTunes application and 'uncheck' the 'open in 32-bit mode' checkbox - i went into the application and the box was not checked anyway so why am i getting this prompt?  Never happened before. yesterday did the sofware update for maverick.

    Thank you for your response, Chris. But I'm afraid I have to disagree. There are native 64 bit versions of iTunes available for OSX and Windows.
    In a 64 Bit Windows environment native 64 Bit Applications install the DLL's in a directory called "Program Files" and a directory called "Program Files (x86)" (32 Bit applications only use the ladder).
    iTunes 9 is consistent with this behavior - and it identified itself to the system as a 64 bit application (meaning it's process appears without a "*32" tag on it).

  • More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library.

    I am able to pick 4 videos from the Photo library in my iPhoneAPP but when i try to pick 5th one it throws an error:
    "More than maximum 5 filtered album lists trying to register. This will fail,Why i am getting this error when i pick video from Photo library."

    Hello Tate r Bulic
    I don't have any idea how to remove this error,can i pick more than 5 videos from the photo library...
    If it's then please help me and gimme idea..Thanks

  • According to my network provider (Amaysim/Optus) Tethering is enabled, so why do I get this error message "to enable personal hotspot on this account, contact OPTUS"

    According to my network provider (Amaysim/Optus) Tethering is enabled, so why do I get this error message "to enable personal hotspot on this account, contact OPTUS"
    Amysim/Optus support can not help.
    I can not check or change any network settings (no APN settings)
    I have synced phone using latest itunes (10.5.3).
    Phone software is up to date (5.0.1).
    Network settings have been reset.
    SIM card has been taken out and put back in.
    Phone has been switched off/on again.
    Another sim card from virgin works ok (hotspot option is visible and can be turned on/off as required)
    The Amaysim/Optus SIM card can be put into another phone (android) and tethering/hotspot works fine.
    Can anyone provide solution to this nightmare?

    I am having the same issue although i have an iphone 5. I have contacted Live connected numerous times an tried everything imaginable to solve the issue. Is it possibly a handset issue? I cant recieve any help from optus as im with live connected, they cant help me and apple keep telling me to contact your carrier ( live connected). Seems to make me want to switch providers pretty shortly..
    please let me know if you can solve your issue and maybe it can help me too..

  • Why do I get this errorThe server responded with "502" to operation CalDAVAccountRefreshQueueableOperation.

    Why do I get this message in iCal
    The server responded with
    “502”
    to operation CalDAVAccountRefreshQueueableOperation.
    And then it disappears it is very annoying, also for the mail program it gets password rejected by server. I have checked all the settings they are correct. What's the deal ATT says its me.

    Hi, is this Mail the old defunct MobileMe perchance?
    If so, do you have an iCloud account yet?
    I understand .mac mail will still come through. Do not delete the old account yet.
    You cannot use .mac or MobileMe as type of Account, you have to choose IMAP when setting up, otherwise Mail is hard coded to change imap.mail.me.com to mail.me.com & smtp.mail.me.com to smtp.me.com, no matter what you try to enter.
    iCloud Mail setup, do not choose .mac or MobileMe as type, but choose IMAP...
    On second step where it asks "Description", it has to be a unique name, but you can still use your email address.
    IMAP (Incoming Mail Server) information:
    • Server name: imap.mail.me.com
    • SSL Required: Yes
    • Port: 993
    • Username: [email protected] (use your @me.com address from your iCloud account)
    • Password: Your iCloud password
    SMTP (outgoing mail server) information:
    • Server name: smtp.mail.me.com
    • SSL Required: Yes
    • Port: 587
    • SMTP Authentication Required: Yes
    • Username: [email protected] (use your @me.com address from your iCloud account)
    • Password: Your iCloud password
    Also, you must upgrade your password to meet the new criteria:  8 characters, including upper and lower case and numbers.  If you have an older password that does not meet these criteria, when you try to setup mail on your mac, using all of the IMAP criteria listed above, it will still give a server error message.  Go to   http://appleid.apple.com         then follow directions to change your password, then go back to setting up your mail using the IMAP instructions above.
    Thanks to dpepper...
    https://discussions.apple.com/thread/3867171?tstart=0

  • Why am I getting this message Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch Server at

    Various websites say that they can not be found at the "Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch Server at ..................."
    There are many other reports on the forum from Yahoo and other sites.

    Why am I getting this message Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch Server at
    Various websites say that they can not be found at the "Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch Server at ..................."
    because I can not open my website Karimwebmall.com at this time could please fixed the problem thanks.

  • I thought that I have a yearly subscription. Why did I get this email "Expiration of your Adobe Acrobat Pro Subscription"?

    Why did I get this email "Expiration of your Adobe Acrobat Pro Subscription"?
    I'm supposed to have a yearly subscription to Adobe Acrobat Pro.

    Hi jksjcg,
    Kindly contact our chat support:http://helpx.adobe.com/x-productkb/global/service-b.html
    Regards,
    Florence

  • There was an error opening the database for the library "/Users/stacia134/Pictures/Aperture Library.aplibrary".  Why am I getting this message and how do I correct it so that I can open Aperture????  any suggestions would be most appreciated

    There was an error opening the database for the library “/Users/stacia134/Pictures/Aperture Library.aplibrary”.  Why am I getting this message and how do I correct it so that I can open Aperture????  any suggestions would be most appreciated

    Then I'd check the system drive, if it has problems.
    To check your System drive boot into the Recovery Partition, see: OS X Lion: About Lion Recovery
    Restart your Mac and hold down the Command key and the R key (Command-R), and keep holding them until the Apple icon appears, indicating that your Mac is starting up.
    You will see a panel, where you can use Disk Utility to check your System Drive.

  • Why am I getting this App Store message for the new OS: The product distribution file could not be verified. It may be damaged or was not signed.

    Why am I getting this App Store message:
    The product distribution file could not be verified. It may be damaged or was not signed.

    I had the same problem. Spoke to Apple support who directed me to Itunes support.  Frustrating to say the least.  Some have said remove virus barrier.  I did and still nothing.  Some posts have said to delete App store.  DON'T DO IT.. App store is tuff to get back.  This did work for me. Go to Finder, then go, pick go to folder, type in, /var/folder, and delete (send to trash).  There were 2 folders I had to delete, KX & XX, and as soon as I sent them to the trash they returned but I was able to download & intall Mountain Lion and working well.  Good luck..

Maybe you are looking for

  • I forgot my security question answers, but the email address they send help to is wrong.  How can I change the recovery email address?

    I forgot the answers to my security questions.  When I go to the link for help remembering my security questions it sends the email to an email address that is not mine.  And I don't know how to make it send to one of the two correct email addresses

  • IPod on iPad not connecting with appletv

    I want to play the iPod on the iPad on my apple tv but I can't get it to work.  I use the remote button to sync with The computer and then to Apple tv.  But i want to play songs from the iPad through apple tv.  I am able to click on the button for ap

  • CS5 issue - Selecting TLF text sorta freezes flash

    When I use TLF text in CS5 flash seems to use to capacity / I cannot do any clicks for around 10 secs when selecting/deselecting textfield. What could be the reason for flash slowing down so extremely? Im using WinXP, SP3 System: HP xw6600 Workstatio

  • RUN_PROD or OBJ ?

    Guys can I just confirm something with you. RUN_REPORT_OBJECT = Only/best used for calling reports in web environment. RUN_PRODUCT = Used in Client server environment. We are 8i/6i/C/S so is RUN_PRODUCT the one that we should use ? Appreciate your re

  • Windows Server push config for fax modem

    We have a new Windows 2012 R2 Server, we installed a fax modem on it and turned the fax server feature on. We were hoping to be able to share the fax as a printer and push through GPO, which being pushed but when the end user attempt to print to it i