2 error things

I was testing Listeners for fun, and I got two errors that don't make sense to me:
C:\Java>javac buttonTest.java
buttonTest.java:14: Identifier expected.
  add(myLabel);
             ^
buttonTest.java:6: Wrong number of arguments in constructor.
  pushMe myPush = new pushMe("Press Me");
                  ^
2 errorshere's the code:
import java.applet.Applet;
import java.awt.event.*;
import java.awt.*;
import java.lang.*;
public class buttonTest extends Applet {
  pushMe myPush = new pushMe("Press Me");
  public void init() {
    add(myPush);
class pushMe extends Button implements MouseListener {
  Label myLabel = new Label();
  add(myLabel);
  pushMe(String s) {
    super(s);
  public void mouseClicked(MouseEvent e) {
    myLabel.setText("Button Pressed");
  public void mouseReleased(MouseEvent e) {
  public void mousePressed(MouseEvent e) {
  public void mouseEntered(MouseEvent e) {
  public void mouseExited(MouseEvent e) {
}if anyone can explain the errors, please do.

The constructor issue is probably a scope issue. I don't exactly recall what the default modifier is for a constructor without one there... protected I think, but possibly private. Regardless though, since buttonTest cannot see that constructor, and wants to default to a no-args constructor, which isn't there. Make your constructor public, and that'll fix that.
As far as your other error, you should place the call to add(myLabel) inside your constructor if you want it to be added, but even that's unnecessary. Right now, the initial String as it's coming in is being set to your label by your call to super(). The constructor for button takes in a string, and adds a label to the button. All in all, your constructor for pushMe should look like
public pushMe(String s)
    super(s);  //Creates new button labeled with s   
}That's all folks :)

Similar Messages

  • Error thing

    Everytime my iPod tries to update songs from iTunes, it says "Unknown error [-50]" what does that mean and how can i fix it?

    Have you had a look at these troubleshooting articles?
    http://docs.info.apple.com/article.html?artnum=93434
    http://docs.info.apple.com/article.html?artnum=300870

  • What is this 205 error thing all i want to do is make cartoons is that so much to ask for i need help really bad ):

    all i want to do is make cartoons with photoshop and other programs but i cant is that to hard to ask for  ??? ): i need help very very badly

    Errors 201 & 205 & 206 & 207 or several U43 errors
    -http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html
    or
    A chat session where an agent may remotely look inside your computer may help
    Creative Cloud chat support (all Creative Cloud customer service issues)
    http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • I NEED HELP WITH KERNEL ERROR THINGS

    So...yesterday I was on the Apple website looking up why my computer shuts off randomly and I was going to download new firmwear but it said that I needed to download Mac OS X 10.4.8 first...(I have Mac OS X 10.4.6) So I started to download it and I left the room. When I came back to check on the progress it had turned off and whenever I try to turnit back on it says "You need to restart your computer. Hold down the Power button for several seconds or press the restart button" and in the background it says:
    panic(cpu 0 caller 0x0039BDDF): Unable to find driver for this platform: "ACPI".
    Debugger called: <panic>
    Backtrace, Format - Frame : Return Address (4 potential args on stack)
    0xb973e04 : 0x128b5e
    ...and a buch of other stuff and then...
    Kernel version:
    Darwin Kernel Version 8.6.2: Thur Apr 13 18:48:29 PDT 2006; root:xnu-792.9.59.obj~1/RELEASE_I386
    Can you help me get my computer to turn on again??? I've tried restarting it multiple ways and am at a loss.

    Hi,
    the XLabs have a good article on how to resolve Kernel Panics: http://www.thexlab.com/faqs/kernelpanics.html
    'Reboot while depressing C' means that you put the OSX DVD 1 that came with your Mac into the optical drive; restart your Mac from the Apple-Menu and during the restart hold down the 'C'-key on your keyboard.
    That way your Mac is not booted from the internal harddisk but from the OSX DVD.
    Good Luck
    Stefan

  • Itunes, My ipod error thing

    When I go into my iPod on itunes every category works except apps which just goes kind of grey/white and doesn't let me click anything. Can someone help?

    Hi,
    You could see if this helps...
    DFU Mode / Unable to Update or Restore
    http://support.apple.com/kb/HT1808
    DFU Mode
    Open iTunes and Connect the iPod to your Mac
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time
    After 10 Seconds release the Sleep/Wake Button until iTunes tells you it has Detected an iPod in Recovery Mode...
    The Phone Screen will remain Black... Now Restore.
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • How come when i try to update ipod2g 3.1.3 to 4.2 in itunes an error occurs and itunes shuts down?

    OKAY SO EVERYTIME I TRY TO UPDATE MY IPOD TOUCH 2ND GENERATION iOS 3.1.3 TO THE LATEST IN ITUNES WHICH IS 4.2 . i start the download and during the download my computer bring up one of those error things where you click send report or dont send report and i click send report and itunes shuts down i have tried everyhing clicking the restore button update button, even doing the shift and trying to update to 4.0 . nothing seems to work i cant get facebook, twitter, or any app that requires 3.2 & higher.  AND YES I AM SURE THAT I HAVE AN IPOD TOUCH 2G AND MY IOS IS  3.1.3 ... WHAT DO I DO SOMEONE PLEASE HELP.. I DONT KNOW WHAT TO DO AND I HAVE THE LATEST ITUNES 10.6 I EVEN TRIED GETTING 10.X TO SEE IF THAT WORKS IT DIDNT..... AND ALSO WHEN I TRIED TO DO THE SHIFT THING I GOT ERROR 3194 IF I FIXED IT I GOT ERROR 16** I FORGOT BUT IT HAD A 1619 OR SOMETHING LIKE THAT./ I ALWAYS GET ERRORS WHAT DO I DO? PLEASE HELP QUICKLY IM LOSING PATIENCE!

    I WAS SO CLOSE TO GETTING DONE WITH MY IPOD DOWNLOAD BUT THEN WHEN IT WAS ALMOST DONE IT SAID AN UNEXPECTED ERROR OCCURED !! AGAIN ........
    WHAT DO I DOO NOTHING IS WORKING... I;; NEVER BE ABLE TO UPDATE MY IPOD AND BTW I GOT IT IN 2010 JST IN CASE U NEEDED THAT...INFORMATION..

  • Unknown Error Connection (8xE8000003) For Ipod Touch

    Hello, recenty I have not been able to connect my ipod to itunes. It won't even reconize it in MYCOMPUTER. It comes up with an unknow error thing. Please help tell me what to do step by step without having to loose any data for sure. Please help me, I really need to fix this ASAP.

    In the course of your troubleshooting to date, have you worked through the following document?
    iPhone, iPad, iPod touch: Unknown error containing '0xE' when connecting to a Windows PC

  • IChat doesn't open--period. Bus error?

    I just received my new iMac (Intel Core Duo, woohoo!) on Saturday, and the very first time I tried to open iChat was about an hour ago. All I got was a couple bounces, and then.. failure. Rebooting doesn't make any difference. I tried opening it in Terminal using this method:
    /Applications/iChat.app/Contents/MacOS/iChat -errorLogLevel 7
    The error log in Terminal said "Bus error" and nothing else. Can someone explain what this means, and how I can fix it?
    Brand new iMac!   Mac OS X (10.4.7)  

    Turns out iChat isn't the only one I'm having trouble with. Other programs that won't open: Mail, Address Book, any Big Bang games.. all with the same bus error thing. I did open Big Bang Checkers once (before trying iChat), but as soon as my friend connected to my game, the game crashed--haven't been able to open it since.

  • Server Error In '/' Application - Login failed for user xyz ...

    Hi, I'm brand new here 
    I would be ever grateful for help on this. It's probably something simple.
    I'm coding a website in C# ASP.NET (http://project.arcza.net). There is a registration page where you send your email, username all that stuff to an SQL server. The SQL server runs on my IIS server too. On Visual Studio, I can debug the website (i.e. launch
    it on localhost:12345) and I get a fully working website that I can register as a user and it injects into the SQL server's table. If I query the SQL server, I see the results. So it works fine here.
    The problem: if I copy the files for the website into the live IIS directory (as opposed from the Visual Studio preview environment) I get a runtime error thing, I have no idea what this means. The live IIS folder is project.arcza.net and I have disabled
    security so you can see the full workings of the probem.
    It says login failed for user 'pap'. Pap is a user I have added in SQL server, with username pap and password pap. The credentials are correct. I have added a 'connection string' (I have very little idea what this is) with thees credentials for an SQL server
    @ localhost, in IIS manager.
    Thank you and if you have any idea I'd be very happy.
    I should also point out that if I edit properties of pap in SQL server's login thing where it lists the accounts, I cannot save the settings (you know the ones where you give it permissions to access, delete, etc?) I can tick them and click okay but if I
    reoped properties and click on (I think off the top of my head it's called 'securities' but I may be wrong, it's 2nd from the bottom of the pane on the left) I see the tickboxes remain unticked. Could this have something to do with the "login failed for
    'pap'" message I'm seeing?

    Have a look at
    Errorlog. you should get reason of login failed for user.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Error -8006 when connecting to DI company - revisited

    I have experienced this error several times and every time I used the workaround mentioned in numerous threads in this forum and in note 863568 at support@sap.
    Few days ago I got this error in a certain server, yet deleting folder SM_OBS_DLL at %TEMP% dir just didn't solve the problem.
    After 3 very frustrating days, i figured it out:
    B1 DI creates this folder in the user's temp table, and when I say the user, I mean the user that the process which tryed to load the DI belongs to.
    Well that's easy if you develop an application or dll, but what if you develope a windows service that uses the DI?
    In that case the process runs under Local System Account, which obviously hasn't got it's own TEMP dir. So windows refers such process (and it's included DI) to C:\WINDOWS\TEMP - the machine's global temp dir.
    And that's where my corrupted SM_OBS_DLL dir was !!!
    I've deleted it and now it works like a charm..
    And one last note to SAP's B1 SDK people - why can't you just fix this (-8006) error thing??
    No, seriously - aren't tens of messages in this forum convincing enough to make this minor fix that will save so much time and embarrassment with customers?
    With all due respect, it doesn't sound like a big deal to fix it. something like:
    if (error=-8006)
        DeleteFolder ("SM_OBS_DLL")
    I know i'm adding this code to my solution right away...
    Edited by: Gilan Jackont on Jan 30, 2010 10:51 AM
    Edited by: Gilan Jackont on Jan 30, 2010 11:04 AM

    Just as an extra remark, as far as i have experienced, is that the corruption occurs after a user has cleared its temp directories.
    This is done for instance with a cleaner tool like ccleaner or smth like that.
    If that is done while Sap/addon is still running, some files are locked and those will not be deleted. This leaves behind an incomplete SM_OBS_DLL directory giving problems at next start of sap.
    What Sap should implement is a better check whether it should (re)download the temp dll directory (check for missing files).
    I reported this in a sap message at the portal, but it did not get any priority.

  • HT201407 I upgraded my iphone3gs to OS 6.1 and then after it says that activation error try again later? how to resolve it?

    how can i activate my phone again always sayaing the error thing???

    There are four primary causes of the activation error:
    The activation server is unavailable. Rare, but it happens. Usually fixed within minutes.
    Your antivirus or firewall (or your router's firewall) is blocking access to the domain gs.apple.com on ports 80 and 443.
    Your phone is jailbroken.
    Your phone isn't jailbroken, but the computer you are connected to during the restore or update was used to hack or jailbreak some other iOS device, and its network database was corrupted in the process.
    Perhaps this will provide you some clues as to how to proceed. If your iPhone has been jailbroken, you're on your own. We can provide no assistance for jailbroken devices in these forums.
    Regards.
    (part of the above information quoted with gratitude from Lawrence Finch)

  • Runtime Error! R6025-pure virtual function call when using Project Manager

    Hi
    I am trying to consolidate a project.  I have plenty of destination HD space, 16gb RAM and am wearing the correct color socks today.
    However, when I go to run media manager, I get a run time error R6025 - pure virtual function call.
    I've tried the same project on two different machines and get the same result.
    Has anyone come across this, and is there a fix?
    Many Thanks
    ADAM READ
    Intermedia

    Thanks for the reply John, but it's a codey, windows error thing.  It's happening on 2 different machines, each with the same install of Premiere Pro, so I'm liable to think it's a PP issue.  The MS website info on the error is very vague and certainly out of my skill set.
    Perhaps I'll try the famous import into another project option.
    Any other advice appreciated.
    ADAM

  • Error message: Error During Rendering / Encoding

    Greetings,
    I have used iDVD in the past without problems on my macbook pro. Now it seems there is no way to make it work! I get this error everytime: "Error During Rendering/Encoding" the error is in the menu/slideshows, but I see that it never gets past the menu item on the list of things it is working on. I have tried going to the older menus and no luck. It says that the burning process has been cancelled. Any ideas?????
    Thanks!

    Hooray! I got it... I used what you said and this other post (below) helped as well. Is there a way to remove the apple logo from the menu page?
    Here is the other post that helped as well:
    I was having the same problem yesterday and researched all the solutions in the Forum. I wasn't experiencing the problem with burning to a disc, because I was trying to burn a disc image, so the variable of "better" versus "best" disc wasn't a factor. I did three simple things that I read about, after I tried four times and received the "Multiplexor Error" thing. One, I deleted encoded assets (Advanced > Delete Encoded Assets). Two, I trashed the iDVD preference file (home > library > preferences > com.apple.iDVD.plist), but only after I closed the iDVD application. Three, and maybe this stupid little glitchy thing made a difference, I deleted from the title and scene headings all characters other than letters of the alphabet and numbers. I have a few "&"'s and "/"s in there and maybe a few other little lazy short-cut things. Sort of a Microsoft thing, but maybe that was the trick. So, this morning the Disc Image was created, I've burned several DVD's (Magnavox DVD-R), they work on my Sony Blu-Ray player and all is happyland today.

  • Book format error

    First time I uploaded this PDF to my iPad, it showed the "book format error" message.. i deleted it and then reuploaded.. IT WORKED, but only for a while, when syncing other books, it came back to the book format error thing.. what could be happening and how to solve this issue? it's a random school pdf thing, it shouldn't be copyright protected or something.

    I checked a few of the other .pdfs I have in iBooks - no problem.
    The issue occured with the 2 I created and imported today.
    Created and uploaded them the same way as I have always done.
    They synched fine to iPad, only when I went to open the files in iBooks, I got:
    "Book Format Error - book can not be opened because format is not recognized or invalid"
    Format is .pdf has always worked, still works on others, but not these two.
    I don't know why or what is different this time.

  • Random Cell Errors when opening Numbers Document

    I recently downloaded the iWork '09 trial to see if I wanted to upgrade. When I bought iWork '08 I altered the Budget template so I could add my transactions and then have a chart which showed how well I met my budget. (Or how badly I went over)
    When I opened this in the '09 version of Numbers, loads of my cells had turned into the red triangle error thing. Each one saying there was an error in the previous cell. Once I got to the first of these it just said there was an error in that cell. So I dragged the formula from the working cell above down one cell and suddenly loads of these triangle just disappeared. But at another point the triangles started again.
    After ridding myself of these error cells I tried saving the file with a different name as a native '09 file. When I opened it again the error cells were back except they started in different places. After fixing saving and opening I can safely say I have a big problem, each time I reopened the document the error cells started in random places, sometimes in places where they had started previously. I saved it as a Numbers '08 file after fixing it one more time and it opened fine in Numbers '08.
    I am so confused at what is going on. Am I missing something?

    Have you:
    - rebooted your machine?
    - tried opening the same file in another user space?
    - tried removing the preferences for your user to see if they are corrupt?
    To remove preferences:
    1) quit Numbers
    2) open the folder using the Finder menu item "Go > Go to Folder…", then enter the path "~/Library/Preferences/"
    3) move the files:
         com.apple.iWork.Numbers.LSSharedFileList.plist
         com.apple.iWork.Numbers.plist
    4) start Numbers and try to open your file

Maybe you are looking for

  • Problem using alias field names in a sql query

    Hello, I have a question regarding a simple Oracle database SQL query writeup: In the following (badly written but properly working) SQL query: Query 1: select soe.field1, (soe.field2 + soe.field3) as field4, (soe.field5 - (soe.field2 + soe.field3))

  • Reccomendation for NAS

    Hi, not sure this is the right forum, but the closest I could find. I'm looking to get a NAS for for file sharing and (non-Time Machine) backup for Macs running OSX 10.9.4. Could I get some recommendations, has anyone had particularly good or bad exp

  • FM for knowing the required qunatity

    Hi all , I have a finished good (material number ) with me . It is made up of different semi-finished and raw materials . Suppose i need 1000 quantity , and finished good is not available .... I need to know how much of these semi finished and raw ma

  • Migrate from JDev11.1.1.4 - JHs11.1.1 to JDev11.1.2.3.0 - JHs11.1.2

    Hi I want to migrate my application from JDev 11.1.1.4 - JHs 11.1.1 to JDev 11.1.2.3.0 - JHs 11.1.2 . How should I proceed? Is there any step by step tutorial to do this? I couldn't find any on the web. Opening the old application in the new JDev and

  • HAVE AS MANY ROWS AS I HAVE DAYS IN A MONTH

    Hi, im facing a big issue ... I must create a query that ask for a month and find how many days I have on that month and after, I must have as many rows as I have days .... example :  april = 30 days = 30 rows ( one for each day from 1 to 30 ) Any wa