A complete novice- still need help please!

I am a complete novice, any help would be appreciated. I have written this short programme to display two buttons in a window on screen and with a little help from Lee i have incorporated the ColorButton subclass (see below for code).
import java.awt.*;
import java.awt.event.*;
public class ButtonExample extends WindowAdapter{
private Frame mainFrame;
private Panel topPanel;
private ColorButton buttonOne;
private ColorButton buttonTwo;
// constructor
public ButtonExample(){
mainFrame = new Frame("Button Test Example" );
topPanel = new Panel();
buttonOne = new ColorButton("I'm button one");
buttonTwo = new ColorButton("I'm button two");
mainFrame.setSize( 300, 75 );
mainFrame.addWindowListener(this);
topPanel.setLayout( new FlowLayout() );
topPanel.add(buttonOne);
topPanel.add( buttonTwo);
mainFrame.add( topPanel );
mainFrame.setVisible(true);
// close the frame when clicks the close button
public void windowClosing(WindowEvent e) {
System.exit(0);
// Main program started
public static void main( String args[] ){
new ButtonExample();
I am trying to familiarise myself with subclasses and want to create a subclass of java.awt.Button to override the background and foreground colours and have come up with this
import java.awt.*;
import java.awt.event.*;
public class ColorButton extends Button{
public ColorButton(){
super();
setBackground (Color.red);
setForeground (Color.yellow);
On modifying the main programme to incorporate ColorButton it will not change the background color, only the Button color and will not display text in the buttons themselves, any suggestions would be appreciated

If you use the constructor:
buttonOne = new ColorButton("I'm button one");you have to write it:
class ColorButton extends Button {
   public ColorButton(String text) {
      super(text);
}

Similar Messages

  • New ipod passcode locked out. tried other steps still need help please

    Hi passcode locked out of daughters new ipod. we backed up on computer this morning or rather it automatically backed up when plugged into itunes as directed from other posts i was reading. Then I tried to restore but it said I needed to turn off "find my ipod" which I cant because I need the passcode to get to settings. I then tried the home button power off but when i get to itunes restore ipod it tells me I need passcode. pleae help what step am I missing? go s l o w l y please I am new to mac after 20 years on pc and need help in steps that are not intuitive to me.

    Place the iOS device in Recovery Mode and then connect to your computer and restore via iTunes. The iPod will be erased.
    iOS: Wrong passcode results in red disabled screen                         
    If recovery mode does not work try DFU mode.                        
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings        
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up     
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store        

  • Question-still need help please

    After encountering an odd problem yesterday while uploading photos that forced me to manually shut down the computer, I could not reboot. I ran the disk utility, and it indicated repairs were made. But it still would not reboot. So I reinstalled Mac OS X, and now the computer will not accept my user name/password. Any suggestions on what I'm doing right or what I might do differently?
    Thanks,
    John

    You may have to start the computer from the Installer boot disc and choose
    from the menu options (not reinstall, again) to reset the Admin password.
    It could be the same one you had before, if you like.
    Did you do an Archive and Install -or- an Erase and Install?
    How full is the hard disk drive? After it seems OK for awhile
    you may decide if anything of value is in the old system and
    if not, you could delete it. You may have to start up in SafeBoot
    and run the built-in Disk Utility's "repair disk permissions" and
    restart; there are some things other things you can do to help it.
    Hard saying why the computer acted up. If the drive is getting
    more than 70% full, you should be looking to archive files off
    the machine's hard disk drive and then reduce its load.
    How long have you had this computer, and what is its configuration?
    PS: it would have been nice if you could have started a new
    thread earlier on and kept the topic of your computer in there.
    I see an earlier thread where the error message was a launchd
    message, and that may have been helpful to know all the story.
    re: http://discussions.apple.com/message.jspa?messageID=7178754#7178754
    edited.

  • Earlier Post - still need help please!

    Earlier I said I was getting the message (The document “7/11Diverticulitis.pdf” could not be opened. Acrobat cannot open files in the “Adobe PDF document” format).  Several people made suggestions. I tried all of them. #1 I renamed the files and tried. #2 I made sure I selected acrobat 9 as the application I wanted to use while opening a document. #3 I tried to delete and reinstall. I cannot install it for some reason the process does not auto install from my CD?  Now what, I have already dumped my prior Adobe Acrobat 9 pro into the trash and emptied it!  I am so confused.  I use alot of pdf files as I have gone paperless. Before I created and read them with ease. Why would this happen just because I upgraded to a new computer. Again I am on OSXversion 10.6.8 Thanks for anything you can do to help!!

    You may have to start the computer from the Installer boot disc and choose
    from the menu options (not reinstall, again) to reset the Admin password.
    It could be the same one you had before, if you like.
    Did you do an Archive and Install -or- an Erase and Install?
    How full is the hard disk drive? After it seems OK for awhile
    you may decide if anything of value is in the old system and
    if not, you could delete it. You may have to start up in SafeBoot
    and run the built-in Disk Utility's "repair disk permissions" and
    restart; there are some things other things you can do to help it.
    Hard saying why the computer acted up. If the drive is getting
    more than 70% full, you should be looking to archive files off
    the machine's hard disk drive and then reduce its load.
    How long have you had this computer, and what is its configuration?
    PS: it would have been nice if you could have started a new
    thread earlier on and kept the topic of your computer in there.
    I see an earlier thread where the error message was a launchd
    message, and that may have been helpful to know all the story.
    re: http://discussions.apple.com/message.jspa?messageID=7178754#7178754
    edited.

  • HT1222 I am trying like **** to download itunes 10.6.3 (64 bit - Windows 7) and I keep getting "the installer was interrupted before the requested operations for iTunes could be completed.  Your systems has not been modified."  I NEED HELP, PLEASE!

    I am trying like **** to download itunes 10.6.3 (64 bit - Windows 7) and I keep getting "the installer was interrupted before the requested operations for iTunes could be completed.  Your systems has not been modified."  I NEED HELP, PLEASE!

    I got it figured out myself... yaaaaay for me!

  • After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.

    After my iphone4S update to 7.0.6, it have a problem that keep searching network then no service show on display. Can't call. I have try check sim card, reset network settings, and restore my iphone. Still not working at all. Need help please.Urgent.TQ

    Izit software or hardware? Confuse:(
    Only can use wifi now.
    Any way thanks guys for ur suggestion:) amishcake and simes

  • I had a problem with my itunes so i had went on itunes website and reinstall itunes for windows and after it complete it said that the feature yoy are trying to use is on a network resource that is unavailable i need help please!!!!!!!!!

    had a problem with my itunes so i had went on itunes website and reinstall itunes for windows and after it complete it said that the feature yoy are trying to use is on a network resource that is unavailable i need help please!!!!!!!!!

    first, head into your Add/Remove programs and uninstall your QuickTime. if it goes, good. if it doesn't, we'll just attend to it when we attend to itunes.
    next, download and install the revo uninstaller http://http://www.revouninstaller.com/revo_uninstaller_free_download.html. use it to clear any existing itunes and/or QuickTime installation configuration information from the PC.
           next download itunes. it worked for me hope this is helpful!!
        oonce you get into the revo uninstallergo thru to delete itunes hit uninstall on the itunes icon then you will go thru to it will tell u the same nmessage about the feature and network hit cancell then go thru and hit scan (make sure bthe advance scan button is pushed) this will take awhile but go thru the list and hit everything associated with itunes. hit delete then install itunes again. it worked for me hope it works for you!

  • TS1646 I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Hi
    I'v tried many times to update my applications however, my account can't do it because security code for my card is incorrect note that I'm sure my card details are correct completely so i need help to fix it as much as you can plz. Thnks

    Look, I understand I still need a card attached to the account. The problem is, it won't accept my card because I only have 87 cents in my bank account right now.
    If I had known there would be so much trouble with the iTunes card, I would have just put the cash in my bank account in the morning instead of buying an iTunes card (I didn't expect the banks to be open on Thanksgiving of course).
    Apple will only accept cards that have a balance. The balance is so small in my account that it won't accept it as a valid card.
    I'm going to have to contact Apple anyway to reset the security questions. That's obvious. Your answers were not exactly helpful. You didn't tell me anything I don't already know, but thanks for trying to be helpful.

  • Still need help with flash player download

    I'm still having a problem with the flash player, please read my last post below:
    "I've tried everything here & still can't download the flash player. Anytime I try to download it asks me to install ADM add-on and then when I click on that, my computer freezes. How do I enable this add-on without my computer freezing? Can anyone help pls?"

    Thanks a lot for your help, it is truly appreciated.
    Date: Thu, 29 Oct 2009 18:52:38 -0600
    From: [email protected]
    To: [email protected]
    Subject: Still need help with flash player download
    You can set Flash Player to check for updates on the Global Settings Manager panel:
    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager05.htm l
    >

  • I can not play any games on the new ipad 32 G wifi after take over to  oversea , need help please

    After I turn off Airplane mode and I want to play games when was downloaded before fly to oversea. I was palying all games on ipad before fly.
    now when I turn on ipad and want to paly games but It can not play games on ipad.???
    Anyone can fit it on setting?
    Need help please.
    Thank you.

    OK. I am having a little bit of trouble understanding your responses, but let's start with this since you are having an issue with other apps as well.
    Reboot your iPad.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. Let the iPad start up completely and then try again.

  • HT204380 I can't access my FaceTime and messages through my iPod touch, I need help please!!!

    I can't access my FaceTime and messages through my iPod touch, I need help please!!!

    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
    For non-Apple devices, check out the TextFree app https://itunes.apple.com/us/app/text-free-textfree-sms-real/id399355755?mt=8
    You posted in the iPad forum instead of the iPod forum. To get answers to your question, next time post in the proper forum. See https://discussions.apple.com/index.jspa  I'll request that Apple relocate your post.
     Cheers, Tom

  • One year plan,didnt charge my card,back to trial version,need help please?!?

    im a student of graphic design. i bought creative cloud during the christmas sale for 15.99$. it charged for the first month but then i had to change cards because of a new bank account and it took 1$ out but never charged and now i have the trial version again. i have the money on my card and it still shows the 1$ as a pending transaction on my account but it has been almost two weeks and my trial ran out. i need creative cloud for college,please some help me?

    This is an open forum, not Adobe support... you need Adobe support to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • My MacBook Pro has problem in iphoto,, I cant open it,, I need help please,,,,

    My MacBook Pro has problem in iphoto,, I cant open it,, I need help please,,,,

    Last login: Sun Apr 22 19:11:11 on ttys000
    Marlons-MacBook-Pro:~ ryanmnhs$ ls -la ~/Library/LaunchAgents
    total 40
    drwx------   7 ryanmnhs  staff   238  5 Nov 23:09 .
    drwx------@ 48 ryanmnhs  staff  1632 13 Jan 09:53 ..
    -rw-r--r--   1 ryanmnhs  staff   574 24 Oct 22:29 com.adobe.ARM.202f4087f2bbde52e3ac2df389f53a4f123223c9cc56a8fd83a6f7ae.plist
    -rw-r--r--   1 ryanmnhs  staff   618 22 Oct  2011 com.apple.AddressBook.ScheduledSync.PHXCardDAVSource.BAF380D0-E780-4E82-86BF-77 2440AB4936.plist
    -rw-r--r--   1 ryanmnhs  staff   895  4 Sep  2011 [email protected].plist
    -rw-r--r--   1 ryanmnhs  staff   802 21 Mar 12:56 com.facebook.videochat.ryanmnhs.plist
    -rw-r--r--@  1 ryanmnhs  staff   805  6 Sep  2011 com.google.keystone.agent.plist
    Marlons-MacBook-Pro:~ ryanmnhs$ 
    ,,,,,,,,THIS IS THE RESULT,, WHAT DOES THIS MEAN? HOW CAN I FIX MY PROBLEM? UP TO THIS DATE MY WORD, EXCEL AND POWERPOINT STILL DONT WORK!!!!PLEASE HELP ME, ANYONE? THANK YOU...

  • HT1212 My Ipad is disabled by wrong password and I have tried to reset and restore a few times with no success. Now I-tunes won't even recognize the I-pad in recovery mode. I need help please.

    My Ipad is disabled by wrong password and I have tried to reset and restore a few times with no success. Now I-tunes won't even recognize the I-pad in recovery mode. I need help please.

    If the iPad was running iOS 7,  iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    How can I unlock my iPad if I forgot the passcode?
    http://www.everymac.com/systems/apple/ipad/ipad-troubleshooting-repair-faq/ipad- how-to-unlock-open-forgot-code-passcode-password-login.html
    iOS: Device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    How can I unlock my iPad if I forgot the passcode?
    http://tinyurl.com/7ndy8tb
    How to Reset a Forgotten Password for an iOS Device
    http://www.wikihow.com/Reset-a-Forgotten-Password-for-an-iOS-Device
    Using iPhone/iPad Recovery Mode
    http://ipod.about.com/od/iphonetroubleshooting/a/Iphone-Recovery-Mode.htm
    Saw this solution on another post about an iPad in a school environment. Might work on your iPad so you won't lose everything.
    ~~~~~~~~~~~~~
    ‘iPad is disabled’ fix without resetting using iTunes
    Today I met my match with an iPad that had a passcode entered too many times, resulting in it displaying the message ‘iPad is disabled – Connect to iTunes’. This was a student iPad and since they use Notability for most of their work there was a chance that her files were not all backed up to the cloud. I really wanted to just re-activate the iPad instead of totally resetting it back to our default image.
    I reached out to my PLN on Twitter and had some help from a few people through retweets and a couple of clarification tweets. I love that so many are willing to help out so quickly. Through this I also learned that I look like Lt. Riker from Star Trek (thanks @FillineMachine).
    Through some trial and error (and a little sheer luck), I was able to reactivate the iPad without loosing any data. Note, this will only work on the computer it last synced with. Here’s how:
    1. Configurator is useless in reactivating a locked iPad. You will only be able to completely reformat the iPad using Configurator. If that’s ok with you, go for it – otherwise don’t waste your time trying to figure it out.
    2. Open iTunes with the iPad disconnected.
    3. Connect the iPad to the computer and wait for it to show up in the devices section in iTunes.
    4. Click on the iPad name when it appears and you will be given the option to restore a backup or setup as a new iPad (since it is locked).
    5. Click ‘Setup as new iPad’ and then click restore.
    6. The iPad will start backing up before it does the full restore and sync. CANCEL THE BACKUP IMMEDIATELY. You do this by clicking the small x in the status window in iTunes.
    7. When the backup cancels, it immediately starts syncing – cancel this as well using the same small x in the iTunes status window.
    8. The first stage in the restore process unlocks the iPad, you are basically just cancelling out the restore process as soon as it reactivates the iPad.
    If done correctly, you will experience no data loss and the result will be a reactivated iPad. I have now tried this with about 5 iPads that were locked identically by students and each time it worked like a charm.
    ~~~~~~~~~~~~~
    Try it and good luck. You have nothing more to lose if it doesn't work for you.
     Cheers, Tom

  • I still need help with the Dictionary for my Nokia...

    I still need help with the Dictionary for my Nokia 6680...
    Here's the error message I get when trying to open dictionary...
    "Dictionary word information missing. Install word database."
    Can someone please provide me a link the where I could download this dictionary for free?
    Thanks!
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

    oops, im sorry, i didnt realised i've already submitted it
    DON'T HIT KIDS... THEY HAVE GUNS NOW.

Maybe you are looking for

  • KERN_INVALID_ADDRESS crashing alot

    Sory if this is a repeat of an existing post. I did a search but couldn't find anything concrete. I have been having an issue with our computer crashing alot. Was also getting "crickets" but I just had our computer serviced by the people who sold it

  • Exporting and importing movies in iPhoto - unrecognised format

    hi I am trying to export just a few movies from iphoto in my user account, to my daughters parental support account on the same mac. (I imported from her camera to my account by mistake and deleted them from her camera, but want them only to be on he

  • A bug? BC4J ViewObject where clause change doesn't affect view contents

    Hi! I've found the following interesting behaviour (maybe a bug?) of BC4J ViewObject caching: 1) make a viewobject with where clause and 1 parameter in it. 2) set parameter binding to some value 3) execute query 4) then change viewobject's where clau

  • I'm getting this error: Service "iPod Service" could not be stopped

    Verify that you have sufficient privileges to stop system services." Does anyone know what that means? Dell   Windows 2000  

  • Antec Notebook Cooler or iLap

    So, the heat coming from my MBP has forced me to make a decision. I need a cooler of some sort. I have been looking at getting a Antec Notebook Cooler with the two fans in it because that looks promising and isn't a bad deal. But I've seen on here ma