How to stop size of JTextField from changing when I change font to bold

I'm working on a Sudoku solver for a CS project. I've got JTextFields for the input. I want to bold the entries of the begining puzzle, like they are in the magazines. When I set the font to bold, it changes the size of the text field. I'm using the gridbaglayout and have tried everything to set in stone the size of a text field, but nothing seems to work. I've set the maximum, minimum size, the setSize method, as well as setting the prefered size. But no matter, when I change the font from plain to bold, the box grows in size. How do I prevent this from happening. I can post my gui code if it would help.
Here is a link to my grid, with the upper left square having bold text:
http://12.227.129.113/CS486/Project4/Project4.html

add them to panel/s set as a gridlayout 9 x 9, or (3 x 3) x (3 x 3)
simple demo of a 9 x 9
import java.awt.*;
import javax.swing.*;
class Testing extends JFrame
  JTextField[] tf = new JTextField[81];
  public Testing()
    setLocation(200,100);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    JPanel p = new JPanel(new GridLayout(9,9,5,5));
    for(int x = 0, y = tf.length; x < y; x++)
      tf[x] = new JTextField(2);
      tf[x].setHorizontalAlignment(JTextField.CENTER);
      p.add(tf[x]);
    tf[0].setFont(tf[0].getFont().deriveFont(Font.BOLD));
    tf[0].setText("9");
    tf[1].setText("3");
    tf[66].setFont(tf[66].getFont().deriveFont(Font.BOLD));
    tf[66].setText("9");
    getContentPane().add(p);
    pack();
  public static void main(String[] args){new Testing().setVisible(true);}
}

