Why are the buttons not visible at program start?

Can anybody tell me why the buttons are invisible at Program start? They are only then visible, if the client are is invalidated, in other words, if i resize/minimize the window etc.
public class Calculator extends Frame
private Button[] button;
private Panel p_button;
public Calculator()
super();
SetWindowProperties();
button = new Button[10];
p_button = new Panel();
CreateButtons();
AddPanels();
AddButtons();
SetButtonProperties();
addWindowListener(new WindowHandler());
private void SetWindowProperties()
setTitle("Calculator");
setBackground(Color.white);
setLayout(new BorderLayout());
setSize(400,400);
setLocation(250,200);
setVisible(true);
private void CreateButtons()
for (int i=0; i<=9; i++)
button = new Button(String.valueOf(i));
private void SetButtonProperties()
for (int i=0; i<=9; i++)
button.setSize(50, 50);
button.setBackground(Color.gray);
private void AddButtons()
p_button.setLayout(new GridLayout(5, 3, 5, 5));
for (int i=1; i<=9; i++)
p_button.add(button);
for (int i=1; i<=9; i++)
button.addActionListener(new ButtonHandler());
private void AddPanels()
add(p_button, BorderLayout.CENTER);
}

First, use code tags.
Second, your code doesn't even compile. Please create a Short,Self Contained, Compilable and Executable, Example Program

