Panel isn't expanding with the window

Hey,
I am writing a Sudoku program, and well I haven't really done anything yet. All it does is draw the board (9x9 grid) on a Panel, then the panel is added to the Applet. Thing is, the Applet is set to a 550x550 size, but the Panel doesn't expand with it. It's stuck at the default(?) size. The TextFields (the grid) expand with the window, so only a few are shown on the screen. A screenshot can be found here -> http://i46.tinypic.com/2wnzqtu.png
Here's the code:
package sudoku;
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.GridLayout;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class PlaySudoku extends Applet implements ActionListener
     static final int FRAME_WIDTH  = 550;
     static final int FRAME_HEIGHT = 550;
     static final int BOARD_ROWS    = 9;
     static final int BOARD_COLUMNS = 9;
     static final int BOARD_WIDTH   = 500;
     static final int BOARD_HEIGHT  = 500;
     TextField[][] grid = new TextField[BOARD_ROWS][BOARD_COLUMNS];
     Panel board = new Panel(new GridLayout(BOARD_ROWS, BOARD_COLUMNS));
     public void init()
          this.setLayout(new BorderLayout());
          this.setSize(FRAME_WIDTH, FRAME_HEIGHT);
          for (int i = 0 ; i < BOARD_ROWS ; i++)
               for (int j = 0 ; j < BOARD_COLUMNS ; j++)
                    grid[i][j] = new TextField();
                    board.add(grid[i][j]);
          this.add(board, BorderLayout.CENTER);
     public void actionPerformed(ActionEvent e)
}Thanks,
Coh3n

Only just checked the image.
- What OS is that?
- What is the exact (copy/pasted in code tags) HTML used for the applet viewer?
Or perhaps - run this variant of your code and report back.
// <applet code='PlaySudoku' width='650' height='250'></applet>
import java.applet.Applet;
import java.awt.*;
public class PlaySudoku extends Applet
     static final int BOARD_ROWS    = 9;
     static final int BOARD_COLUMNS = 9;
     TextField[][] grid = new TextField[BOARD_ROWS][BOARD_COLUMNS];
     Panel board = new Panel(new GridLayout(BOARD_ROWS, BOARD_COLUMNS));
     public void init()
          this.setLayout(new BorderLayout());
          for (int i = 0 ; i < BOARD_ROWS ; i++)
               for (int j = 0 ; j < BOARD_COLUMNS ; j++)
                    grid[i][j] = new TextField();
                    board.add(grid[i][j]);
          this.add(board, BorderLayout.CENTER);
          // always a good idea
          validate();
          System.out.println("Size: " + getSize());
          System.out.println("os.name: " + System.getProperty("os.name"));
          System.out.println("java.vendor: " + System.getProperty("java.vendor"));
          System.out.println("java.version: " + System.getProperty("java.version"));
          System.out.println("java.vm.version: " + System.getProperty("java.vm.version"));
}Here are the results I'm getting, with no odd sizing artifacts.
andrew@pc1:/media/disk/proj$ javac PlaySudoku.java
andrew@pc1:/media/disk/proj$ appletviewer PlaySudoku.java
Size: java.awt.Dimension[width=650,height=250]
os.name: Linux
java.vendor: Sun Microsystems Inc.
java.version: 1.6.0_14
java.vm.version: 14.0-b16
andrew@pc1:/media/disk/proj$ Note that on this OS/SDK, the appletviewer can parse an applet element out of the first (commented) line of the Java source file.

