Is there an easy way to programatically resize a JFrame?

I'm having layout problems. When my app starts up, some things are not laid out correctly. If I resize the frame by one pixel even, the entire thing redraws and it's correct.
There must be a way to force resizing of a JFrame programmatically that would achieve the same effect. However, there must also be a programatic way to say, "redo all the layouts". I've tried the obvious ones, like doLayout(), to no effect. What actually happens when a JFrame is resized? I basically want all that to happen, minus the actual size change.

Yes typically caused by adding components to your frame after you have set it to be visible. However you can call frame.repaint(); to get the frame to repaint itself. When you resize a frame by even 1 pixel, frame.repaint() is called automatically to redraw all the contents with the new size you specify. So if you bypass the resize and call repaint you will get the same effect.
Hope that works.
Jason Barraclough.

Similar Messages

  • Is there an easy way to make JSpinner wrap around at max/min values?

    I have several pages with a couple dozen JSpinners to set various values - mostly numeric, but some are not.
    I would like to make them wrap around when either the max or min values are reached.
    Is there an easy way to do this?
    I was hoping for something like an "enableWraparound" property, but I haven't found such an animal.
    I suspect I could add value change listeners to all the components and do it by brute force,
    but there are too many spinners scattered around to make that an option I would like to take.
    Any suggestions?
    Thanks.

    Ok, it looks like custom spinner models are the way to go.
    Hopefully, I can create a couple that are generic enough to meet my requirements without too much pain.
    It looks like the ones I have already created will be easy enough to modify.
    Thanks for the feedback.

  • Is there an easy way to clear the contents of Download Folder?

    Is there an easier way to clear out files (send to trash) from the downloads folder, other than dragging one by one? The downloads folder closes immediately upon dragging one file out.

    You do not need to invoke Finder to do this. Create a new empty Automator workflow and use the "Run Shell Script" option. Paste in the following....
    mv ~/Downloads/* ~/.Trash
    You can then save the workflow as an application, attach it as a Finder action or add it to the scripts menu, whichever you like better.
    If you would like to bypass the Trash and just completely delete the Downloads folder contents immediately, then paste in this command:
    rm -rf ~/Downloads/*

  • HT1660 is there an easy way to delete the whole itunes library and and start again. I notice there is only an add file/folder button but no remove facility

    I recently upgraded to the iphone 5 and managed to sort the transition out with little trouble but noticed when I tried to put my music on that Itunes has messed with album info and either it or me has generated several copies of the same albums over the years and it makes it quite dificult to sort it all out before reloading on the phone. To stop the chaos I had hoped to clear the library and start again but cant find a way to do it. I was hoping to sort all my music out in original files and consolidate them into a proper folder. HOw do I do this. I notice there is an add fole and folder button but no take away??? is there an easy way?

    Use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. If you have multiple references to the same files then don't send to the recycle bin. Use my DeDuper script if you don't want to do it by hand. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • Is there an easy way to reimport all songs in my itunes folder?

    This may sound like a weird question but here goes... When I bring up my iTunes I have 8731 files (mostly music) that come to about 41.33G's but when I right click on my iTunes Music folder and select properties there are 8809 files and a total of 48.5G's. I am trying to free up some disk space and can't figure out why there is such a difference. I had issues with Norton 360 and removed it but I had to restore my music files from an external drive and when I did so I lost the links for music that I added after my last back-up. I noticed that TV shows I bought from Apple were not in my iTunes but I was able to locate them in the folder, and import them back into iTunes. I have a feeling there are music files in my folders that are not linked to iTunes but can't figure out how to import them without going through all 8800+ files. Is there an easy way to import all the files without losing the current playcounts or a way to figure out which files may be duplicated in my iTunes Music folder. Seems like I am wasting 7G somewhere that I would like to recover. I already went through the duplicate songs and that didn't help. Any suggestions would be great...
    hp pc m260n   Windows XP   media center

    I have a feeling there are music files in my folders that are not linked to iTunes but can't figure out how to import them without going through all 8800+ files. Is there an easy way to import all the files without losing the current playcounts
    AFIK there isn't an easy way of linking up to a lot of dead tracks and retaining play counts etc, except by finding the dead tracks and repairing each link individually. The only exception to this is if there is a simple error in the path that can be fixed by a search and replace on the xml library file, then rebuilding the library. However it doesn't sound as though that would be a solution for you.
    This MacMuse tip has a way of finding dead tracks if that helps.
    http://discussions.apple.com/thread.jspa?threadID=121967
    It is much simpler to sacrifice the playcount information and just reimport your iTunes Music folder. Then you can eliminate the dead tracks with a script. One of the forum members has written one that you can find here:
    http://home.comcast.net/~teridon73/itunesscripts/

  • I am looking to "move out" of my computer and into my wife's, is there an easy way to accomplish this task, keeping all my files and setting up a second user?

    I just bought a new external 3TB hard drive for this task and want to keep my items seperate from hers for both our sanity.
    I figured that I would do a time machine back up and use that to do the move part of things.
    But as to setting up the new user on her computer I am just not sure if I can "tell" the computer to only use the new drive for my stuff and only acces the new drive for all things related to that new profile.
    More then anything else I want to be able to say that all things that are hers have not been touched/acccesed/deleted by any of my actions. And that I am "confined" to the new drive.
    I hope this makes sence.
    Mr Geef

    I have a feeling there are music files in my folders that are not linked to iTunes but can't figure out how to import them without going through all 8800+ files. Is there an easy way to import all the files without losing the current playcounts
    AFIK there isn't an easy way of linking up to a lot of dead tracks and retaining play counts etc, except by finding the dead tracks and repairing each link individually. The only exception to this is if there is a simple error in the path that can be fixed by a search and replace on the xml library file, then rebuilding the library. However it doesn't sound as though that would be a solution for you.
    This MacMuse tip has a way of finding dead tracks if that helps.
    http://discussions.apple.com/thread.jspa?threadID=121967
    It is much simpler to sacrifice the playcount information and just reimport your iTunes Music folder. Then you can eliminate the dead tracks with a script. One of the forum members has written one that you can find here:
    http://home.comcast.net/~teridon73/itunesscripts/

  • Is there an easy way to filter a 2-d array based on the values of two of the fields?

    Is there an easy way to filter a 2-d array based on the values of one of the fields. In my attached VI the output array has the following format:
    TimeStamp        Ident                Frame Type          Bytes    Data
    10:57:07.621   3AD00016   CAN Data Frame   8          0000000000000000
    10:57:07.622   3AD00017   CAN Data Frame   8          000005E000000000
    10:57:07.624   3AD00018   CAN Data Frame   8          0000000003300000
    10:57:07.625   2DC00000   CAN Data Frame   8          0000000000000000
    10:57:07.626   3AD00019   CAN Data Frame    4         0000030000000000
    I would like to delete any rows that do not have an "Ident" between the values of 3AD00000 and 3AD0001E. So for the above data the fourth row would be deleted. The only way I can see to do it is to form a 1-d array. Is there a better approach?
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    CMM_SN_MULTI.vi ‏20 KB

    Hi chuck72352,
    after you have sorted your data, you can use the InRange Function. Combined with a "search 1D Array" you'll get the range you really want.
    Mike
    Attachments:
    ArraySubset.PNG ‏25 KB

  • Is there an EASY way to submit podcasts to the itunes store? i've tried creating podcasts in garageband, then somewhere after wordpress  itunes  doesn't recognize the feed. my process has been (i am open to suggestions for other free and EASY services/me

    is there an EASY way to submit podcasts to the itunes store? i've tried creating podcasts in garageband, then somewhere after wordpress  itunes  doesn't recognize the feed.
    my process has been (i am open to suggestions for other free and EASY services/methods):
    garageband : create & edit audio. add 1400x1400 image.
    share to itunes.
    drag file to desktop.
    upload .m4a file to google drive.
    create a link post in wordpress using "podcast" tag & create "podcast" category.
    click on "entries rss" in wordpress, which takes me to the rss subscribe page (which is basically just my wordpress address with "/feed" at the end.
    i copy this url.
    go to itunes store > then "submit a podcast"
    itunes gives me the error message "we had difficulty downloading episodes from your feed."
    when i try to subscribe to my podcast in itunes, it does, but gives me no episodes available.
    i went back into wordpress and changed settings/ reading settings to : "full text" from "summary"
    still the same error message.
    i added a feedburner step after wordpress but got the same errors. i don't think i should have to add feedburner.
    wordpress seems to be encapsulating the rss, what am i doing wrong?
    this so much easier when you could go directly from garage band to iweb to mobileme; i miss those apple days (also idisk).

    if anyone has a super EASY process, i would LOVE to know what it is. EASY, meaning no html and also free. there are many free online storage systems available, many of which i currently use. the above process was just me trying to figure it out, if you have an easier method, please share. thank you so much!

  • Is there an easy way to generate a site map of an APEX application ?

    Hi.
    Is there an easy way to generate a site map of an APEX application ?
    Thanks.

    Depends on your definition of "easy"...
    Patrick Wolf provided one way to do this a few years ago.

  • PSE10: Is there an easy way to add a vignette?

    Besides using Filter > Correct Camera Distortion, is there an easy way to put a vignette on a picture?  The method I just named doesn't give me the smooth, uniform fade that I need for creating collages, etc.  Thanks!

    Sure, just use any selection tool to make your selection.  Here, I simply used an elliptical selection:
    Then, use Select...Feather to feather the selection.  I used 10px.  Hit the Ctrl+J keys to copy that feathered selection to a new layer with a transparent background:
    Ken

  • Is there an easy way to add a location map to Pages?

    Hi,
    Using the latest version of Pages, is there an easy way to add a location map?
    Many Thanks
    Simon.

    Are you trying to copy an image from the Maps application? 
    If you are, the easiest way I have found to do this is by going to Edit>Copy in Maps and then pasting the image in the Pages document. 

  • Is there an easy way to find out if a user has a message in their voicemail.

    Is there an easy way to find out if a user has a message in their voicemail from the
    UNITY subscriber page? Or anywhere I can look to see if they do.  I don't have access to the exchange servers.  We are currently running UNITY 5.0(1).  thanks

    The only way you'll be able to do that is to login to Outlook Web Access, or possibly setup an IMAP client to that user's mailbox or have TAC run the DohPropTest in attach mode to return the contents of the user's inbox.  If the first two don't work, I'd go with the latter and let TAC help you verify if there are any messages in the inbox that are unread.
    Hope that helps,
    Brad

  • HT1473 Sometimes when I copy a CD into iTunes all of the songs do not show y up in one album, but mutiple albums, all with the same name. Is there an easy way to get all of the songs into one album.

    Sometimes when I copy a CD into iTunes all of the songs do not show y up in one album, but mutiple albums, all with the same name. Is there an easy way to get all of the songs into one album.

    Generally adding a common album artist will fix things.
    tt2

  • HT201302 I have over 1000 photos in my camera roll, and I have saved them to my computer.  Is there an easy way to delete some or all of them to clear out space on my iPhone?

    I have over 1000 photos in my camera roll, and I have saved them to my computer.  Is there an easy way to delete some or all of them to clear out space on my iPhone?

    The quick way is when you imprort them to an app on your computer, usually there is the option to delete everything on the phone that was imported.  If you declined that option, then you have to do it one by one or manualy select in edit mode.

  • HT204406 after this new itunes and ios7 update all my music is off my ipod touch unless i download them one artist at a time, i have over 3500 songs in there.  really?  is there no easier way to get my music back into my ipod?  like a download all button?

         after this new itunes and ios7 update all my music is off my ipod touch unless i download them one artist at a time, i have over 3500 songs in there.  really?  is there no easier way to get my music back into my ipod?  like a download all button?  thanks.

    thanks for the reply.  guess i'll have to do that.  apple, not really happy with what you've done with this latest update.  have not been able to enjoy my music in my car since the update.  most of us dont mind changes that progress timely, but this was much more than just a progression.  this was a complete change.  and not a good one, at all.  thanks to the two people that replied.  appreciate it.

Maybe you are looking for

  • Transferring book to ereader

    After I download my books from the library and they appear in adobe digital editions library I cannot transfer them to my ereader.After I have dragged my book over to my ereader a message comes up that I have no access.

  • Is There A Way To Make The "Check Out CNN On Twitter" Pop-Up Stop?

    I had an old DVR that I had to get rid of and before that I got this annoying pop-up to stop appearing but it's been weeks with my new DVR and no matter what I do it keeps popping up on the screen. Sure, you just hit 'exit' on the remote and it goes

  • PDF option in the BEX Broadcaster

    hello all, We have a problem, have a BW 3.5 and want to know if in Bex Broadcaster when we want to send mail not able to see PDF option.Because i want to send mail in PDF formate. Thanks in advance. Oscar

  • Two .me  accounts, 2 iphones - one mac mini?

    So here is my problem...the wife and I have 2 iphones, both have two .me accounts which we use to buy our own music, vids, etc. This all works through itunes as I have it authorized to play all. However when I conect hers to the mac mini, and discone

  • Download error for jdk 1.4

    when the download reach 32.2 mb the downloading was discontinued because of downloading error from download site. I tried it the 2nd time same problem. edramos1