Similar Messages

  • I've just started using the App Tabs. I think this feature could be handy but why are the sites not updated when I start Firefox. Now I have to manually update the site which is somewhat of a downer. Does any of you know where I'm going wrong?

    I've just started using the App Tabs. I think this feature could be handy but why are the sites not updated when I start Firefox. Now I have to manually update the site which is somewhat of a downer. Does any of you know where I'm going wrong?

    To answer the post title FireFox save all downloads automatically in the download folder, which you can find in the Documents folder. If you want to choose where to save your downloads go to tools>options>check always ask me where to save files.
    Secondly, I am assuming you have IE 8 installed as this is the only version that supports this fix that is currently not in beta. Go to control panel>internet options>advanced tab and reset the settings at the bottom. This may or may not fix the problem but it is a good first step.

  • Why are the buttons not reading my fingers now? Terrible upgrade

    This upgrade is frustrating, wish I could undo it. The buttons don't respond to touch and I'm doing things more than one time now.

    You turned into a zombie? 

  • Why are the iPhotos not listed in the finder?

    why are the iPhotos not listed in the finder?

    There are many, many ways to access your files in iPhoto:   You can use any Open / Attach / Browse dialogue. On the left there's a Media heading, your pics can be accessed there. Command-Click for selecting multiple pics.
    (Note the above illustration is not a Finder Window. It's the dialogue you get when you go File -> Open)
    You can access the Library from the New Message Window in Mail:
    There's a similar option in Outlook and many, many other apps.  If you use Apple's Mail, Entourage, AOL or Eudora you can email from within iPhoto.
    If you use a Cocoa-based Browser such as Safari, you can drag the pics from the iPhoto Window to the Attach window in the browser.
    If you want to access the files with iPhoto not running:
    For users of 10.6 and later:  You can download a free Services component from MacOSXAutomation  which will give you access to the iPhoto Library from your Services Menu.
    Using the Services Preference Pane you can even create a keyboard shortcut for it.
    For Users of 10.4 and 10.5 Create a Media Browser using Automator (takes about 10 seconds) or use this free utility Karelia iMedia Browser
    Other options include:
    Drag and Drop: Drag a photo from the iPhoto Window to the desktop, there iPhoto will make a full-sized copy of the pic.
    File -> Export: Select the files in the iPhoto Window and go File -> Export. The dialogue will give you various options, including altering the format, naming the files and changing the size. Again, producing a copy.
    Show File:  a. On iPhoto 09 and earlier:  Right- (or Control-) Click on a pic and in the resulting dialogue choose 'Show File'. A Finder window will pop open with the file already selected.    3.b.
    b: On iPhoto 11 and later: Select one of the affected photos in the iPhoto Window and go File -> Reveal in Finder -> Original. A Finder window will pop open with the file already selected.

  • Why are the templates not in english? how do i change it

    why are the templates not in english? how do i change it

    dfields77 wrote:
    why are the templates not in english?
    To learn about this standard practice for template text, google "lorem ipsum".

  • Why are the images not printing from InCopy? Why is the relink button in Links panel ghosted?

    I am having a problem with printing from Incopy. All stories are editable and that is working just fine. I am able to view the images although AD has set the graphics to not be editable yet I can still see them of course.
    My problem is upon wanting to print the layout. Getting a message that the image links are missing. I have not moved the original folders (they are all set up on the same level in one main folder). I am working remotely, layout based workflow via dropbox.
    My client would like to have the option to print layouts also initially. How can I relink the images if the "relink" button is ghosted. Can somebody help me please? I have tried doing a restart… Any ideas? 

    the-edmeister, you are a genious. I went to "view" then "toolbars" and de-selected "yahoo toolbar" and then moved the curser over my firefox page and it now works completely including the problem area (the top 3 cm of each screen). Thank you, thank you, thank you, thank you, thank you, thank you. You have no idea how good I feel know on this otherwise cold, windy and rainy day.

  • HT1665 Why are the buttons on my earbuds not working?  I just bought new ones because the old ones weren't working.

    I'm unable to use the buttons on my earbuds, both for music and for phone calls.

    Hi Kristen0424,
    If you are having button issues with the remote on your Apple earbuds, you may find the following article helpful:
    Apple EarPods with Remote and Mic: Remote buttons do not function
    http://support.apple.com/kb/TS4396
    Regards,
    - Brenden

  • Why are the buttons invisible on WM_CREATE?

    Can anybody tell me why the buttons are invisible at Program start? They are only then visible, if the client are is invalidated, in other words, if i resize/minimize the window etc.
    public class Calculator extends Frame
         private Button[] button;
         private Panel p_button;
         public Calculator()
              super();
              SetWindowProperties();
              button = new Button[10];
              p_button = new Panel();
              CreateButtons();
              AddPanels();          
              AddButtons();
              SetButtonProperties();          
              addWindowListener(new WindowHandler());
         private void SetWindowProperties()
              setTitle("Calculator");
              setBackground(Color.white);
              setLayout(new BorderLayout());
              setSize(400,400);
              setLocation(250,200);
              setVisible(true);
         private void CreateButtons()
              for (int i=0; i<=9; i++)
                   button[i] = new Button(String.valueOf(i));
         private void SetButtonProperties()
              for (int i=0; i<=9; i++)
                   button.setSize(50, 50);
                   button[i].setBackground(Color.gray);
         private void AddButtons()
              p_button.setLayout(new GridLayout(5, 3, 5, 5));
              for (int i=1; i<=9; i++)
                   p_button.add(button[i]);
              for (int i=1; i<=9; i++)
                   button[i].addActionListener(new ButtonHandler());
         private void AddPanels()
              add(p_button, BorderLayout.CENTER);

    move
    SetWindowProperties();
    after
    SetButtonProperties();
    if i do that, i never can see the buttons, and this is obvoius.(your suggestion is not logical)
    I am a C++-Programmer and i simply dont like the Java coding convention.
    By the way, does anyone have still an idea, why the buttons are not visible at programstart?
    What about:
    button = new Button(String.valueOf(i));
    What do you think of that statement?What should i think of ? It creates buttons with captions 1,2,3 ...
    PS: At the end of line i forgot to copy the last end-block statement from the code during posting.
    So if anyone tries the code, please add a " } "

  • Why are shared files not visible when iPhone4S connected to iTunes?

    What makes this problem mysterious is that I have exactly the same settings on the same or eqivalent Apps on iPad2 and iTunes4S but when my iPhone is connected to my iTunes (running on my PC under Win7) it shows no files on Apps like Pages, iBooks, Keynote, and Print-n-share.  Each of these Apps has files and each shows files when  I connect my iPad2.   I cannot export or import filesto/from itunes and iphone because the list of files inside the Apps is not visible in itunes. 
    PS I CAN, btw, export and import files by using the amazing App and service "DropBox" which is the only route in and out of my iPhone (I am not ready to use iCloud).

    This is not a reply but an addition.  While searching for answers as to why "Shared" files in original Apps in my iPhone4S did not appear on itunes I came across a similar discussion on another Forum in which Jim described in some detail how to get the two devices (my iPhone 4S and my iPad2) to recognize similar embedded files in similar Apps.  https://discussions.apple.com/message/16690584#16690584
    I went through this promising procedure but it did not help.  Since the two devices are independent (I think -- they are on the same accoubt but ar different devices) I should be able to make them work the same way with regard to what is seem in iTune.

  • Why are security headers not visible when viewing "sent" mail for mail sent with S/MIME certificates?

    I am using an S/MIME certificate to sign my emails using Mail on Mountain Lion 10.8.2.  I have a trusted S/MIME certificate for each of my email accounts.  The certs and private keys are properly installed in the keychain.  I am able to successfully send signed (and optionality encrypted) email and the recipients are all all receiving the emails showing a trusted signed email without having to acknowledge or trust the signature.  So technically the certificates are working.  Obviously the encryption option is only offered when I also have the recipients certficate in my keychain.
    What I am noticing is that when I look in my sent items - (regardless of which email I used as the "sender") - I don't see any indication in the mail headers that the mail was sent with a signed certificate - even though I know the recipient is seeing that the mail is signed with a cert.  I have no way of telling whether I sent the mail as "signed" or "unsiged".  The default is to use the certificate for all outbound emails - unless I specifically uncheck the secure signing option before sending.  In mail that I recieve - sent from others with certs or sent from one of my email accounts to the other - I see the the certificate indication in the email header.
    On rare occasion - I do see the certificate when viewing sent mail - but only for  random sent mails - and so far I believe I have only seen the certificate show up in mail that is sent from my iCloud account.  I can send subsequent mail from iCloud - and still not see the certificate in the sent items.
    Why am I not seeing the Security Header showing the certificate when viewing mail that I have sent in my sent items folder?  Is there some setting that I am not seeing that controls this - or is this a bug in Mac Mail?  Also why does the security header show up for just a handful of sent emails - when hundreds of signed emails have been successfully sent.
    Any help would be appreciated.  The behavior is the same on my other Macs - at least the ones on which the certificates are also installed.
    Also - I don't have my certs installed on my iPhone yet - so I can't tell on the iPhone if the certs are showing up in the sent folder - but I can see the certs on mail that I send to myself from the Mac but receive on the iPhone.
    ~Scott

    I stopped using the S/MIME certs and stopped signing my emails.  Too many recipients were receiving them as "attachements" especially if the recipients email account was on an Exchange server.  My certs have since expired and I have not done anything to further analyze the situation.  My original post was over a year ago and I have long since been on Mavericks.
    To: iddontknowwhoiamsowhat ... I am not totally following your response.  You say you are seeing the exact same issue - yet you are also saying you can look at the sent mails from os x and ios - does this mean that you see the security badges on the sent emails in both os x and ios?  I assume you are on Mavericks?

  • Why are the buttons faded out (cant use them) on mobile device details?

    Good Afternoon
    I am having a little trouble figuring out why the buttons are faded (cant use them) on the: User Mailbox -> Mailbox features -> Mobile Device Details. Any help would be appreciated. Thanks.

    Hi Andy
    This option is greyed out only for one user or its for all users ?
    Do you have any MDM in place for managing the active sync devices ?
    Have you tried disabling this feature through Powershell ?
    Remember to mark as helpful if you find my contribution useful or as an answer if it does answer your question.That will encourage me - and others - to take time out to help you Check out my latest blog posts on http://exchangequery.com Thanks Sathish
    (MVP)

  • Why are flash buttons not a good idea?

    I'm trying to figure out a problem I'm having with flash
    buttons (mainly that I don't want users to have to click twice to
    make them work), and I keep seeing posts (particularly by Murray)
    asking if the poster knows that flash buttons aren't a good idea.
    However, I was unable to find an explanation as to
    why they are a bad idea. Can anyone explain this to me in
    layman's terms? I'm very new to Dreamweaver and web development in
    general. I'm developing an intranet site for a specific group of
    users where accessibility is not a huge concern.
    Thanks!

    Consider these scenarios -
    1. I don't have Flash installed. I don't get the benefit of
    your Flash
    navigation element.
    2. I am a search engine spider. I don't get the benefit of
    your Flash
    navigation element.
    Need I say more? 8)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "bhkate" <[email protected]> wrote in
    message
    news:eki4lp$99u$[email protected]..
    > I'm trying to figure out a problem I'm having with flash
    buttons (mainly
    > that I
    > don't want users to have to click twice to make them
    work), and I keep
    > seeing
    > posts (particularly by Murray) asking if the poster
    knows that flash
    > buttons
    > aren't a good idea. However, I was unable to find an
    explanation as to
    >
    why they are a bad idea. Can anyone explain this to me in
    layman's
    > terms? I'm very new to Dreamweaver and web development
    in general. I'm
    > developing an intranet site for a specific group of
    users where
    > accessibility
    > is not a huge concern.
    >
    > Thanks!
    >

  • When importing a CD, why are the tracks not together?

    when importing a CD, why is it that sometimes some of the tracks are NOT together? how can I fix this problem?

    If you make syre that the Album Artist is the same for all tracks of an album, eg Various Artists or Artist & Friends then they will show as 1 album
    Here is more info about tagging
    http://samsoft.org.uk/iTunes/grouping.asp

  • Why are the tabs not saved when I restart Firefox? Very frustrating with the new version.

    I pin a tab - or many tabs. Close Firefox, then open it the tabs are never saved. This was never the issue with the older versions of Firefox - been using it for years. I bought a new computer, loaded Firefox (19.0) and now I cannot "save" the tabs.

    You can check for problems with the sessionstore.js and sessionstore.bak files in the Firefox Profile Folder that store session data.
    Delete the sessionstore.js file and possible sessionstore-##.js files with a number and sessionstore.bak in the Firefox Profile Folder.
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    Deleting sessionstore.js will cause App Tabs and Tab Groups and open and closed (undo) tabs to get lost, so you will have to create them again (make a note or bookmark them).
    *http://kb.mozillazine.org/Multiple_profile_files_created
    See also:
    *http://kb.mozillazine.org/Session_Restore
    *https://support.mozilla.org/kb/restore-previous-session

  • Why are imported images not visible any more in My Catalogue?

    I am trying to find out if there are limitations in PSE's Organizer that make it pointless for people with large numbers of photos to bother buying PSE 12.
    I imported 1050 JPEGs into My Catalog without problem using PSE 8 but all subsequent imported JPEGs show up as Thumbnails that are Opague with an Hourglass design on them. This makes organizing these images impossibly slow.  When I created a new catalog -- good advice from "andalebbfatima.1" --imported thumbnails were visible again.
    But what to do about the 1050 images in the original catalog? I've got two thick "how-to" books and they say nothing about copying images from one catalog to another.
    More important, to have confidence to buy PSE 12, I need to know what caused the 'invisible' thumbnails in the original catalog and is it something that could happen again after another two years of scanning, importing and trying to organize?

    Glad you got it working.
    For creating multiple catalogs from this original one, you can create copies of the original catalog. Check your catalog location using Help > System Info in Elements Organizer.
    Now copy paste the catalog folder (i.e. the folder having same name as your catalog) in the same location. So now, you have say folders say- MyCatalog and MyCatalog-Copy.
    You may open MyCatalog-Copy from Elements Organizer using File > Manage Catalog. Once this open, you can remove images from it so that only a selected set of images can be organized in this catalog. Now images get deleted from the hard disk in this process. Likewise, you can organize the original catalog.
    Hope this helps.
    Thanks
    Andaleeb

Maybe you are looking for

  • I have been on the same problem for 2 days now.... it has become URGENT

    ================== CLIENT SIDE ================== try srvIntrface = (MyServerInterface) Naming.lookup("rmi://"+server+":1099/Interface"); }catch(Exception e){System.out.println("clientForm, lookup: Error getting the remote service");} byte[] fileData

  • Error While Accessing Universe Designer

    Hi All, I am facing an strange issue - I have BO Installation on windows server - 2003. As a client when iam trying to access the server from diffrent location i am able to access CMC and Polestar. But When i am trying to access universe designer - i

  • Reports Varients in MSS

    Hi , I have doubt on MSS Reports. I have configured reports in manager desktop.I wanted to execute the reports with varients when manager executes his subordinates details. Please let me know how and where to configure the varients for reports in MSS

  • Adding iweb site to existing site

    Apologies for being a complete luddite when it comes to this. I need to jazz up an existing web site. Can I just create a link there to my iweb site? Am I right in assuming there are no hosting fees for iweb? I presume the new site can be as expansiv

  • Need a solution of publishing video and audio together

    we hope to implement something like below: fms publish a stream to one client,while the client receive the stream,the client publish the received stream and the audio stream which record from the client's microphone together.and fms publish the clien