My layout wont listen to size I set and creates huge spaces between element

I am having a small issue:
Here is an image with the issue:
http://i877.photobucket.com/albums/ab335/darksniperx2/asg2_prob.jpg
Is there anyway to remove all of the extra spaces and that the program would follow with the size I specify?
code:
   public void initialiseComponents(final Container pane){
        //initialise panels
         mainPanel.setLayout(new GridLayout(2,1));
         topSection.setLayout(new GridLayout(1,3));
         mainGrid.setLayout(new GridLayout(21, 6));
        //initialise components text
         nameLbl.setText("Enter you name:");
         timeSchLbl.setText("Time scheduler");
         chkBoxNotificationLbl.setText("Check on the check boxes");
         timeLabel.setText("Time");
         modayLabel.setText("Monday");
         tuesdayLabel.setText("Tuesday");
         wednesdayLabel.setText("Wednesday");
         thursdayLabel.setText("Thursday");
         fridayLabel.setText("Friday");
        //add compenents to topSecion
         topSection.add(nameLbl);
         topSection.add(timeSchLbl);
         topSection.add(chkBoxNotificationLbl);
         //add components to mainGrid
         mainGrid.add(timeLabel);
         mainGrid.add(modayLabel);
         mainGrid.add(tuesdayLabel);
         mainGrid.add(wednesdayLabel);
         mainGrid.add(thursdayLabel);
         mainGrid.add(fridayLabel);
         setCheckboxes();
         //add layouts
         mainPanel.add(topSection);
         mainPanel.add(mainGrid);
         pane.add(mainPanel);
    private static void createAndShowGUI() {
        //Create and set up the window.
        asg2 frame = new asg2();
        frame.setSize(1000,900);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //Set up the content pane.
        frame.initialiseComponents(frame.getContentPane());
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    public static void main(String[] args) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            public void run() {
                createAndShowGUI();
    }

Hold it right there, I did not say that GridLayout was no good. It is perfect for your other two panels, but not for mainPanel.
... which one do you think would be better or serve this situation?First, check out the link Mr Burke gave you from the previous post -- you're going to need to know all those Layouts presented that tutorial anyway. I try to use the default Layout on a Container if possible. I personally like the GridBagLayout, but it is much more difficult to use and understand than the other Layouts in the tutorial.
OP, don't think that any of these solutions come easy or fast -- there is a lot of studying and practicing to do. Try all the Layouts and see what happens, until you have no doubts about which one to use for your app.

Similar Messages

  • What is the difference between "create set" and "create dynamic set"?

    What is the difference between  "create set" and "create dynamic set"?
    we have a complete cube ready for production that was tested and working without any issues in non-r2. we found that some "create set" assignments don't work in R2. But when changed to from  "create set" to "create dynamic set"?
    they are working, However, not sure how it will impact other areas of the cube.

    Thanks YuliaKlimov, I can reproduce this issue, but I cannot explain the different behaviors between SSAS 2008 and 2008R2. As a workaround,
    could you try to use dynamic set or create statics set but with fixed member for example:
    CREATE 
    SET CURRENTCUBE.[Prior Month] AS
    [Date].[Date Key].&[20050723].PrevMember
    , DISPLAY_FOLDER = 'Relative Period Sets';
    Personally, I think your set is dynamic set, because the currentmember is changed base on current selection. You can also submit this issue
    on below official link to get confirmation from Product Group:
     https://connect.microsoft.com/SQLServer/
    Thanks,
    Raymond
    Raymond Li - MSFT

  • Consistent vertical space between elements in page layout--Pages 09

    Hello,
    Is there a way to maintain a consistent amount of vertical distance between elements in the Pages 09 layout view?
    Thanks,
    ~A

    Select a series of objects:
    +Menu > Arrange > Distribute Objects+
    Or use:
    +Inspector > Objects > Metrics (6th tab)+ to position them accurately.
    When you move objects Pages offers you various alignment guides to position them relative to other objects edges' or centres.
    Peter

  • Setting space between regions

    Hi there, i am having trouble controlling the spacing between regions and wondered if anyone had come across this problem. Across the width of the screen i have 5 regions the widths are as follows:
    %, 350, 190, 220, %
    The regions set as % at the edges of the screen are used to pad out the rest of the screen and centre the content in the middle of the screen. The region of 190 is set to contain a portlet whereas the others are all set to hold items. The problems seem to be in the spacing between the content regions. The three content holding regions are supposed to add to 760 pixels in total, but there always seems to be big gaps between them especially the region of 350 pixels which holds an image and the 190 pixel region which holds an HTML portlet.
    Is there any way to control the spacing between regions (ideally set it to 0). I have already checked all the region properties and both the space between items and around items is set to 0.
    Any ideas as i am really struggling.
    Thanks in advance.

    Hi Paul
    I think your problem comes from your mix of % and pixel wide regions. HTML does not like tables with rows defined like this, either use only %, or either fixes sizes.
    There are possible workarounds :
    - to center your "main" regions, try to set 99% width in the 2 edge regions
    - try 49% - 1% - 1% - 1% - 49%, and put invisbile images of the wanted width in the main regions (transparents gifs, 350px width, 1 high). Images won't be shrunk.

  • How to change font size in smartform and set layout of smartform

    Dear abapers,
                           I want to change font size in smartform and also set the layout of smart form how can we do this.
                                                 Thank you sir.

    Hi,
    you can do it first you need to goto smartforms tcode there click on radiobutton 'Style'.
    Give any name and click on create. Right sideyou can find character format right click on it and create a node .A pop will raise gve a 2 characterlike z1 or a1 etc click on font tab gve size and font style and click on save and activate. Use this style in your smartform you can apply what ever styles created in styles you can use it in your smartform by that smartstyle name.
    When we create text in output options give your smart style name and click on general attributes . Select your text and apply the style what thse size it should be and what the font style it should be.
    Goto smartforms tcode and select formpainter in application bar set layout according to your requirement.
    Thanks,
    venkat

  • Listener.log size limit on Linux 64-bit

    Hi!
    We have listener.log file growing very fast because of very active database. Every month or two I truncate that file to free up disk space but this time I forgot to truncate it for some time.
    File grew to 4294967352 bytes and stopped there on that size. Everything is working as it should with listener service - only listener.log file isn't updating.
    I've tried to search for more informations about listener.log size limit but haven't found answer that satisfies me.
    Where can I find more information why my listner.log file is limited to 4294967352 bytes?
    I suppose that this is some OS limit but how can I check this?
    It is Linux 64-bit OS with Oracle 10.2.0.4.
    Thanks for possible answers and best regards,
    Marko Sutic

    Ah, yes... thanks Sybrand for reminder, my brain just stopped working :)
    Just resolved my problem:
    LSNRCTL> set current_listener LISTENER_DB
    Current Listener is LISTENER_DB
    LSNRCTL> set log_file listener_db1
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.2.10.40)(PORT=1521)))
    LISTENER_DB parameter "log_file" set to listener_db1.log
    The command completed successfully
    LSNRCTL> set log_file listener_db
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.2.10.40)(PORT=1521)))
    LISTENER_DB parameter "log_file" set to listener_db.log
    The command completed successfully
    LSNRCTL>
    Regards,
    Marko

  • Set Maximum size for a subpanel created with splitter bars in LV8

    Does anyone know how to set the Maximum size for a subpanel created with asplitter bar? If I show one cluster in the subpanel and use the scroll bar to scroll, I can see more (blank) area than I want. I just want the user to be able to scroll a cluster within a subpanel while the cluster is larger than the view area of the subpanel. I don't want to let the user scroll outside the cluster.
    Ravi Beniwal

    I apologize for the mixup in terminology. Please read Pane wherever the word Subpanel was used.
    Please see the attached VI for a description of my problem.
    I would really appreciate any help with this.
    Ravi Beniwal
    Attachments:
    Pane Scrolling Problem.vi ‏10 KB

  • Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).

    Hi,
    Our Environment is Essbase 11.1.2.2 and working on Essbase EAS and Shared Services components.One of our user tried to run the Cal Script of one Application and faced this error.
    Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).
    I have done some Google and found that we need to add something in Essbase.cfg file like below.
    1012704 Dynamic Calc processor cannot lock more than number ESM blocks during the calculation, please increase CalcLockBlock setting and then retry (a small data cache setting could also cause this problem, please check the data cache size setting).
    Possible Problems
    Analytic Services could not lock enough blocks to perform the calculation.
    Possible Solutions
    Increase the number of blocks that Analytic Services can allocate for a calculation:
    Set the maximum number of blocks that Analytic Services can allocate to at least 500. 
    If you do not have an $ARBORPATH/bin/essbase.cfg file on the server computer, create one using a text editor.
    In the essbase.cfg file on the server computer, set CALCLOCKBLOCKHIGH to 500.
    Stop and restart Analytic Server.
    Add the SET LOCKBLOCK HIGH command to the beginning of the calculation script.
    Set the data cache large enough to hold all the blocks specified in the CALCLOCKBLOCKHIGH setting. 
    Determine the block size.
    Set the data catche size.
    Actually in our Server Config file(essbase.cfg) we dont have below data  added.
    CalcLockBlockHigh 2000
    CalcLockBlockDefault 200
    CalcLockBlocklow 50
    So my doubt is if we edit the Essbase.cfg file and add the above settings and restart the services will it work?  and if so why should we change the Server config file if the problem is with one application Cal Script. Please guide me how to proceed.
    Regards,
    Naveen

    Your calculation needs to hold more blocks in memory than your current set up allows.
    From the docs (quoting so I don't have to write it, not to be a smarta***:
    CALCLOCKBLOCK specifies the number of blocks that can be fixed at each level of the SET LOCKBLOCK HIGH | DEFAULT | LOW calculation script command.
    When a block is calculated, Essbase fixes (gets addressability to) the block along with the blocks containing its children. Essbase calculates the block and then releases it along with the blocks containing its children. By default, Essbase allows up to 100 blocks to be fixed concurrently when calculating a block. This is sufficient for most database calculations. However, you may want to set a number higher than 100 if you are consolidating very large numbers of children in a formula calculation. This ensures that Essbase can fix all the required blocks when calculating a data block and that performance will not be impaired.
    Example
    If the essbase.cfg file contains the following settings:
    CALCLOCKBLOCKHIGH 500  CALCLOCKBLOCKDEFAULT 200  CALCLOCKBLOCKLOW 50 
    then you can use the following SET LOCKBLOCK setting commands in a calculation script:
    SET LOCKBLOCK HIGH; 
    means that Essbase can fix up to 500 data blocks when calculating one block.
    Support doc is saying to change your config file so those settings can be made available for any calc script to use.
    On a side note, if this was working previously and now isn't then it is worth investigating if this is simply due to standard growth or a recent change that has made an unexpected significant impact.

  • How can I set up my iTunes so I can listen to it at work and at home - same library.

    How can I set up my iTunes so I can listen to it at work and at home - same library.

    Put a copy of the whole library on a flash drive.
    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you use iTunes' default preferences settings:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Open iTunes and immediately hold down the Option (alt) key (shift on Windows), then guide it to the new location of the library.
    I don't know if there is a Windows equivalent of the below:
    Slink ($25) - http://itunes.apple.com/us/app/slink/id402358338?mt=12 - "Slink is the easy way to remotely access your home network. Listen to your iTunes music and watch your movies from anywhere, get the files from your home Mac or Time Capsule that you forgot to bring with you on the road, or help your parents or kids out using remote screen sharing. "

  • I hit the clear the clear setting and contact and now my phone is stuck on the apple and wont turn on

    i hit the clear setting and content on my phone and now my phone is stuck on the apple sign and wont turn on or off

    You will probably have to put it in recovery mode to restore it, as explained in this guide: http://support.apple.com/kb/ht1808.

  • I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    I listen to a lot of live performances (house sets that are from 1 hour to 3 hours long) when I start to listen to a set and then stop to do something else on the iPhone when I go back to start to listen to the track it has started from the beginning.

    It sounds like either your hard drive or the SATA cable that connects it to the motherboard are failing. This could be heat related in your case, which is why you see it after it runs awhile. You can take it to the Genius Bar for a free evaluation. If you decide to test it yourself, I usually suggest moving the hard drive to an external enclosure. If it works there for awhile, the cable is probably the issue.
    http://www.amazon.com/Sabrent-2-5-Inch-Aluminum-Enclosure-EC-TB4P/dp/B005EIGUD4/ ref=sr_1_3?ie=UTF8&qid=1397647657&sr=8-3&keywords=2.5+enclosure
    http://www.ifixit.com/Device/MacBook_Pro_13%22_Unibody_Mid_2009

  • Can a custom page size be set on a LaserJet 1100?

    Can a custom page size be set on a LaserJet 1100? Windows XP

    Hi,
    Based on this information, YES :
    Paper: A4, Letter, Legal, and custom paper sizes. Envelope: Executive, B5, C5, DL, Monarch, Com-10, and custom envelope sizes.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to do changes in Layouts setting and SAP scripts to meet requirment?

    hi SD gurus,
    Please explain me how create and work with Z output .
    where and how we do changes in Layouts setting and SAP scripts to meet the user requirments.
    pls forward func spec of Z output
    points will be rewarded
    thanx & regards

    you need ABAP skills to do this.
    basically you need:
    1) draw the layout on a piece of paper
    2) define the fields you need and find out the corresponding SAP fields
    3) check the document with the customer
    4) give this specification to the developer
    5) the developer will give you a program name and form name: place them in the message for the document.
    Roberto

  • I can't resize the text adding to photo in PhotoShop Eleements 10. The size is set at 6 points but looks huge on screen! (200 points ) Help!

    I can't resize the text adding to photo in Photoshop 10.   The size is set at 6 points but looks more like 200 points. Help!

    Good day!
    Please post Photoshop Elements related queries over at
    http://forums.adobe.com/community/photoshop_elements
    but remember to mention relevant information (like the image’s resolution for example) and maybe post some screenshots to illustrate the issue.
    Regards,
    Pfaffenbichler

  • Using Sets while creating a Plan Layout

    Hi All,
    Please let me know whether we can make use of sets while creating a planning layout using report painter.
    Thanks

    HI
    We can make use of sets while developing a planning layouts using report painter.
    Thanks
    Sandy
    Edited by: sandesh shetty on Feb 6, 2009 11:17 AM

Maybe you are looking for

  • Where are text annotation tools?

    I'm using Reader 10 to edit a PDF that is enabled for commenting. The Adobe Help shows that there are 10 tools under "Annotations," but my instance shows only 2 (sticky note and highlighter). I can't find a way to add or delete text. How do I find th

  • Using Row Selection in Analysis Web Item & Filter Command

    In the 7.0 WAD (Web Application Designer), I have two analysis items that both have different data providers, DP_1 & DP_2. The two data providers are views from the same query. In the properties of the first analysis item (DP_1), I'm using the Row Se

  • SaxParser problem

    Hi everyone, I am using the SaxParser to parse an xml data. My problem is how to pass a String object directly to the SaxParser? I have little knowledge about this parser but what I have learned so far is that, an xml file should be passed to the par

  • Drop Frame vs. Non Drop Frame Timecode in DVDSP3

    The manual is rather spare in its discussion of the issue of timecode, but it does say that the first video asset determines whether the timecode in DVDSP is drop frame or non drop frame. Question 1: Does this refer to the first video asset in the V1

  • Looking to see if any one has created a script to have shipping calculated as a % of Sales

    I have a client that i need to shipping caluate based on a % of sales amount.