Why won't my Buttons show?

Why arent my button arrays showing in the class reinforcements?
import java.awt.*;
import java.awt.event.*;
public class reinforcements implements ActionListener{
        basicFrame frame;
        Button playerGuess[] [] = new Button[9] [9];
        Button playerField[] [] = new Button[9] [9];
        Panel pGC, pFC, actionPanel; //playerGuessContainer, playerFieldContaioner
        Button start;
        Label started;
        GridBagLayout gbl = new GridBagLayout();
        GridBagConstraints constraints;
        CardLayout cardLayout;
        public reinforcements() {
                frame = new basicFrame("Battleship", 500, 300, true, gbl);
                constraints = new GridBagConstraints();
                pGC = new Panel();
                pFC = new Panel();
                pGC.setLayout(new GridLayout(10, 10));
                pFC.setLayout(new GridLayout(10, 10));
                for (int row=0; row>10; ++row) {
                        for (int col=0; col>10; ++col) {
                                System.out.println(row);
                                System.out.println(col);
                                playerGuess[row] [col] = new Button("?");
                                playerField[row] [col] = new Button("?");
                                pGC.add(playerGuess[row] [col]);
                                pFC.add(playerField[row] [col]);
                cardLayout = new CardLayout();
                actionPanel = new Panel();
                actionPanel.setLayout(cardLayout);
                start = new Button("Start Game");
                start.addActionListener(this);
                started = new Label("It started");
                actionPanel.add("C1", start);
                actionPanel.add("C2", started);
                constraints.gridwidth = 2;
                gbl.setConstraints(actionPanel, constraints);
                frame.add(actionPanel);
                constraints.gridx = 0;
                constraints.gridy = 1;
                gbl.setConstraints(pGC, constraints);
                frame.add(pGC);
                constraints.gridx = constraints.RELATIVE;
                gbl.setConstraints(pFC, constraints);
                frame.add(pFC);
                frame.setVisible(true);
        public static void main(String args[]) {
                reinforcements r = new reinforcements();
        public void actionPerformed(ActionEvent e) {
                cardLayout.next(actionPanel);
        }The basicFrame class is:
import java.awt.*;
import java.awt.event.*;
import java.awt.Frame;
import java.awt.Color;
public final class basicFrame extends Frame implements WindowListener, ActionListener {
        private static byte count = 0;
        public static final byte FILE = 1;
        public static final byte HELP = 2;
        public static final byte STATUS = 3;
        private MenuBar mb;
        private Menu file, help, status;
        private MenuItem exit, print, current, about;
        public basicFrame() {
                this(" ", 400, 400, false, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(String title) {
                this(title, 400, 400, false, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(int x, int y) {
                this(" ", x, y, false, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(boolean resize) {
                this(" ", 400, 400, resize, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(LayoutManager layout) {
                this(" ", 400, 400, false, layout, Color.lightGray, Color.black);
        public basicFrame(Color back, Color front) {
                this(" ", 400, 400, false, new FlowLayout(), back, front);
        public basicFrame(String title, int x, int y) {
                this(title, x, y, false, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(String title, boolean resize) {
                this(title, 400, 400, resize, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(String title, LayoutManager layout) {
                this(title, 400, 400, false, layout, Color.lightGray, Color.black);
        public basicFrame(String title, Color back, Color front) {
                this(title, 400, 400, false, new FlowLayout(), back, front);
        public basicFrame(int x, int y, boolean resize) {
                this(" ", x, y, resize, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(int x, int y, LayoutManager layout) {
                this(" ", x, y, false, layout, Color.lightGray, Color.black);
        public basicFrame(int x, int y, Color back, Color front) {
                this(" ", x, y, false, new FlowLayout(), back, front);
        public basicFrame(boolean resize, LayoutManager layout) {
                this(" ", 400, 400, resize, layout, Color.lightGray, Color.black);
        public basicFrame(boolean resize, Color back, Color front) {
                this(" ", 400, 400, resize, new FlowLayout(), back, front);
        public basicFrame(LayoutManager layout, Color back, Color front) {
                this(" ", 400, 400, false, layout, back, front);
        public basicFrame(String title, int x, int y, boolean resize) {
                this(title, x, y, resize, new FlowLayout(), Color.lightGray, Color.black);
        public basicFrame(String title, int x, int y, LayoutManager layout) {
                this(title, x, y, false, layout, Color.lightGray, Color.black);
        public basicFrame(String title, int x, int y, Color back, Color front) {
                this(title, x, y, false, new FlowLayout(), back, front);
        public basicFrame(String title, boolean resize, LayoutManager layout) {
                this(title, 400, 400, resize, layout, Color.lightGray, Color.black);
        public basicFrame(String title, boolean resize, Color back, Color front) {
                this(title, 400, 400, resize, new FlowLayout(), back, front);
        public basicFrame(String title, LayoutManager layout, Color back, Color front) {
                this(title, 400, 400, false, layout, back, front);
        public basicFrame(int x, int y, boolean resize, LayoutManager layout) {
                this(" ", x, y, resize, layout, Color.lightGray, Color.black);
        public basicFrame(int x, int y, boolean resize, Color back, Color front) {
                this(" ", x, y, resize, new FlowLayout(), back, front);
        public basicFrame(int x, int y, LayoutManager layout, Color back, Color front) {
                this(" ", x, y, false, layout, back, front);
        public basicFrame(boolean resize, LayoutManager layout, Color back, Color front) {
                this(" ", 400, 400, resize, layout, back, front);
        public basicFrame(String title, int x, int y, boolean resize, LayoutManager layout) {
                this(title, x, y, resize, layout, Color.lightGray, Color.black);
        public basicFrame(String title, int x, int y, boolean resize, Color back, Color front) {
                this(title, x, y, resize, new FlowLayout(), back, front);
        public basicFrame(String title, int x, int y, LayoutManager layout, Color back, Color front) {
                this(title, x, y, false, layout, back, front);
        public basicFrame(String title, boolean resize, LayoutManager layout, Color back, Color front) {
                this(title, 400, 400, resize, layout, back, front);
        public basicFrame(int x, int y, boolean resize, LayoutManager layout, Color back, Color front) {
                this(" ", x, y, resize, layout, back, front);
        public basicFrame(String title, int x, int y, boolean resize, LayoutManager layout, Color back, Color front) {
                super(title);
                count++;
                setSize(x, y);
                setResizable(resize);
                setLayout(layout);
                setBackground(back);
                setForeground(front);
                addWindowListener(this);
                mb = new MenuBar();
                file = new Menu("File");
                help = new Menu("Help");
                status = new Menu("Status");
                exit = new MenuItem("Exit");
                about = new MenuItem("About");
                print = new MenuItem("Print to Command Prompt");
                current = new MenuItem("Current Status");
                exit.addActionListener(this);
                file.add(exit);
                about.addActionListener(this);
                print.addActionListener(this);
                current.addActionListener(this);
                status.add(print);
                status.add(current);
                help.add(about);
                help.add(status);
                mb.add(file);
                mb.add(help);
                setMenuBar(mb);
        public void setVisible(boolean visible) {
                if (visible) {
                        Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
                        setLocation((d.width-getWidth())/2, (d.height-getHeight())/2);
                super.setVisible(visible);
        public void addMenuItem(MenuItem item, byte where) {
                if (where == FILE)
                        file.add(item);
                if (where == HELP)
                        help.add(item);
                if (where == STATUS)
                        status.add(item);
        public void addMenu(Menu menu) {
                mb.add(menu);
        public void addMenu(Menu menu, byte where) {
                if (where == FILE)
                        file.add(menu);
                if (where == HELP)
                        help.add(menu);
                if (where == STATUS)
                        status.add(menu);
        public void windowClosing(WindowEvent e) {
                count--;
                if (count == 0) {
                        dispose();
                        System.exit(0);
                else {
                        super.setVisible(false);
        public void windowActivated(WindowEvent e) {}
        public void windowClosed(WindowEvent e) {}
        public void windowIconified(WindowEvent e) {}
        public void windowDeiconified(WindowEvent e) {}
        public void windowDeactivated(WindowEvent e) {}
        public void windowOpened(WindowEvent e) {}
        public void actionPerformed(ActionEvent e) {
                if (e.getSource() == exit) {
                        count--;
                        if (count == 0) {
                                dispose();
                                System.exit(0);
                        else {
                                super.setVisible(false);
                if (e.getSource() == about) {
                        basicFrame ab = new basicFrame(250, 150, new GridLayout(3, 1));
                        Label name = new Label("Author: Nicholas La Pietra");
                        Label version = new Label("Version: 1.0");
                        Label lastUpdated = new Label("Last Updated: 2/26/2005");
                        ab.add(name);
                        ab.add(version);
                        ab.add(lastUpdated);
                        ab.setVisible(true);
                if (e.getSource() == print) {
                        System.out.println("Current Number of Frames: " + count);
                if (e.getSource() == current) {
                        basicFrame cr = new basicFrame(250, 100, new GridLayout(1, 1));
                        Label numOfFrames = new Label("Current Number of Frames: " + count, Label.CENTER);
                        cr.add(numOfFrames);
                        cr.setVisible(true);
        }  

for (int row=0; row>10; ++row) {It's hard for row to be >10 if it starts at 0; probably you meant "row < 10" ...?

Similar Messages

  • Why won't my apps show on my main screens? The only way I can access them is by going back to the App Store and clicking open.

    Why won't my apps show on my main screens? The only way I can access them is by going back to the App Store and clicking open.

    So there are no apps at all on your home screens? Try a reset. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. If you don't see anything after that, take a look at all of your home screens and folders to see if something is hidden. It that doesn't work, you can go to Settings>General>Reset>Reset Home Screen Layout.

  • Why won't Firefox automatically show new Hotmail emails or easilly down load attachments when it was working a week ago?

    Why won't Firefox automatically show new Hotmail emails or easily down load attachments when it was working a week ago?

    Hotmail has been having a few hiccups lately I'm afraid.
    If you don't see any emails when you log in, or nothing appears after some time, click in the middle of the grey bar on the left which has the word "'''Inbox'''" in it. This usually causes them to magically appear for some strange reason.
    I've read on on a few blogs that Microsoft is working on the problem, but don't hold your breath.<br><br>
    If this suggestion resolves the problem for you, please click the '''Solved it''' button next to this post after you log in into the forum. This will help others searching for a solution to the same problem.
    Thanks.

  • Why won't my macbook show app store

    Why won't my macbook show the App Store ? I have uninstalled itunes completely at least 3 times....

    Try downloading and rerunning the 12.6.7 combo update http://support.apple.com/kb/DL1361

  • HT203200 Question: why won't one specific show download?

    Hi,
    When I was downloading 8 different purchased TV shows, all episodes of seasons I've purchased, one,5th on the list wouldn't download sighting err=8003. I retried many times with the same result. All the others downloaded before and after. Help?
    Hope someone has the answer!
    Thanks,
    Melissa Q

    So I received the 30G Video IPod for Xmas. Like it a
    lot. I have the most current version of ITunes. I
    purchased two tv shows and one music video on ITunes.
    I synced the iPod. Had sync all movies selected.
    It synced the TV shows, synced a few other movies
    that came with albums (Blue Orchid by White Stripes
    Video for example). BUT the music video I had just
    purchased won't sync. I tried a few tricks, created
    a playlist, etc.. but the movie section wouldn't
    even see the playlist. I tried putting the video in
    a music playlist but it wouldn't sync there either.
    How do I set up Movie Playlists so that they are
    recognized by ITunes? Any idea why that vid won't
    sync?
    Thanks!
    I have been having a similar issue with my TV shows. For example, I have the entire 2nd season of Lost and iTunes is syncing the episodes in whatever order it "feels like" {for lack of a better term} usually skipping large portions of the episodes which I had not watched, I even confirmed that the play counts were 0 and that I was syncing the most recent 5 unwatched episodes and it didn't work. It also did this with Beavis and Butt-head as well. What I ended up having to do is setting up the iPod to sync only checked items and then manually checking and unchecking the items I wanted and did not want to sync, and this fixed the issue.
    Hope this helps.
    iPod 80GB   Other OS   Windows Vista Ultimate Edition

  • Why won't my Flash show up on some browsers?

    I have Flash CS3 and have designed a Flash Page and published
    in for Flash Player ver 9. When I went to use one of the "cheapee"
    computers at my school, however, the Flash part of my page did NOT
    show up. Just a little red X (this is IE" Thinking that Flash just
    wasn't installed, I went to another site that I knew had Flash, but
    boom...their Flash movie DID show up.
    I right-clicked on their Flash movie and got "About Adobe
    Flash Player 6"
    AH HAH!! This cheap school computer only has Flash Player 6.
    That's fine, I hadn't used any advanced features in my movie so I
    changed my publish settings to version SIX. Published and uploaded
    my movie.
    Still won't show up.
    Any ideas why?

    Exactly. I want to transfer apps from my MacBook Pro to my
    iPhone. But only the home screens show up for the phone
    On the right. No app icons on the left. Please reply and let me know
    How to fix this.

  • Why won't album artwork show on ipod touch 4g?

    My itunes vers 10 is showing all of my cover art.  I have gone thru each track and made sure the artwork is attached to each track however only a fraction of the artwork shows on my ipod touch after syncing.  I have tried to reboot ipod to no avail.  Per other message board posts I have looked for a box to check which reads "Display album artwork on ipod" but I see no such button under Preferences nor on the Music tab when ipod is connected.  Pls advise.  Thx!

    I have had this problem since iOS4 and I recently (mostly) resolved it in iOS6.
    1. First make sure you do not 'Sign In' into iTunes store.
    2. I used playlists to resolve the issue. Create a playlist with one song, preferably one that does not have any album art.
    3. Create another playlist with all the songs you want to add.
    4. With your iTouch/iPhone attached open iTunes. Go to Device->Music. Under Sync Music:choose "Selected playlists,albums and genres". Choose the one song playlist from those shown. Click on the Sync(Apply) button. This will delete all of the songs.
    5. Once the deletion is complete choose the playlist with all the songs. Click on the Apply(Sync)button. This will install all the songs again and with album artwork.
    6. Once all the songs have been installed click on all the playlists that you want to add (no new songs) and click on the Sync(Apply) button again.
    You should now have your songs with album artwork and playlists installed. Hope this helps. The song in the one song playlist won't have any artwork even if it is included. There were some albums whose artwork were not installed. I had a 95% success rate. As I said, it mostly solves the problem for me.

  • Why do some radio buttons show in IE but not in Firefox?

    On some web sites a radio button or checkbox is available but Firefox does not show any outline or content for it. It can only be found by mousing over the screen and hoping that a text message such as "Click here to submit" shows up. In IE these buttons do show up in the normal way so it seems this is s problem with Firefox and not the particular web site.

    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites that cause problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    See also http://kb.mozillazine.org/Websites_look_wrong

  • Why won't adobe reader show text?

    I am working for my eagle scout rank and in order to do my service project, a form must be filled out on the computer as a pdf. I started the PDF on my old dell, and i downloaded Adobe reader for my mac to finish it. For preview, it takes the lines of the paragraph and overlaps the words, rendering it unreadable, and for adobe reader, the words are invisible unless editing those words. when the text box isnt selected the words disappear. Why isnt this working and is there a setting i can change to fix this?

    Minicooper7 wrote:
    Why isnt this working
    Difficult to say without further details. The fact that both Preview and Adobe Reader have difficulties with it suggests that the file itself may be corrupt—or that you have fonts issues on your Mac.
    You need to isolate the problem. Download another PDF file and check if it shows any anomalies. Gather info on the problem file; eg, in Preview, use Inspector (Tools > Show Inspector) and check PDF version, content creator, and PDF creator.

  • Why won't Focus Area Show up under selection from the new update of PS CC '14?

    So I am looking for the Focus Area in PS CC '14's new update, but I can't find it. I search it up on help but it does not find it.
    I've updated it all today. Is there a setting I need to have so that it will show up?
    Please help.
    -Jocelyn.Z

    I got it.  I still don't understand why so if someone can explain it I'd love to know.  But when I removed <div id=ads> and it's close div, putting the content of that div in with the webcam div, it all worked.  I don't have it that way on the page that uses the same size images and layout, but in a slideshow format, but for some reason it's what it took to make it work here.
    I'd love to know if anyone knows why.  But in case anyone else is struggling with something similar, maybe this will help.

  • Why won't the text show on top of a rectangle?

    When I use the rectangle frame tool to make a box and then put a text box on top it doesn't let the text show.
    This first picture is of my text box off the side, and then the yellow box I'm trying to put the text on top of, the second picture is what it shows me when I try to do that. It will show the text anywhere as long as it's not on top of a box and I can't figure out why or how to change it.
    Thank you in advance for your help!

    Select your rectangle and turn off the Text Wrap
    or
    Select your text box and set it to Ignore Text Wrap
    or
    in your preferences, set Text Wrap Affects Only Items Beneath. (not sure of the wording, but that's the jist.)

  • Why won't a cursor show up in the shape when I double click it?

    I thought you could just double click the shape to type in it...The cursor shows up outside the shape in the main part of the document or it highlights unrelated text from a text box, but it won't put a cursor in the shape.  After trying 50 times, I will finally get the cursor in the box. 

    PeterBreis0807 wrote:
    For every vague question, there is a vague answer.
    --> Fair enough
    What version of Pages?
    --> v. 4.3
    What shape?
    --> any shape, square, rounded corner square, circle, arrow...
    Inline or floating?
    --> etried both modes, but want floating
    Do you have an image in the shape?
    --> empty shape, want text
    What else is on the page?
    --> 3 text boxes, ea sized to fit 2 words
    Do you have a screen grab?
    --> prefer not to post pic, but it is basically default shapes colored white and made ~2x3" with plain text inside, dragged into rows where text boxes are titles.
    Anyway, there is really nothing out of the ordinary with the doc.  When Pages Help says "Double click the shape and type the text you want," it does not work to just double click in the middle of the shape, like I would guess.  I had to double click near the edge of the shape.

  • Why won't migrated files show up in search or in "all my files" despite being perfectly accessible?

    I have just migrated all my files to a new macbook pro from an old macbook pro and ì have stumbled upon a minor issue: all my files are here, and work perfectly fine, but they won't show up if I do a search in finder or in "all my files"  until I modify them (for a microsoft word document anyway). Music that I play  will show up in search but not in "all my files" if is not included in the itunes folder in my music, but if it comes from the itunes folder it won't show up in either even if I play it. Is there an easy way to solve this problem? It's not too much of an issue but opening every file or attempting to make it show may be cumbersome.

    Hey there Cabocel,
    it sounds like you're not seeing all you files in your All My Files list as expected. It seems to me like you need to re-index your Spotlight. The following article will help you do that:
    Spotlight: How to re-index folders or volumes
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Why won't some images show thumbnails?

    Seems like the graphics added or downloaded will spontaneously show a thumbnail most of the time but there are some jpegs that will not. I can't figure out why not. Does anyone have any idea what regulates this?

    I still don't know why that happens, but not important.

  • Why won't apple TV show up in Devices on itunes?

    Hi all.  I know this has got to have an easy answer......
    But here's my problem.  I bought 2 movies on my apple TV and they won't show upu on my itunes account on my MAC.  I have home sharing on both.  But there's NOTHING listed on the column on right of itunes - there's NO device listed - In fact the only time I have a device shown is when I physically have them connected by USB cable.  On the Apple TV it shows to be on, but nothing is listed there on that menu.  Like I said I have a MAC and so i don't think i need this Boujour program.  Can anyone help me?  I'll note that under Itunes -> perferences -> devices  appletv is NOT listed - so I'm not sure that's a problem or not.
    Please help.  And yes, I think I'm current on all versions and updates.
    Thank you!

    http://support.apple.com/kb/ts1567
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

Maybe you are looking for

  • Generating a square waveform of 100 KHz from one of the Anolog output channels of PXI-6713 ?

    Hi I am trying to generate a square waveform from one of the anolog output channels of PXI 6713. I am developing my application in VC++ My requirement is a continous 100 KHz square waveform with 90% duty cycle and 1.5 V amplitude. The following is th

  • Can someone suggest how to make an interactive poster?

    Hello everyone, Could someone suggest how to make interactive images using photoshop.  A professor of mine created a poster that had interactive graphics that made movements when rolled over as well as graphics.  If someone could suggest a tutorial i

  • What format converts best to Flash video?

    Hi folks! I'm trying to get the best Flash video I can. I can export from my editing program (Final Cut Express) in a number of formats, including QuickTime, mpeg4, and avi. Is there a preferred format such that the final conversion to Flash will be

  • Couldn't Update Table

    Dear Sirs, I want to update DBASE table via hsodbc service agent. I've already succeed to connect and select the table. But when I do the updating, I get an error message like this : ORA-28500 : Operation must use an updateable query. Could anybody h

  • Media Encoder CS5 Abbruch längerer Filme

    Hallo & so, beim bearbeiten mit CS5 hat sich gegenüber von CS4 nichts verändert. Längere fertige Filme ab ca. 1.30 Std bearbeitet mit Premiere CS5 lassen sich nicht zu Ende encondieren und schmieren dzbl. ab, somit eine Weiterverarbeitung nicht mögli