Similar Messages

  • How do stop my i photo from loading when i start my computer

    How do i stop i photo from loading when i start my computer

    Are you still using Snow Leopard 10.6.8? If so then select the iPhoto icon in your Dock and hold down the mouse, click Options and make sure Open at Login is NOT checked.

  • HT204053 How can i download my pics from icloud , when i change my iphone.?

    Hello
    Any friend can help me?

    Photo stream photos only remain in iCloud for 30 days.  If they are in photo stream, your new phone would only be able to access photo stream photos from the last 30 days; older photos would be lost.
    Camera roll photos are included in your backup.  If you are replacing an older iPhone, back up the old phone to iCloud, then restore this backup to your new phone when you set it up.  This will transfer camera roll photos (and videos), text messages, settings, app data, ringtones, apps and other purchased media, etc.  You might also want to import the photos to your computer for safekeeping as explained here: http://support.apple.com/kb/HT4083.

  • How to stop the option key from changing tools when trying to subtract from a selection?

    How to stop the option key from changing my tools when I am trying to subtract from a selection?
    I'm running CS3 on Mac OS Leopard, and the automatic tool switching slows me down, but even preferences doesn't show a way to turn this off.
    Thanks for your help.

    With any marquee tool, JUST holding down the option key should not switch tools. You need to explain the problem much more carefully, It's completely impossible to tell from your description whats going wrong.
    automatic tool switching
    The only preference related to this, is to do with the SHIFT KEY - "use Shift key for tool switch".

  • How to stop the tab bar from automatically hiding itself?

    ive only found how to stop the address bar from disappearing and everyone with the tab problem seems to have posted this over a week ago and still hasnt been fixed yet if noone has a fix im out and done with firefox they can suck a fat one
    why add this feature! i can understand the address bar but not the tabs all you have to do to hide it was push the tab button again and its gone was that so fucking hard that you had ruin a perfectly fine browser

    Hello,
    In Firefox 23, as part of an effort to simplify the Firefox options set and facilitate future improvements to Firefox, the option to hide the tab bar was removed.
    Fortunately, this can easily be resolved if you desire the keep tabs hidden. You can install "[https://addons.mozilla.org/firefox/addon/hide-tab-bar-with-one-tab/ Hide tab bar with one tab]", an extension hosted on Mozilla's add-ons site, which will restore the ability to hide the tab bar.
    Thank you and I hope this helps!

  • How to stop the gray wheel from spinning after logging out

    how to stop the gray wheel from spinning after logging out?

    Frank ...
    Make sure to quit all open applications before logging out.
    Your proflie indicates your Mac has v10.7.1 installed.
    If that is the case, updating your system software will help as far as functionaly as well as security.
    Install the OS X Lion Update 10.7.5 (Client Combo)
    Then restart your Mac.
    message edited by:  cs

  • Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the pro

    Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the program and did a few profile building sessions, now it pops up each time I start the program, blocking me from using it. Help sure would be appreciated.
    Jay

    I looked at your post this morning and did not know enough to respond, other than to find out that links to iListen now go to newer, renamed software. Considering it's been nine hours with no response, I'm suspecting few people here have experience with that software. You could contact the current copmany that used to sell that package and see if they have any archived support info.
    BTW: please check you entry for "Mac OS" in your profile. It says iOS, which cannot run on an iMac. iOS is the system for phone and iPads but can't run on Mac computers. Do "About this Mac" from the Apple menu and see what it says about the OS version. Should look like this:
    If the "Processor" line says "Intel," you have a newer Mac than the old modles this forum covers; Intel iMac have their very own forum here:
    iMac (Intel)

  • How to stop Adobe Flash plugin from repeatedly crashing Firefox?

    How to stop Adobe Flash plugin from repeatedly crashing Firefox?

    yeah, having the same problem.
    Hulu is working on my internet explorer 8, tho... Interesting thing is that it detected I didn't have the 10.1 version of adobe flash player even though I just downloaded that on firefox. So MAYBE the problem is between firefox and adobe. Just a guess

  • Anyone any advice on how to stop my mail "activity" from continuously caching? is this a problem? I have had inbox issues recently that are not resolved yet but I am not sure if they are related.

    Anyone any advice on how to stop my mail "activity" from continuously caching? is this a problem? I have had inbox issues recently that are not resolved yet but I am not sure if they are related.

    Quit Mail. Force quit if necessary.
    Back up all data. That means you know you can restore the Mail database, no matter what happens.
    Triple-click the line below on this page to select it:
    ~/Library/Mail/V2/MailData/Envelope Index
    Copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder
    from the menu bar. Paste into the box that opens (command-V), then press return.
    A Finder window will open with a file selected. Move the selected file to the Desktop, leaving the window open. Other files in the folder may have names that begin with "Envelope Index". Move those files, if any, to the Trash.
    Log out and log back in. Relaunch Mail. It should prompt you to re-import your messages. You may get a warning that the index is corrupt and that Mail has to quit. Click OK.
    Test. If Mail now works as expected, you can delete the file you moved to the Desktop. Otherwise, post your results.

  • How to stop safari on ios7 from remembering history?

    How to stop safari on ios7 from remembering history?
    I hate to continually delete my history. Is there a way to stop it or set it to delete it on its own every day?

    Hey Bigchins!
    I have an article here that can address your question for you. The feature you are looking for is called private browsing, and it is explained here:
    To enable or disable Private Browsing, turn Private Browsing on or off.
    Private Browsing in iOS 5 protects private information and blocks some websites from tracking your behavior. Safari doesn't remember the pages you visit, your search history, or your AutoFill information.
    Note: While Private Browsing is enabled, the Safari bars appear black or dark instead of blue or gray.
    iOS: Safari web settings
    http://support.apple.com/kb/HT1677
    Thanks for coming to the Apple Support Communities!
    Regards,
    Braden

  • CAN SOMEONE PLZ TELL ME HOW TO SHUT OFF THE LIGHT FROM FLASHING WHEN I RECIEVE A CALL?

    CAN SOMEONE PLZ TELL ME HOW TO SHUT OFF THE LIGHT FROM FLASHING WHEN I RECIEVE A CALL?

    Settings>general>accessibility>led flash alerts off

  • Lync 2013 : two problems 1) quicked off from meeting when presenter change 2) Freeze when leaving first call of day

    Hello,
    I have two problems with Microsoft Lync 2013 (see level in screenshot). The first one appeared after May Windows updates and is so annoying that I decided myself to open a post in this forum, with the second one. The first problem is the most important for
    me (see why when reading) and the second one is the cherry on the cake if solved, but is minor.
    1) I'm kicked off from meetings when presenters change
    In an online meeting, when presenters change, I'm kick off since last May updates (very clear since it didn't happen before). I'm unable to specify if it occurs when I'm presenter or just attendee, but that could influence. I will try to report if/when I
    notice a difference.
    THIS IS REALLY IMPORTANT, Please help me solve this !
    2) Lync freezes for approx. 30' to 1min. when leaving first call of day
    I reboot my PC every day. I always notice that after leaving voice call from my first meeting of the day, Lync freezes (doesn't respond message) for 30' to 1min. This is when I leave audio, not meeting window. This never occurs again in the course of the
    day. Windows goes into hourglass, then it works again.
    Does anyone know about this ? Any action to help diagnose or solve this ?
    Again this is less important than first problem
    Thanks for help
    -Pierre

    The steps to remove the update:
    Open Control Panel, click Programs, and then, under Programs and Features, clicking View installed updates.
    Click the update that you want to remove, and then click Uninstall.
    For Lync 2013 May 2014 update, it is KB2880980.
    You can check the following website about the drivers:
    http://www.driverscape.com/download/plantronics-c320-m
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make
    sure that you completely understand the risk before retrieving any suggestions from the above link.
    Lisa Zheng
    TechNet Community Support

  • [svn:fx-trunk] 10545: Make DataGrid smarter about when and how to calculate the modulefactory for its renderers when using embedded fonts

    Revision: 10545
    Author:   [email protected]
    Date:     2009-09-23 13:33:21 -0700 (Wed, 23 Sep 2009)
    Log Message:
    Make DataGrid smarter about when and how to calculate the modulefactory for its renderers when using embedded fonts
    QE Notes: 2 Mustella tests fail:
    components/DataGrid/DataGrid_HaloSkin/Properties/datagrid_properties_columns_halo datagrid_properties_columns_increase0to1_halo
    components/DataGrid/DataGrid_SparkSkin/Properties/datagrid_properties_columns datagrid_properties_columns_increase0to1
    These fixes get us to measure the embedded fonts correctly when going from 0 columns to a set of columns so rowHeight will be different (and better) in those scenarios
    Doc Notes: None
    Bugs: SDK-15241
    Reviewer: Darrell
    API Change: No
    Is noteworthy for integration: No
    tests: checkintests mustella/browser/DataGrid
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-15241
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/DataGrid.as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridBase .as
        flex/sdk/trunk/frameworks/projects/framework/src/mx/controls/dataGridClasses/DataGridColu mn.as

    Hi Matthias,
    Sorry, if this reply seems like a products plug (which it is), but this is really how we solve this software engineering challenge at JKI...
    At JKI, we create VI Packages (which are basically installers for LabVIEW instrument drivers and toolkits) of our reusable code (using the package building capabilities of VIPM Professional).  We keep a VI Package Configuration file (that includes a copy of the actual packages) in each of our project folders (and check it into source code control just as we do for all our project files).  We also use VIPM Enterprise to distribute new VI Packages over the network.
    Also, as others have mentioned, we use the JKI TortoiseSVN Tool to make it easy to use TortoiseSVN directly from LabVIEW.
    Please feel free to contact JKI if you have any specific questions about these products.
    Thanks,
    -Jim 

  • Why didn't my iCloud account name change when I changed my Apple ID?

    Why didn't my iCloud account name change when I changed my Apple ID (because I got a new email address)?

    It doesn't change on your device automatically.  To change the iCloud ID on an iOS device you have to go to Settings>iCloud, tap Delete Account, provide the password for the old ID when prompted to turn off Find My iDevice, then sign back in with the ID you wish to use.  If you don't know the password for your old ID, or if it isn't accepted, and if your old ID is an earlier version of your current ID, go to https://appleid.apple.com, click Manage my Apple ID and sign in with your current iCloud ID.  Click edit next to the primary email account, change it back to your old email address and save the change.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iDevice on your device, even though it prompts you for the password for your old account ID. Then save any photo stream photos that you wish to keep to your camera roll.  When finished go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https://appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  Now you can go to Settings>iCloud and sign in with your current iCloud ID and password.
    To change the ID on your Mac, go to System Preferences>iCloud, sign out, then sign back in with the new ID.

  • HT4363 does your home sharing apple id change when you change your itunes id?

    Does your home sharing ID change when you change you apple account ID?

    Try using Appleid.apple.com and manage your apple id or contact Apple 1-800-MYAPPLE

Maybe you are looking for

  • How can i get the name of the lan that the task is in from a bean

    I'm using jdeveloper ps6 and i wan to get the name of the lane that the my task now is on to display on a page and to disable and enable some user fields depending on the name of the lane, as i've 4 organizations and i want to know the name the curre

  • Super simple bash music player

    I've got this little script that continuously plays random songs: #!/bin/sh songs=(~/music/*/*/*) total=${#songs[@]} while true do song=${songs[$RANDOM%$total]} oggdec "$song" -o- | aplay -q done I'd like to be able to skip a song and go to the next,

  • Printing From InDesign

    Hello, I am trying to print a document from InDesign, but it looks atrocious. My printer profile is selected from the print dialogue box (Epson Stylus Photo R1800), the appropriate pages are set, paper size in this case is US Letter, Output "Color" i

  • Restore data (iTunes Library, Photo's, files etc.) to Snow Leopard from a Time Machine backup made on OSX Lion?

    Hi, I have OSX Lion and have been backing up to Time Machine, I now want to do a clean install of Snow Leopard (not from backup), but can I restore my data (iTunes Library, Photo's, files etc.) to Snow Leopard from a Time Machine backup made on OSX L

  • ITUNES: "périphérique ne répond pas", problèmes lors de la finalisation

    Voilà, cela fait deux fois que j'ai le message suivant en gravant une liste de lecture sur itunes pour en faire un cd audio. Ce message apparait lors de la finalisation du disque et fait que les pistes de la fins déconnent et que les infos cd-text ne