How to make frame automatically size

Hi,
I'm developing a dialog using JFrame , but i'm setting the size of it.Is it possible to make it automatically size as and when i add compoments.
thanks
Raj

use pack().
Ashish

Similar Messages

  • How to make frames all the same size?

    Any script for how to make several pictures sitting in exactly same size frame?

    Does anybody understand what I mean?

  • How to make view automatically scroll when keyboard show up

    Hi all
    I'm like a totally noob for objective-c coding, let alone the iPhone programing. :P
    Anyway, I somehow manage to create a simple application that receive input via UITextField, do some simple math, then display the result in other UITextFields (which can act as a input vice versa).
    Problem is, when I use the UITextField at the buttom of the screen as an input, the keyboard will block that text field out of my view, so I could not see what I'm typing at all.
    That's the question. How to make my view scrollable, and make it simply scroll itself out of the way when the keyboard is shown? I already inherit my view from UIScrollView, but don't know what to do next. Can you guys help enlighten me, please?
    Thanx

    Of course, if you're dealing with textFields, you should change a few things try something like that in your .m file :
    - (void)textFieldDidBeginEditing:(UITextField *)theTextField
    if ([theTextField isEqual:yourTextField])
    // Restore the position of the main view if it was animated to make room for the keyboard.
    if (self.view.frame.origin.y >= 0)
    [self setViewMovedUp:YES];
    // Animate the entire view up or down, to prevent the keyboard from covering the author field.
    - (void)setViewMovedUp:(BOOL)movedUp
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3];
    // Make changes to the view's frame inside the animation block. They will be animated instead
    // of taking place immediately.
    CGRect rect = self.view.frame;
    if (movedUp)
    // If moving up, not only decrease the origin but increase the height so the view
    // covers the entire screen behind the keyboard.
    rect.origin.y -= kOFFSETFORKEYBOARD;
    rect.size.height += kOFFSETFORKEYBOARD;
    else
    // If moving down, not only increase the origin but decrease the height.
    rect.origin.y += kOFFSETFORKEYBOARD;
    rect.size.height -= kOFFSETFORKEYBOARD;
    self.view.frame = rect;
    [UIView commitAnimations];
    - (void)keyboardWillShow:(NSNotification *)notif
    // The keyboard will be shown. If the user is editing the author, adjust the display so that the
    // author field will not be covered by the keyboard.
    if ([yourTextField isFirstResponder] && self.view.frame.origin.y >= 0)
    [self setViewMovedUp:YES];
    else if (![yourTextField isFirstResponder] && self.view.frame.origin.y < 0)
    [self setViewMovedUp:NO];
    #pragma mark - UIViewController delegate methods
    - (void)viewWillAppear:(BOOL)animated
    // watch the keyboard so we can adjust the user interface if necessary.
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:)
    name:UIKeyboardWillShowNotification object:self.view.window];
    - (void)viewWillDisappear:(BOOL)animated
    [self setEditing:NO animated:YES];
    // unregister for keyboard notifications while not visible.
    [[NSNotificationCenter defaultCenter] removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    be sure to invoke the method when you dismiss the keyboard, so that the view "falls back" to its normal state:
    if (self.view.frame.origin.y < 0)
    [self setViewMovedUp:NO];
    Of course, declare the method
    (void)setViewMovedUp:(BOOL)movedUp;
    in the .h file
    and the #define you will use in you .m file :
    // the amount of vertical shift upwards keep the text field in view as the keyboard appears
    #define kOFFSETFORKEYBOARD 50.0
    // the duration of the animation for the view shift
    #define kVerticalOffsetAnimationDuration 0.30
    good luck !

  • How to make PDF file size smaller from an Illustrator file without changing the quality or size (length and width) of the file?

    Is there a way to make a 30x42 size (40 GB) Illustrator file as a PDF but make the file smaller in size (able to email to clients) with out compromising the quality of the file or the size of the file?

    If you are working in RGB you can embed a colour profile. Embed ICC Profiles is one of the Acrobat save options. It will increase files size dramatically.
    When you save your pdf you can choose the compression method for placed images. Default is ZIP which is really no compression at all for pixel images. Instead you should opt for JPG compression (of varying degree according to how sensitive the images are to compression).
    You should also examine the other Acrobat save options. To minimize file size you should not have any of the options checked (Preserve Illustrator Editing Capability, Embed page Thumbnails etc. etc.).
    40 gigabytes for a file like the one you show is ridiculous. Did you maybe embed the placed images? If so, don’t. Keep them linked unless you really need to embed them.

  • How to make Finder automatically go to the foremost open window?

    I hope I'm explaining this clearly.
    Suddenly, when I click on the Finder from the Dock, it does not go to the last open window. I have to go to the Windows menu and select it, or click and wait on the Finder icon in the dock for it to open. I usually have a lot of apps open so when I go to Finder it's to do some file management - and the extra step of having to bring the last open window to the forefront is annoying me!
    Does anyone know how to make the Finder automatically come to the forefront (with the windows) from click in the Dock? I swear my mac always did that before but now it's stopped!

    can anyone help me here?

  • How to make an auto size form of dynamic controls

    Hi Experts,
    i am creating a number of TextField controls and adding in the form component at run time.
    i set the width and height 100% but i need to have auto size form depending on the fields.
    please guide how can i set form size auto?

    As long as the form is inside a container that supports auto layout, lie VBox, and the VBox and Form have width and height set to 100% you should be okay.
    What is some simplified yet complete sample code and what problem are you actually experiencing?
    If this post answers your question or helps, please mark it as such.

  • How to make calendar automatically display special events

    hi, i wanted to make my calendar automatic display the events in a specific month. should i use ifelse statement or switch case statement? my web site have display calendar for the current month. it aotumatically update. now i wanted to highlight the special event on that month like New Year, Christmas etc. it automatically change the event according to the month. when it comes to May, it won't display April event but May event such as Labour Day. this is the example, what i wanted it to be is the event date changes according to the month.
    <html>
    <head>
    <title>Brunsfield e-Homes</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="home.css">
    <style type="text/css">
    .main {
    width:130px;
    border:0px solid #8D549B;
    border-collapse:collapse;
    .month {
    background-color:#8D549B;
    font:bold 11px arial;
    color:white;
    border-collapse:collapse;
    border:0px solid #8D549B;
    .daysofweek {
    background-color:#C78FB9;
    font:bold 9px arial;
    color:#000000;
    border-collapse:collapse;
    border:0px solid #8D549B;
    .days {
    font-size: 9px;
    font-family:arial;
    color:black;
    background-color: #FADBF2;
    padding: 1px;
    border-collapse:collapse;
    border:0px solid #8D549B;
    .days #today{
    font-weight: bold;
    color: #cc0000;
    border-collapse:collapse;
    border:0px solid #8D549B;
    </style>
    <script type="text/javascript" src="basiccalendar.js">
    * Basic Calendar-By Brian Gosselin at http://scriptasylum.com/bgaudiodr/
    * Script featured on Dynamic Drive (http://www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    </script>
    </head>
    <body bgcolor="#FFFFFF" leftmargin="5" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false">
    <!-- ImageReady Slices (home.psd) -->
    <div style="position:absolute; left:0; top:64">
    <table>
    <td width="140" align="center" valign="top">
         <font size="1">eCalender</font>     
         <script type="text/javascript">
         var todaydate=new Date()
         var curmonth=todaydate.getMonth()+1 //get current month (1-12)
         var curyear=todaydate.getFullYear() //get current year                         
         document.write(buildCal(curmonth ,curyear, "main", "month", "daysofweek", "days", 1));
    </script>
    </td>
    </table>
    <table width="130" align="center" border="0" bgcolor="#FDC2D6">
    <tr>
         <td class="events" width="20" align="center">1</td>
         <td class="events" align="left">April Fools Day</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center">4</td>
         <td class="events" align="left">Ching Ming Festival</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center" valign="top">8</td>
         <td class="events" align="left">Birthday of Sultan Johor</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center">9</td>
         <td class="events" align="left">Good Friday</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center">11</td>
         <td class="events" align="left">Easter Sunday</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center" valign="top">19</td>
         <td class="events" align="left">Birthday of Sultan Perak</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center">22</td>
         <td class="events" align="left">Earth Day</td>
         </tr>
         <tr>
         <td class="events" width="20" align="center">25</td>
         <td class="events" align="left">Secretary Day</td>
         </tr>
    </table>     
    </body>
    </html>

    http://www.dotjonline.com/main/index.jsp?url=/taglib/calendar/calendarFixed.jsp

  • I need to make an A2 poster and want to know what application to use as well as knowing how to make it that size

    I have been set the task in university of making an A2 poster that has to be printed, the main crux of the question is that I don't know wether i should use keynote or pages and how do I make the properties of the page A2?

    Keynote for video screen based presentations,  Pages for print, thats what they are designed for.
    In Pages:   File > Page Set Up: select custom sizes from the paper size drop down menu then Input the dimensions, click the plus button to add the size as a preset

  • How to make an automatic percentage with a catégory

    Hello,
    Thank you if you answer to my problem and also if you know the response !
    So, I have 3 cells :
    -A : with the category (lets make category game, food and books..)
    -B : the price
    -In C : I would like numbers to calculate automatically the cost with percentage (B x30%) if the category is "game", or B x 40% if the category is food, etc...
    Is it possible in one formula ? And also if I have about 10 categories...?
    Now, I know this formula wich is working only for one category, but I don't know how to add the variable about the category :
    sumif (A;book;B)*30%
    For example I would like in the same formula :
    sumif (A;book;B)*30% or (A;game;B)*40% .....
    With this formula, each time I will make a new entry in A with for example "book", and the price in B, the cell C will be automatically fill with the good percentage.
    I hope someone know the answer.
    Thank you very much.

    Hello
    I repeat that all what is needed is in the guide.
    =SI(ESTERREUR(RECHERCHEV(A;rates :: $A:$B;2;0));"";ARRONDI(B*RECHERCHEV(A;rates :: $A:$B;2;0);2))
    =IF(ISERROR(VLOOKUP(A,rates :: $A:$B,2,0)),"",ROUND(B*VLOOKUP(A,rates :: $A:$B,2,0),2))
    Here it returns an empty string if the category is unavailable.
    If you want a true zero, use:
    =SI(ESTERREUR(RECHERCHEV(A;rates :: $A:$B;2;0));0;ARRONDI(B*RECHERCHEV(A;rates :: $A:$B;2;0);2))
    =IF(ISERROR(VLOOKUP(A,rates :: $A:$B,2,0)),0,ROUND(B*VLOOKUP(A,rates :: $A:$B,2,0),2))
    Yvan KOENIG (from FRANCE samedi 1 août 2009 23:04:53)

  • OT?  How to make an "automatic" photo gallery site?

    This is a loosely defined question as I'm not sure of all the implications and parameters and have no sample to offer.
    My photog client - who doesn't know DW or html - wants a gallery site with a templated page layout so that he only has to upload some (properly named) jpgs into a folder and new pages with thumbnails are created automatically with links in place. I'm not knowledgible enough about html /dynamic html to make recommendations, but I got something similar done with, if I remember correctly, an ASP developer long ago. Can this be done with dreamweaver alone? Suggestions? Samples?

    Many photographers like JAlbum Web Photo Album maker.  It creates thumbnails, watermarks images, generates the code and scripts for Flash galleries, Lightbox galleries, GPS info, etc.. on the fly.  Drag and drop images into folders. Press a button and voila all done.  All he would need to do is upload his finished JAlbum Folder to remote server.  Simple enough if he can use an FTP client.  Or you could build a password protected upload page for him to use.
    http://jalbum.net/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • How to make fixed width size on grid layout managers.,

    hiya,
    my gird contains labels but whenever the labels has different width on their texts, the grid adopts to the width of the text, how not to?
    many thanks! :)

    Thats the way the GridLayout works, each cell is the same size. The size is determined by the largest component added to the grid.
    Here is the Swing tutorial on "Using Layout Managers".
    http://java.sun.com/docs/books/tutorial/uiswing/layout/using.html

  • How to make an unlimited size  StrinBuffer

    I need to create a very large StringBuffer to hold a very large reponse for a request that i send over a socket connection. The length of the response varies with the length of the request. I need to know if we can make the size of this buffer infinitely large enough to hold the data. The StringBuffer class constructors does not have any option to make the length of the buffer unlimited.
    Any Suggestion?

    A StringBuffer will grow as you use it, but its not a good storage choice for very large objects (eg more that a megabyte), unless you can guess an upper bound on the size, since appends will cause the copying of all the contents when the capacity is exceeded. You probably should organize this large result in a different manner. If the data has a logical structure such as lines or pages you could store each of these as an element in a list, or just store the blocks received from the socket. LinkedList does not require a copy to append another element and will be more efficient. When you have the whole object you can calculate the size of StringBuffer needed and copy the data into it, or you might be able to work with it directly in the List.

  • How to make the font sizes larger in the Firefox Bookmarks Library?

    The default font size of the entries in my bookmarks menu (displayed when I ask to Show All Bookmarks) is too small for me to read comfortably. How can I permanently increase the font size?
    I assume there is a userChrome.css entry to apply. What would it be?

    Add code to the <b>userChrome.css</b> file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    <pre><nowiki>@namespace url("https://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #places * { font-size:16px !important; }
    </nowiki></pre>
    The customization files userChrome.css (user interface) and userContent.css (websites) are located in the <b>chrome</b> folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration

  • How to make Safari automatically open .ram sound clips?

    When I click on, say a a sound clip to preview music, Safari just downloads the file but does not automatically play it, so I have to click on the file for it to be played by RealPlayer instead of this happening automatically after the download. The "open "safe" files after downloading" box is checked in preferences.
    Using Safari 2.03 and RealPlayer 10.0.0 with Tiger

    Safari probably has Open Safe Files disabled in preferences as a security caution. Open Safari's Preferences and click on the General icon. Check Open Safe Files if you want Safari to open files automatically. However, if you do this, make sure you have installed the most recent updates using Software Update because the last security update fixed a couple of exploits related to malicious files.

  • How to make Playback automatically reset transport to start at patch change?

    I am working with some stage tracks in MainStage. We currently use Digital Performer and are wanting to move over to Apple.
    I want to be able to know that whenever I open a patch in my set that it will always recall the transport position to start. I know that I can do this within the Playback plugin and change the "Play From" parameter to "Start". However, when we are rehearsing, I want to be able to always start from wherever we are in the song. For example, I want to still be able to start at Chorus 2 - I don't want it to always begin playing from the start.
    However, I want to reiterate my point: When I move from patch to patch, I want it always cued to the start of the track. Is this possible?
    One last thing, is there a way for me to choose a particular measure that I want the track to start playing back at for rehearsal purposes? For example, maybe I don't want to play the whole Chorus 2 which starts at measure 40, maybe I want to just start in the middle at measure 47? How do I control that?
    If you need any clarity on my question, please let me know?
    As of now, I am just not clearly seeing MainStage as a viable alternative to Digital Performer.
    Thanks,
    - John

    Greetings fellow DP user!!
    The good news is, you can do ALL of this.
    Not sure if you have experimented with "play from relative position"
    I highly recommend you try this out. As long as you are following a click of sorts, MS "transport" is still in play mode the PB will continue according to how many bars you are ahead in the song.
    Also, in any Wave/AIFF you load into the Playback, you can place MARKERS.
    You can set the PB to always start at a certain marker, and also, to skip ahead and back between those markers.
    To make markers, you can use Quicktime, Peak, Apple Loop Utility, Logic and most likely DP.
    Once those markers are embedded into the file, you can assign a MIDI command, or a keyboard command to skip ahead and back.
    Playback not playing back from the start:  Say what?!
    I have a sneaking suspicion that part of your issue might be that you are incorrectly using the "Set" and "Patch" in the MS heirchy.
    If you put a PB into a "Set" and select "Play from Start" it will do this.
    It is an easy mistake to make: every set needs a patch, so you accidentally go into the patch and make adjustments, not realizing that ALL adjustments must be made from a "SET".
    It's only a guess, but its the only reason I can think of as to why your songs/loops are not starting from the beginning.
    Keep me posted, and let me know how it works.
    I do this all the time, and never have this problem.
    TREATMENT

Maybe you are looking for

  • Do i have to activate each install through vlm

    This is what I did * I installed NI VLM 2.0 on our license server * i created several network installs (for LV 80, CVI 80) * Checked everything was working fine, and it was * I installed networkinstallversions of LV80 and CVI 80 on workstation A *It

  • Hello friends while doing file to jdbc senario I am getting error

    Hello All, while doing file to jdbc senario in sap xi getting error in the receiver communication channel..error is 2007-07-17 04:11:00 Error SAPEngine_Application_Thread[impl:3]_35 1184625660906 Attempt to establish database connection failed with S

  • Possible to send PO item info with PO cancellation?

    Hello! We are running "pseudo" standalone SRM 5.0. The "pseudo" is because we are using a legacy backend, emulating R/3. We need to send PO cancellation back to our legacy using XI/PI. The standard PROXY for this, "PurchaseOrderCancellationRequest_Ou

  • Enhancements in web dynpro

    What is the use of creating UI elements and context dynamically.when we have a option of enhancing the UI elements and nodes and attributes in context.

  • Storing in Aperture Library

    If I import a huge folder of photos into Aperture, and I just use the default "Store Files in Aperture Library", does Aperture copy the photos imported into the library, or does it move them? By using this defaulted selection, the "Move Files" and "C