Similar Messages

  • I keep geting this message when trying to udate to Itunes 10.5.1 "There is a problem with the Windows Installer package. A program run as part odf the setup did not finish as expected . Contact your support prersonel or package vender"

    I keep getting this message when trying to upgrade to Itunes 10.5.1
    Driving me nuts trying to upgrade. What can I do to correct this?
    "There is a problem with the Windows Installer package.
    A program run as part odf the setup did not finish as expected .
    Contact your support prersonel or package vender"

    Yes, I had found a similar solution also.  I'm running XP Pro, SP3.  I went Control Panels/ Add-Remove programmes/apple software update/ change/ repair.  Then run the 10.5 exe.
    While the programme updated from version 8 of iTunes, my new iTunes is now a mess.  Not all of my music was in the same folder previously but it all showed up on iTunes.  Now many albums have been left out, some have only a few tracks and some have two copies of some tracks as well as having other tracks missing.  I haven't begun to work on that.

  • I'm unable to install the newest version of itunes on my pc, the promt says that there is a problem with the windows installer package, but I have downloaded the exe more than once. Is anyone able to help?

    I'm unable to install the newest version of itunes on my pc, the promt says that there is a problem with the windows installer package, but I have downloaded the exe more than once. Is anyone able to help?

    Yes, I had found a similar solution also.  I'm running XP Pro, SP3.  I went Control Panels/ Add-Remove programmes/apple software update/ change/ repair.  Then run the 10.5 exe.
    While the programme updated from version 8 of iTunes, my new iTunes is now a mess.  Not all of my music was in the same folder previously but it all showed up on iTunes.  Now many albums have been left out, some have only a few tracks and some have two copies of some tracks as well as having other tracks missing.  I haven't begun to work on that.

  • Getting error and cannot download itunes.  says there is a problem with the windows installer package. a program required for the install to be complete could not be run.  any ideas?

    getting an error downloading itunes 64bit for windows 7.  says there is a problem with the windows installer package.  a program required for the install to be complete could not be run.  any ideas?  i uninstalled it last night when it would not open.

    Just in case, let's try a standalone AppleSoftwareUpdate.msi install.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe, and select "Extract to iTunesSetup". WinRAR will expand the contents of the file into a folder called "iTunesSetup".
    Go into the folder and doubleclick the AppleSoftwareUpdate.msi to do a standalone ASU install.
    (If it offers you the choice to remove or repair, choose "Remove", and if the uninstall goes through successfully, see if you can reinstall by doubleclicking the AppleSoftwareUpdate.msi again.)
    Does it install (or uninstall and then reinstall) properly for you? If not, what error message do you get? (Precise text, please.)

  • Upgrade to version 10.5.x, error - "There is a problem with the Windows Installer Package". I'm installing as Administrator, and have done an uninstall of the earlier version. Any ideas??

    Hi; Attempting to upgrade to version 10.5.x, but I keep on getting an error - "There is a problem with the Windows Installer Package". I'm installing as Administrator, and have done an uninstall of the earlier version. Any ideas??
    Needing to upgrade to allow connection of a 4S iPhone to the Laptop.
    Thanks!! - Tim.

    Repair your Apple Software Update.
    Go to START/ALL PROGRAMS/Apple Software Update. If it offers you a newer version of Apple Software Update, do it but Deselect any other software offered at the same time. Once done, try another iTunes install
    If you can't find ASU in all program, you can do it in CONTROL PANEL, ADD N REMOVE PROGRAMS.

  • Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Hi! I can't upgrade my iTunes 10.3.1.55 on my Windows XP 2002 SP3 to the latest version of iTunes. Got the message: "A problem has occured with the Windows Installer-package. A program needed for this installation could not be run." What to do?

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • How can i use text expander with the new Mavericks,

    how can i use text expander with the new Mavericks,

    I regret upgrading to mavericks for the same reason
    ftamez wrote:
    how can i use text expander with the new Mavericks,
    Now I have been searching - and you have to buy an app and it will cost you $34.99 (what a rip off)

  • ITunes won't upgrade to10.5. Error message "There is a problem with the Windows installer package. Contact the package vendor". I need help.

    iTunes won't upgrade to10.5. I'm on 10.1.17.
    When installing 10.5 it terminates with an error message "There is a problem with the Windows  installer package. Contact the package vendor".
    It does not provide an error code or details/description to further troubleshoot. As a result I can't upgrade my Apple devices to leverage the cloud.
    Any smarts out there who could help?
    Using PC Win-7 w/IE 7 (should that matter)
    Thanks much

    I know there's a million threads like this, but I thought I'd record my experience.  I, too, was having the original poster's error when I tried to update iTunes on Windows XP.  I think I was stuck on 10. 
    I solved it by un-installing iTunes and every other Apple app.  I discovered that Apple Software Update would not un-install as its MSI file could not be found.  I used the "Windows Install Cleanup" tool from Microsoft to remove Apple Software Update from the list of installed programs.  Google "kb290301" for a Microsoft page that includes a download link for it.  After that, I was able to install a fresh copy of iTunes 10.5.2.
    I'm not sure why this app's folder and MSI were missing from my computer.  I had once used Laplink PC Mover to move everything from my old computer to this one, and perhaps it missed a bit.

  • Trying to down load but get error message.... "there is a problem with the Windows Installer Package" Does anyone know how I fix this??

    "there is a problem with the Windows Installer Package" Does anyone know how I fix this??
    My itunes ends up being so out of date becuase I can never upgrade it.
    I have a sports kit and want to make sure I am using the most uptodate version
    I managed to delete the old version, just in case it was the fact it was about 10 versions out of date that was the problem but now I can't reinstall it at all......
    Please help

    Go to Microsoft website to fix install and Unistall problems. Click "Run now" from Fix it to remove all iTunes & related installer files:
    http://support.microsoft.com/mats/Program_Install_and_Uninstall
    Be aware that Windows Installer CleanUp Utility will not remove the actual program from your computer. However, it will remove the installation files so that you can start the installation, upgrade, or uninstall over.

  • Windows 64Bit Itunes Error : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR."

    I have a brand new HP laptop windows 64bit that is having issues installing Itunes 10.6.3. Whenever attempting to install, I get the error message : "THERE IS A PROBLEM WITH THE WINDOWS INSTALLER PACKAGE. A PROGRAM REQUIRED FOR THIS INSTALL TO COMPLETE COULD NOT BE RUN CONTACT YOUR SUPPORT PERSONNEL OR PACKAGE VENDOR." I thought this was an issue with the new version, and attempted to retrieve/install older versions of Itunes and same issue occurs. I have tried other forums and resolution tips from : https://discussions.apple.com/docs/DOC-3551 and nothing still. It appears that apple installs bonjour and nothing else. I have tried extracting the itunes package and installing the executables seperately, but everytime the error stil arises. I cannot repair the apple software update as it cannot install from the error mentioned above. Looking through the logs, it shows error : 1721, problem with windows installer package.Does anyone have any suggestions on what to try?

    There are so many different error and problems peopl are having.
    This is a link to mine
    https://discussions.apple.com/thread/3467825
    I think it has to be something on Apples end.
    Hopefully they fix it soon. Ive used a few GB redownloading and Im going crazy
    hope this settles you a bit

  • HT1926 can't install quicktime or itunes on windows 7 get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run

    please help. Can't install quictime player or itunes on windows 7. Get the error message There is a problem with the windows installer package. A program required for this install to complete could not be run. Have followed all the steps suggested and still no luck.

    thank you for trying to help. I do not have apple software update on my computer. I have tried to install several programs so i could install it but every installation will not finish and rolls back and says no changes were made to my computer so i can't install the update. I even tried to force install as administrator but nothing works. Any help would be greatly appreciated. I have windows 7 64 bit.

  • Blackberry 10 the data isn't compatible with the version of the device software that you are currently running

    Hi,
    my update to 10.3.1.1565 messed the handwriting input up on my phone.  so I tried to downgrade to 10.2.1, upon doing so all my files were wiped,  however I thought I was being smart by doing a complete backup this morning while running 10.3.1.1565 prior to attempting the os downgrade to 10.2.1 using BlackBerry Link, 
    Anyway I had to restore my device back to 10.3.1.1565 and now when I attempt to do a restore using the .bbb ( backup ) which I created earlier on today i.e getting the following error message:
    blackberry 10 the data isn't compatible with the version of the device software that you are currently running
    the software versions on my phone now and the software version when I did my backup are exactly the same 10.3.1.1565.  I'm able to restore my user files and apps ect, as it offers to do a partial restore,., but my contacts, and remember files are now gone.  I NEED THESE.  how do I get these back..
    please help..
    Thanks,
    GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!
    Solved!
    Go to Solution.

    Hi,
    I figured it out.  so I figured I would post.  Apparently BlackBerry pulled the 10.3.1.1565 update.  anway not sure what happened butI ended up usng Shenshi and grabbing an update from a different carrier, upon doing so I am now able to do a complete restore using my old BBB file, 
    GeoYeo - Free Local classifieds - Built for Blackberry 10, if you like it please Rate It and Share it!

  • I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after and extended period of time please help

    I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after an extended period of time please help.  Thanks!

    I have a Mac, IPad, I phones, and 2 Windows Vista Pcs and I'm having trouble with the Windows Laptop staying connected.  I have to re-boot after an extended period of time please help.  Thanks!

  • Problems with the windows update site in 32-bit Vista Business

    Hi Everyone,
    I am experiencing problems with the windows update site. As far as I know it shold make a link to the Windows Update module on-board and show the available updates after scanning. However, I get to the page that says "Checking if your computer has the latest version of Windows updating software for use with this website" and the next page I get is "The website has encountered a problem and cannot display the page you are trying to view". The error number is 0x80070002. I go to the knowledge base and delete the content of the Data Store folder as advised, but to no use at all. Active X controls are enabled Java is working fine. I've cleaned the register and everything, did a complete scan with Onecare as advised by Microsoft, which did not find anything but again the same error message. I am using KIS 2009 and I am sure I have no viruses or any other malware. I even tried to go to the update site with the KIS switched off but to no avail too. On the other hand I don't have problems with the automtic updates and when I run a manual update from the Update module everything is OK. Do you have any suggestion as to what might be the issue with the website updates?
    P.S. I am using 32-bit Windows Vista Business on a Lenovo W500.

    hello
    You may be having a problem with the windows update agent.Since its a problem relating to windows update microsoft support personnel may help you out.follow this link and contact them by chat or email
    http://support.microsoft.com/common/international.aspx?gprid=6527&acty=Start&ctl=Region&wf=Workflow&... 
    Cheers and regards,
    • » νιנαソѕαяα∂нι ѕαмανє∂αм ™ « •
    ●๋•کáŕádhí'ک díáŕý ツ
    I am a volunteer here. I don't work for Lenovo

  • Problems with the (WINDOWS 8 pro -64 BIT) IN THINKPAD L520 - 5016 RL2

     I have some problems with the (WINDOWS 8 pro -64 BIT) is not working properly IN THINKPAD L520 - 5016 RL2.
    1. Message appears telling me that the drivers of the display  has been restored crash.
    2. The mouse pointer moves very slowly sometimes, and sometimes does not move for a while.
    3. Device software such as lenovo-airbag protection , lenovo-internet connection and lenovo web connection........ its  is not compatible with the system, and do not work.
    What is the solution؟

    Hi, MUJAHED
    I have a few questions for clarification I would like to ask about your first two issues:
    1) Can you copy the contents of this message and respond back with them. Any error codes or direct quotation from the system can really help in diagnosing a problem.
    2) Does this only apply to the TrackPad, or does this behavior also occur with an external mouse? It may help to download the latest mouse drivers for your system, which can be found here.
    As for your last issue with the Lenovo service not being compatible with the system: Unfortunately, software for these applications has not been released for Windows 8. Windows has its own network settings that you can use to connect to the Internet and networks, so that is still possible, though you may not enjoy it as much as Lenovo's program.
    Best,
    Adam
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution!" This will help the rest of the community with similar issues identify the verified solution and benefit from it.

Maybe you are looking for