Keeping a grid a Fixed sized, when the vindow is resizes

Hi I have a problem with a "simple" swing app, i have made a program to take alot of user input, i have it in a GridLayout(9,1) if i just add this to frame.getContentPane(); then it looks nice, but if i then changes the size of the vindow (make it fullscreen), then it looks like hell :(
I have tryed a BorderLayout, but the CENTER bit has the same problem. Looks like this:
frame = new JFrame("UNF " + lokal +  " Indskrivningsprogram");
          Container contentPaneAll = frame.getContentPane();
          BorderLayout bLay = new BorderLayout();
          contentPaneAll.setLayout(bLay);
                Container contentPaneCenter = new Container();
          GridLayout gLay = new GridLayout(9, 1);
          gLay.setVgap(-5);
          contentPaneCenter.setLayout(gLay);
              //Adds alot of stuff to contentPaneCenter
          Dimension d = contentPaneCenter.getPreferredSize();
          contentPaneCenter.setMaximumSize(d);
          contentPaneCenter.setMinimumSize(d);
          contentPaneAll.add(contentPaneCenter, BorderLayout.CENTER);What i want is for the center part tp keep contentPaneCenter.getPreferredSize(); and then just add "gray" around it if in fullscreen.
Bedst regards
Grue
Ps sorry for my bad eng, not a native speaker...

853384 wrote:
.. What i want is for the center part tp keep contentPaneCenter.getPreferredSize(); and then just add "gray" around it if in fullscreen.Put it as a single component into a <tt>GridBagLayout</tt> with a <tt>null</tt> constraint, much as I did for the 'gradient' image in this Nested Layout Example.
If that does not answer your question, I suggest you post an SSCCE (like the linked example, & as opposed to 'code snippets').

Similar Messages

  • HT1414 How do you even get the iPad to show up in iTunes if it is locked?  It keeps saying that it can't open the device without the passcode... I don't understand how I am suppose to get into iTunes to fix it when the problem is that I don't know the pas

    Can anyone please help?  Thank you!

    You need to use recovery mode and this explains how to do it. You will lose everything on the iPad and will have to either sync with iTunes to get all of your content back or download it all again using the purchased tabs in the iStores on the iPad.
    http://support.apple.com/kb/ht4097
    Or you can follow these Instructions
    Disconnect the USB cable from the iPad, but leave the other end of the cable connected to your computer's USB port.
    Turn off iPad: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for iPad to turn off.
    If you cannot turn off iPad using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the iPad turns off, release the Sleep/Wake and Home buttons.
    While pressing and holding the Home button, reconnect the USB cable to iPad. When you reconnect the USB cable, iPad should power on.
    Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears you can release the Home button.
    If necessary, open iTunes. You should see the recovery mode alert that iTunes has detected an iPad in recovery mode.
    Use iTunes to restore iPad.

  • Anyone know how to keep a child Process from closing when the main Applicaiton is closed

      I have a Web based application that needs to use an older version of Java to run it properly . I have been able to sequence this and use a shortcut to call on Iexplorer.exe to open the browser in bubble and have the old version of Java run in the
    same bubble. This part is working as needed but the issue I have ran into is when a end user opens up a word document from a link  and "check's it out" to modify it and closes the browser it immediately closes the word document along
    with it. So the Question I have, Is there a way to keep a child process open when the main Application is closed . Anyone run into anything similar or any documentation on a way to keep the process alive until the end user closes it?

    Hi There,
    I don't believe there is a way to handle this currently within App-V...Other virtualization products do have the ability to exclude processes and force to run outside or the bubble or exclude them from terminating on shutdown.
    It would be a great feature request for a future release. You can easily request it here:
    http://appv.uservoice.com/forums/280448-microsoft-application-virtualization
    PLEASE MARK ANY ANSWERS TO HELP OTHERS Blog:
    rorymon.com Twitter: @Rorymon

  • BlackBerry keeps beeping all time - Only beeps when the connection with carrier is active.

    Sirs,
    I have a Curve 8900 with the  4.6.1.133 (platform 4.2.0.85).
    This device keeps beeping every 10 seconds, I have tried remove the battery when the BB was on, waiting for 1 minute, put it again.
    I have looked all configurations.
    I don´t have any idea and want to throw it in the window.
    Any ideas? Hints?
    NEW INFORMATION. The device only keeps beeping if the wireless connection with the carrier is active. If it´s disabled the beeps stops. I´m using Claro in Brazil. 
    Camilo
    Message Edited by camilotelles on 02-28-2009 08:14 AM
    Message Edited by camilotelles on 02-28-2009 08:14 AM
    Solved!
    Go to Solution.

    I have found the solution. This is a bug beetween a software in the SIM Card from the network operator and the BlackBerry device. It´s already solved. I had to follow some steps to enable and disable a specific feature of the network operator and wait for a dialog box to confirm my operation.
    The beeps comes with the dialog box, but the dialog box only apears if you are in a specific screen of the blackberry. If you are in the home screen, it will not appear and you only hears the beep.
    Camilo

  • How do I fix Firefox when the page freezes ?

    Please help my Firefox has started to freeze when I go to the next page of anything. It hangs for about what seems like 30 seconds, which can get quite annoying when your in a hurry. Is there a straightforward and uncomplicated way of fixing this, it didn't happen before the last two updates so I'm wondering if it's something to do with that. Thank you.

    I have called for the big guys. They should respond before too long.
    Good luck.

  • ITunes is telling me that I've already authorized 5 computers and that i have to de-authorize one to play my music! How can i fix this when the only computer I've authorized is my own.

    What I think has happened in the past 5years I've been using iTunes, I've cleaned off my hard drive 5times and saving all my music in the process. Each time I start over iTunes asks me to autherize that particular computer, but that computer/OS doesnt exsist anymore. How do I fix this?

    Read here since you are a Windows 7 user...
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases

  • How is one supposed to Fix Firefox when the computer does not open the new edition of Firefox that you just downloaded? Am I the ONLY one to ever have had thi

    I run win7 64x pro. This is a restatment of problem I posted yesterday I have a hard time believing I'm the first to ever have this problem which is as follows: I used CC Cleaner because of FunMoods, which is the onlt thing I have found that removes that virus thoroughly
    Having done that-Face book and a few other sites came up as hyperlinks only with no illustrations, So- I deleted Firefox completely and downloaded a new copy. It downloads but won't open. I used an old copy-13.0 & same thing-does not open.
    I have used Firefox for Win since it came out.. My rule of logic with computers is that when I have some problem I cannot solve myself- I CANNOT be the first person to have had that problem yet I see no answers. I would appreciate some help. Thank you.

    I am the same one who posted that question though the problem is exactly as described.. I watch the progress bar unpack the download and then it gives me the choice-run with previous settings or as administrator using a password.
    Either way-I do not get a new browser. I do get a screen saying that my previous settings may be partially lost. I think a month ago I had also used CC cleaner. At that time-right clicking worked. Now it does not matter. Clicking on the Mozilla download gives me the progress bar but NO unpacked browser.

  • Hi - my Imac's hard drive keeps starting and stopping, when the imac is idle.  The Imac is working perfectly otherwise.  Any ideas?

    Hi my 4 year old Imac's hard drive keeps starting, whirring briefly, then stopping, when the machine is asleep.  Doesn't do it when in actual use.  The Imac is working perfectly otherwise.  Any ideas?

    Gracias mi amigo; there are a lot of options on the side bar in console, but I think I can see the issue - calendar agent - thousands of entries, all identical. Recently installed outlook 2011, so ? conflicting with Ical?
    23/06/2013 00:31:52.122 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:31:52.168 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:32:27.116 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:32:27.116 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:32:27.116 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:32:27.116 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:32:27.162 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:01.310 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:01.311 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:01.358 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:36.378 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:36.379 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:36.379 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:33:36.425 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:11.034 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:11.034 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:11.034 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:11.082 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:44.993 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:44.993 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:34:45.039 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.013 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.014 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.014 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.015 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.015 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES
    23/06/2013 00:35:20.062 CalendarAgent[195]: 
    com.apple.message.domain: com.apple.calendar.store.inconsistency
    com.apple.message.signature: Other CalDAV
    com.apple.message.signature2: etag (ctag)
    com.apple.message.summarize: YES

  • All my designs shift when the web browser is minimized - Help

    Hello and thanks for looking! I have been building a PC repair website based off a template. I have tried all sorts of things to fix an issue I have with my site. I am having a problem with my Draw Ap Div's overlaping other content on my site when the browser is minimized. Here is my link http://www.tacsimwargames.com/911/pcrepair.html. Any help would be great!
    Thanks!
    Matt

    Hi - I think what you are trying to do is keep some of your content centred and some of it static - and that is causing the div's to overlap when the monitor is resized.  The easiest way I have found to keep that from happening is to build you site in a table, that way you can keep the content centred and looking nice in wide screen monitors, but on smaller screens it will keep it's continuity.  Hope that helps

  • Some webpages resize the window but when the window opens in a new tab, the entire firefox browser is resized. How do I stop this from happening?

    This usually happens when the window is resized in order to fit the smaller content/intention for a webpage.
    I would like Firefox to ignore the window resizing (down sizing) commands when opening a window in a new tab and just display the window in full size.

    Go into ''Tools > Options > Content'' and next to where it says ''Enable JavaScript'', click ''Advanced...''' and then untick ''Move or resize existing windows''.
    This is the only way to do it. I believe there is a bug filed to prevent all sites (by default) from resizing the window if there are more tabs open, but I don't think it has been fixed.

  • How do you have the help file .chm hold its window position when the user resizes the help window.

    One of my customers is complaining that the help contents will scroll out of view when the window is resized.  Is there a way to anchor the position while the window is resized?

    My CHM is a help file for an application. The application uses F1 to open specific topics for help.  Therefore the help file needs to be visible but not cover the application to much. The Content in this situation is text however the help project contains Images, tables, text, etc. 
    If the user searches for the word "audio" in the search and it takes them to a section or sub topic that is half way down in the Topic, they would like that section or subtopic to stay in the same place as they resize the help window.  Using Bookmarks if the topic is large enough clicking the search link will place the results in the top left of the doc view window, however this is not necessarily the top of the topic. 
    Im not sure how else to explain what the user is seeing, sorry.
    Please explain "Also whether it remains consistent depends on whether an absolute or percentage value has been added to it."

  • My macbook wont start the screen turn blue and stay like that for hrs. It only work when i use safe mode, i try to use disk utilities to fix it but the disk utilities keep saying error and a bunch of other stuff. I dont the cds the comp came with, help.

    my macbook wont start the screen turn blue and stay like that for hrs. It only work when i use safe mode, i try to use disk utilities to fix it but the disk utilities keep saying error and a bunch of other stuff. I dont the cds the comp came with, help. i've tried the command s command p command v but nothing i've tried to the safe mode then a quick restart but nothing
    disk utility give me this:
    Process:         Disk Utility [371]
    Path:            /Applications/Utilities/Disk Utility.app/Contents/MacOS/Disk Utility
    Identifier:      com.apple.DiskUtility
    Version:         11.5.2 (298.4)
    Build Info:      DiskUtility-2980400~60
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [86]
    Date/Time:       2013-11-05 03:29:41.247 -0500
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          9522 sec
    Crashes Since Last Report:           29
    Per-App Interval Since Last Report:  981 sec
    Per-App Crashes Since Last Report:   25
    Anonymous UUID:                      F6B8E263-76C8-4C7D-AA58-48134BF4BA78
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
    Crashed Thread:  0  Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
    0   libobjc.A.dylib                         0x0000000100c62fbc _read_images + 312
    1   libobjc.A.dylib                         0x0000000100c79721 map_images_nolock + 1266
    2   libobjc.A.dylib                         0x0000000100c62761 map_images + 115
    3   dyld                                    0x00007fff5fc039c5 dyld::notifyBatchPartial(dyld_image_states, bool, char const* (*)(dyld_image_states, unsigned int, dyld_image_info const*)) + 853
    4   dyld                                    0x00007fff5fc0c849 ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, ImageLoader::RPathChain const&) + 201
    5   dyld                                    0x00007fff5fc04d54 dyld::link(ImageLoader*, bool, ImageLoader::RPathChain const&) + 118
    6   dyld                                    0x00007fff5fc08f7c dlopen + 490
    7   libSystem.B.dylib                       0x0000000100a14e40 dlopen + 61
    8   com.apple.CoreFoundation                0x0000000100d78ef7 _CFBundleDlfcnLoadBundle + 231
    9   com.apple.CoreFoundation                0x0000000100d77e97 _CFBundleLoadExecutableAndReturnError + 1191
    10  com.apple.Foundation                    0x0000000101008355 _NSBundleLoadCode + 638
    11  com.apple.Foundation                    0x0000000101007c78 -[NSBundle loadAndReturnError:] + 742
    12  com.apple.Foundation                    0x000000010101960c -[NSBundle principalClass] + 38
    13  com.apple.framework.DUSupport           0x0000000100082080 -[DUModuleManager(_private) findDUModules:] + 405
    14  com.apple.framework.DUSupport           0x0000000100081ed9 -[DUModuleManager orderedModuleListOfModules] + 40
    15  com.apple.DiskUtility                   0x0000000100006082 0x100000000 + 24706
    16  com.apple.DiskUtility                   0x0000000100005f59 0x100000000 + 24409
    17  com.apple.AppKit                        0x0000000101444625 -[NSWindowController _windowDidLoad] + 538
    18  com.apple.AppKit                        0x00000001013e1f77 -[NSWindowController window] + 112
    19  com.apple.AppKit                        0x00000001015f61d9 -[NSWindowController showWindow:] + 47
    20  com.apple.AppKit                        0x00000001015c7c5c -[NSDocument showWindows] + 98
    21  com.apple.AppKit                        0x00000001015c64bb -[NSDocumentController openUntitledDocumentAndDisplay:error:] + 340
    22  com.apple.AppKit                        0x00000001014f7b44 -[NSDocumentController(NSInternal) _openUntitled] + 111
    23  com.apple.AppKit                        0x00000001014f79ab -[NSApplication _doOpenUntitled] + 257
    24  com.apple.AppKit                        0x00000001014f733b -[NSApplication(NSAppleEventHandling) _handleAEOpen:] + 185
    25  com.apple.AppKit                        0x00000001014f6fd9 -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] + 77
    26  com.apple.Foundation                    0x0000000100ffd0d6 -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] + 360
    27  com.apple.Foundation                    0x0000000100ffcf06 _NSAppleEventManagerGenericHandler + 114
    28  com.apple.AE                            0x0000000104d7332b aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) + 162
    29  com.apple.AE                            0x0000000104d73224 dispatchEventAndSendReply(AEDesc const*, AEDesc*) + 32
    30  com.apple.AE                            0x0000000104d7312b aeProcessAppleEvent + 210
    31  com.apple.HIToolbox                     0x00000001028a0619 AEProcessAppleEvent + 48
    32  com.apple.AppKit                        0x00000001013fc095 _DPSNextEvent + 1191
    33  com.apple.AppKit                        0x00000001013fb801 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155
    34  com.apple.AppKit                        0x00000001013c168f -[NSApplication run] + 395
    35  com.apple.AppKit                        0x00000001013ba3b0 NSApplicationMain + 364
    36  com.apple.DiskUtility                   0x0000000100002009 0x100000000 + 8201
    37  com.apple.DiskUtility                   0x0000000100001db8 0x100000000 + 7608
    Thread 1:  Dispatch queue: com.apple.libdispatch-manager
    0   libSystem.B.dylib                       0x0000000100a27c0a kevent + 10
    1   libSystem.B.dylib                       0x0000000100a29add _dispatch_mgr_invoke + 154
    2   libSystem.B.dylib                       0x0000000100a297b4 _dispatch_queue_invoke + 185
    3   libSystem.B.dylib                       0x0000000100a292de _dispatch_worker_thread2 + 252
    4   libSystem.B.dylib                       0x0000000100a28c08 _pthread_wqthread + 353
    5   libSystem.B.dylib                       0x0000000100a28aa5 start_wqthread + 13
    AND MORE TOO MUCH TO COPY N PASTE HELP PLEASE!!!!!

    Reset the PRAM
    Reinstall the operating system from the dvd (you will not loose your data)

  • I keep losing entire catalogs. I put in 30,000 images and cannot get to them. Put in 3,000 images and get error message "LR encountered error when reading its previous cash and needs to quit. LR will fix this problem the next time it loads.' I  have loade

    I keep losing entire catalogs. I put in 30,000 images and cannot get to them. Put in 3,000 images and get error message "Light room encountered error when reading its previous cash and needs to quit. light room will fix this problem the next time it loads.'
    I  have loaded light room several times and even exited computer for 8 hours. Still get error message

    A search of this forum shows lots of threads where this issue of "error reading cache" is solved

  • My ipod touch wont play any music, when i try to play a song, it just keeps pausing. no sound comes out of the headphones or internal speakers. what can i do to fix this problem? ive tried charging it and resetting it but nothing works.

    my ipod touch wont play any music, when i try to play a song, it just keeps pausing. no sound comes out of the headphones or internal speakers. what can i do to fix this problem? ive tried charging it and resetting it but nothing works.

    my ipod touch has the same problem. I restored it three times, but that can't help.

  • My iTunes was working fine, all my CDs would import fully and quickly. Now they are importing slowly and when the CDs get to the last track they don't import and the CD drive just keeps spinning without doing anything! How can I fix this?

    My iTunes was working fine, all my CDs would import fully and quickly. Now they are importing slowly and when the CDs get to the last track they don't import and the CD drive just keeps spinning without doing anything! How can I fix this?
    I don't want to have to restart or reinstall my iTunes again as I'll have to redo all my playlists etc

    Likely that CD then. Check visually for damage, blemishes, etc., not that there's anything you can really do about those other than return the CD.
    The drive sits there and spins because it is trying to re-read the CD.  iTunes has error correction which is contributing to all this re-reading, I believe, and you may be able to disable that in preferences if you aren't picky about the result.
    You can also try other rippers such as Max or XLD.  I know those have configurable error correction.  I like XLD but it is slightly tricky to use until you find that for some reason the author has put all settings under preferences, not just the set once and forget ones.

Maybe you are looking for