Why does insertion location into GridLayout differ based on inputs?

Hello,
I wrote a loop that inserts a run-time determined number of checkboxes into a GridLayout.
For instance, if the user wants 5 checkboxes (decided at run-time), then the program creates 5 new checkboxes and inserts them into a (5 rows, 1 col) grid.
The checkboxes appear correctly as 5 rows and 1 column.
However, if the user wants a lot of checkboxes, (ex: user wants 10 checkboxes), then the program inserts the checkboxes in the wrong order.
Instead of
1
2
3
4
5
6
7
8
9
10
It inserts like this:
1 2
3 4
5 6
7 8
9 10
Notice how the checkboxes appear in a (5 row x 2 column) grid.
I dont know why the exact same lines of code [code that generates a (user defined number of rows x 1 column)] create two different layouts based on the size of the input.
I ONLY want to have ONE column, no matter how many lines of input. I put a JScrollPane on the panel that has the GridLayout because the i know that a lot of checkboxes wont be able to fit entirely on that one little section that has the GridLayout panel.
Can anyone explain why the output differs based on the input?

The following quote from the API documentation for GridLayout may help you understand what's happening:
"When both the number of rows and the number of columns have been set to non-zero values, either by a constructor or by the setRows and setColumns methods, the number of columns specified is ignored. Instead, the number of columns is determined from the specified number or rows and the total number of components in the layout. So, for example, if three rows and two columns have been specified and nine components are added to the layout, then they will be displayed as three rows of three columns. Specifying the number of columns affects the layout only when the number of rows is set to zero."

Similar Messages

  • On ipod touch why does imessage go into my email?

    on ipot touch why does imessage go into my email instead of imessage?

    - Try inserting and removing the headphone plug a dozen or so times.
    - Next try a reset. Nothing is lost
    Reset iPod touch: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup
    - Restore to factory defaults/new iPod
    If you still have the problem that indicates a hardware problem, like a bad headphone jack.

  • Inserting paragraphs into a report based on a certain condition

    Hi, I need some advice on the best method to insert paragraphs of text into a report.
    I have +/- 100 paragraphs which are in text format, I need to insert these into the report based on certain conditions.
    I have tried entering them into the trailer section one after the other and using conditional formatting to display them if the the condition is met. This works well but I ran out of space in the trailer section.
    I then thought of saving the paragraphs somewhere on the server as seperate txt files and inserting them into the report using file links,
    or I could put these paragraphs into a table and then insert them from there, some of these paragraphs are longer than 4000 characters,
    Please advise on the best method
    Thank you
    Michael

    Hi,
    If the button and the textfield are on in the same subform then this code should work in the click event of the button
    (This is JavaScript code so make sure the code is set to JavaScript and Client on the drop downs in the script window)
    (assuming the name of the textfield is TextField1)
    TextField1.rawValue = "some value";
    If they are in different subforms then you have 2 options
    Please note in both these options it is easier if the subforms have names ( I am assuming this to keep samples simple)
    option 1 -
    use the parent object to move up the tree till you are at the same level as that of the subform that contains the textfield
    e.g. 
    (Click Event of the button)
    this.parent.subformname.TextField1.rawValue = "some value";
    option 2 -
    Use the resolve node to make your way down from the top level of the form
    xfa.resolveNode ("form1.subformname.TextField1").rawValue = "some value";
    Hope this helps
    Malcolm
    p.s. I am making assumptions as the image/file you attached did not appear for me.

  • Why does messages go into Recovery Callback Queue - urgent

    Env : BPEL 10.1.3.4 , Web logic 9.2
    Scenario:
    We have a process(Lets say A) putting messages from into a MQ(lets say Q1).
    Another Application processes the messages from Q1 and puts some messages into another Queue (Q2).
    We have another process B (Lets say B) which reads from this Q2 and calls the Process A’s callback operation(using right correlation parameters) thus releasing “receive” acitivty of Process A and hence flow goes further.
    Problem :
    While the above scenario is working as expected for some cases(approx. 60%) we observed the following :
    i)     A’s receive activity is still waiting to receive a callback from B.
    ii)     All the instances where A is waiting for receive has gone to “Recovery Callback” and sits there. When we manually recover them , Process A’s receive gets executed and works as expected.
    iii)     In some cases where the flow went successfully ( ie., receive receives the callback) , receive activity received the callback long time after the message is places in Q2. ( in some cases it is 9 to 10 hrs).
    Questions:
    i)     Why does instances go into “recover callback” ? What can we do to avoid this ? ( Kindly dont suggest ways to recover, I am looking for a preventive measure)
    ii)     Process A's recieve activity sometimes receive the callback after some 9 hrs and the flow passes on. I am wondering how can this happen as "synchMaxTime" is set to 900 secs in our case ( 15 mins). I thought any instance waiting for more than 15 mins for callback should have got timedout. Is this setting only for synch calls ?
    Few other things
    1. The Process B listening to Q2 is having a delay between messages as 3.66 secs . This is to throttle messages coming so quick to bpel as it may not have sufficent threads to process all of them at a time.
    2. synchMaxTime in the Domains = 900 s
    3. JTA Timeout in weblogic server is 3000 seconds.
    This is very urgent , Kindly help with any input / suggestion you have ASAP. Thanks.
    Regards,
    Sridhar.
    Edited by: Sridhar-SOA on Jul 27, 2011 2:38 AM

    Any Updates ?

  • When I try to send a photo, why does it go into my outbox?

    When I try to send a photo, why does it go into my outbox?

    assuming you mean send a photo by email.
    a photo can be quite large and contain a lot of data. depending on your connection it can sometimes take a while to send. As long as a red exclamation doesn't appear it will send. the outbox indicates mail going out, hence outbox.

  • Why does Safari go into limbo when I try to search for some things?

         Why does Safari go into limbo when I try to search for some things? I start to enter something in the search window. I get a drop down with suggestion I choose one and it pops up in my search window but just turns a color and does nothing!
        If I quit Safari and bring it back up, then enter the exact same line it's fine. This is just one of the many problems I've been
    having with Safari since I installed Yosemite.
         Has anyone got any suggestions or is anyone having the same problem. Is there a way to maybe force my MacBook pro to reinstall Safari or possibly all of Yosemite. I seem to be having a lot of problems and judging by the responses I've received (That would be None) I must be the only one having any problem at all withYosemite. Not sure what to do.
         Any help or suggestions would be great
         Ron     

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled in OS X 10.9 or earlier, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Why does javadoc goes into an infinite loop

    at my dos prompt , in the same directory as my Page.java file, i type javadoc Page.java
    why does it go into an infinite loop? instead of producing any documentation
    it just says for example
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    javadoc Page.java
    Stephen

    this is a sample page -- i'm using jdk 1.4 trying to run javadoc Tracer.class or javadoc Tracer.java or javadoc Tracer gives throws the console into an infinite loop with the statement being printed over and over again. But i haven't just noticed this problem with javadoc -- i noticed this problem with certain types of mistakes in the code rather than just displaying the compiler error -- it creates this infinite loop in the dos console window. any thoughts ?
    here is my version.
    java version "1.4.0"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
    Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
    * Tracer.class logs items according to the following criteria:
    * 2 = goes to text file Crawler_log.txt
    * 1 = goes to console window because it is higher priority.
    * @author Stephen
    * @version 1.0
    * @since June 2002
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.text.*;
    class Tracer{
         public static void log(int traceLevel, String message, Object value)
              pout.write(getLogFileDate(new Date()) +" >" + message + " value = " + value.toString());
         public static void log(int traceLevel, String message )
              pout.write("HI HOW ARE YOU " ) ;
              pout.flush();
         //public static accessor method
         public static Tracer getTracerInstance()
              return tracerInstance;
         private static String getLogFileDate(Date d )
              String s = df.format(d);
              String s1= s.replace(',','-');
              String s2= s1.replace(' ','-');
              String s3= s2.replace(':','.');
              System.out.println("getLogFileDate() = " + s3 ) ;
              return s3;
         //private instance
         private Tracer(){
              System.out.println("Tracer constructor works");
              df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
              date                    = new java.util.Date();
              try{
              pout = new PrintWriter(new BufferedWriter(new FileWriter("Crawler_log"+getLogFileDate(new Date())+".txt", true)));
              pout.write("**************** New Log File Created "+ getLogFileDate(new Date()) +"****************");
              pout.flush();
              }catch (IOException e){
              System.out.println("**********THERE WAS A CRITICAL ERROR GETTING TRACER SINGLETON INITIALIZED. APPLICATION WILL STOP EXECUTION. ******* ");
         public static void main(String[] argz){
         System.out.println("main method starts ");
         Tracer tt = Tracer.getTracerInstance();
         System.out.println("main method successfully gets Tracer instance tt. "+ tt.toString());
         //the next method is where it fails - on pout.write() of log method. Why ?
         tt.log(1, "HIGH PRIORITY");
         System.out.println("main method ends ");
         //private static reference
         private static Tracer tracerInstance = new Tracer();
         private static Date date     = null;
         private static PrintWriter pout = null;
         public static DateFormat df = null;
    }

  • Insert value into a column based on value of another column

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance.

    Hi,
    I am trying to insert a value into a record based on a column in
    the record, using a trigger. The complication arises because
    the new value is selected from the same table. For example:
    SELECT COL1, COL2, COL3, COL4 from TABLE1
    I want to set COL2 and COL3 based on the value of COL4. And to
    get the value of COL2 and COL3, I will go back to TABLE1 and set
    the condition to TABLE1.COL1 = :NEW.COL4
    I cannot seem to execute the trigger as I get the message "ORA-
    04091: table SYSTEM.TABLE1 is mutating, trigger/function may not
    see it" everytime.
    Is this the correct way to achieve what I wanted? Or is there
    another way?
    Appreciate your feedback. Thank you in advance. I'm not sure what you mean when you insert a value into a
    record, but if you are setting a value in a column of the same
    record using a trigger, then it's easy.
    :new.COL2 := ....:new.COL4...
    :new.COL3 := ....:new.COL4...
    The trigger must be 'INSERT or UPDATE' and 'FOR EACH RECORD'.
    If you are setting a different record in the same table, the
    solution is much more difficult.

  • HT1975 Why does the location on my iphone show three different places when I'm not even there?

    When I use the iphone app find myiphone- why does it sometimes show 3 different addresses and streets when locating the phone.

    Because GPS is not perfect, especially when the device is inside a building.

  • Why does Bridge CS6 destroy my SWF files after inputting Meta Data?

    I save a swf file to my hard drive.  Then I open Bridge, select the swf file, and type some Meta Data into the panel on the right.  As soon as the data saves and the preview window refreshes, the preview renders completely white (Bridge can no longer preview it).  If I open the file in Flash, some layers and text are now missing.
    It seems that the act of writing meta-data to the swf file actually destroys portions of the file, and I have to go back to the original and re-export.
    We have reproduced this problem on both Mac & PC, on swf files of varying compression & XMP settings.  It is fairly consistent.
    Has anyone run into this and if so does anyone have any suggestions?

    Not a expert on swf files, but this article says you can not use Bridge to add metadata to SWF files.  So maybe that is why you are running into problems.  http://forums.creativecow.net/thread/190/862442

  • WHY DOES IMPORTING CDS INTO THE LIBRARY SEPARATES ARTIST TO ANOTHER FILE INSTEAD OF IMPORTING THE CD TO THE SAME LOCATION ,AND WHEN IMPORTING ANTHOLOGY CDS THE LUMP SEVERAL CDS TOGETHER AS ONE CD OR PLACE MULTILPLE CDS IN THE LIBRARY

    when importing cds to the ipod library song with guest artist are not placed in the same flie they are spread all over the library ,so when playing the file they are not all together missing tracks,also importing anthology cds many artist from different cds are lumped together or multiple duplicate cds are in the library i hate this!!!! help!!!

    Somebody PLEASE help me.... I keep getting the "itunes has stopped working" error when I import cd's and that it's checking windows for help. That's it! It doesn't tell me how to fix it. Apple stores or the phone support has been ZERO help. I just need to reinstall all these cds that were lost when I plugged in my new ipod to my new computer!!!

  • Why does 'insert image' not work?

    If I use Insert Image, the image appears on the email, but is not sent to the recipient. Why?
    Whats the point of it if it appears to work but doesn't?

    <blockquote>The fact that WYSIWYG does not work sometimes is no reason to regard it as not sensible to try and achieve. </blockquote>
    Never is more the point. It never works on the internet, every browser and mail client renders fonts and forms and images differently. That is why most web sites use the browser string to choose which version of the site to offer up.
    Change printers in a word processor and see WYSIWG change. Field questions from users who have suddenly manager to get their document on a 30 degree slant because their document formatting resembles a typewriter.
    <blockquote>If what you see on the screen is completely different from what you send, how are you supposed to make quality judgements? </blockquote>
    People writing computer programs and HTML have been doing it ever since there have been computers. Imagination and knowledge of the rendering capabilities to the expected client give some level of confidence. and KISS applies. The less complex the less likely it is to go spectacularly wrong
    <blockquote>Having a link to a persons computer from another computer is an invitation to hackers. </blockquote>
    That is what every address on the internet is, a link from one computer to another. Usually, your computer to someone elses. It is also why windows supports UNC names for files.
    <blockquote>Why would you do that?</blockquote
    Perhaps so content can be created once and use repeatedly without having to copy the data and perhaps corrupt it in the process. It also allows for content to be changed after the fact, so you can do a countdown due in X days
    <blockquote>
    Also,it still doesn't work. I tried sending myself an email, </blockquote>
    Did you get the email, many providers just don't deliver mail to yourself anymore.
    <blockquote>
    and it should have referenced the file on my computer, but it didn't.
    </blockquote>
    What did the HTML img tag actually contain?
    <blockquote>
    The concept of sending half a document, and referencing the rest of the document from a computer somewhere on the Internet (which might be off), absolutely stupid from many points of view.</blockquote>
    Depends, remote images in email are a perfect example of it. Many of today's emails would not be sent due to their size if the images were not remote, and how to marketers get to know who you are unless there are remote images so they can track you.
    In a corporate environment there are places where you would be sacked for actually attaching documents to an email. A link to them on the server maintains the companies control of their intellectual property. Placing it in an email obviates all of that.
    So get used to the fact that email is not WYSIWYG. It does not even use the same fonts you do, unless by happen-chance the recipient also has the same ones.
    What does the message source say about the IMG tag for the image.
    <preformat>
    ><img alt="" src="file:///C:/Users/Matt/Desktop/CSV%20how%20to/more%20images/blinkers.png" height="315" width="392">
    </preformat>
    It will look something like this for a local link with moz-do-not-send="true" set if I specify not to include the image with the message.
    <blockquote>If Thunderbird has some inherent problem with incorporating image files into a document, then it should not allow it as an option. </blockquote>
    I am afraid is simply do not understand that statement at all. You are the only person I have ever encountered that could not include an image in their email.
    <blockquote>One thing that most Windows software now allows is transferring files between formats, </blockquote>
    How come I can not get mail out of outlook in a usable format? Are BMP, JPEG and PNG images interchangeable?
    I previously asked <blockquote>So what format is this image? (What file type) How large is it? What anti virus program do you use?</blockquote>

  • Why does Frequent Locations log places I've never been to?

    I've gone in to check the history of the Frequent Locations and I noticed it has logged places that I have never been to or on days I know I have never been there. Why or how does it store these locations when I know for a fact I was just sitting on my couch at home at the date and time it shows me on the other side of town?

    1= What a shame that this normally helpful and positively spirited amenity (Apple Discussions) is so very often spoiled by the abject negative and supersilious bile from some individuals?
    2 - Instead of going out of your way to prove that Mac owners and users are unapproachable smart ars*s, why not go out of your way to actually help people out who have a genuine query?
    3 - If you take the trouble to read my post, you will easily find that the content is written in good grammar, in proper English, and is as calm as a Californian Mayor. Unfortunately, a state of mind not evident in your own ranting post, sir.
    4 - When the day comes that more experienced and polite posters on here need to take advice from the less composed and less well-mannered ones like you, it will truly be time to close the curtains on this show we know as Apple Discussions.
    For your extra information, and I assume this will be filtered by your own bias, there IS, whether you like it or not - a lot of discomfort around many of the changes that have been made to iPhoto 11. I'll not trouble you with a list of them which are plastered all over Apple Discussions and elsewhere, but they are there and need to be addressed. Suffice to say, those negative changes have rendered the program to have a feel of "not really well thought through". A little bit like the first response to my original post.
    Now, if anyone has a constructive answer to my original post, I'd be delighted to hear it.
    Message was edited by: ChrisRR

  • Why does "Insert MathType Equation" not work in new Pages for Mac?

    Command opens MathType (6.7e).  After typing an equation, pressing Command-W closes the MathType window and returns to Pages.  (Instructions given here: http://help.apple.com/pages/mac/5.0/#/tan0e6bf8310  indicate that I should have to answer "Yes" to some question at this point, but no question appears.  The return to Pages is automatic.)  But no equation appears in the placeholder in the Pages 5.0 document (as it does in Pages 4.3).  Subsequently double-clicking the placeholder in the Pages 5.0 document opens a new (blank) MathType window.  Where is my equation?

    Right -- you shouldn't have to start MathType separately. If it's running, fine, but if it's not, it will start when you first use the Insert MathType Equation command.
    All the posts and replies have been helpful, but I'm still getting mixed results. The first document I opened in Pages 5.0 was one that I created in Pages 4.3, and it had several MathType equations in it. I could not edit the old equations, but I could insert new ones and edit them once they were inserted. I later rebooted and opened the same document (which was now saved in Pages 5.0 format), and I got a message saying some of the images had been deleted. All of the original equations had been replaced with empty placeholders (gray boxes with a large X), but the new ones were still there.
    I haven't been able to duplicate that behavior with additional "old" documents. I can open Pages 4.3 documents in Pages 5.0, and all the old equations are visible and editable. Someone mentioned re-installing MathType, and I must say that I did that (for a different reason), so I must consider the possibility that this had some bearing on the outcome, but I can't be sure.
    It does appear, as has been reported many times, and as Peter alluded to above, that you can't add equations or other objects to text boxes or tables. I believe this was intentional on Apple's part, but that doesn't mean it was a good idea.
    That said, and this is a Pages thread so I won't say much about it, I haven't seen any problems at all with Keynote 6.0 and Numbers 3.0, when it comes to how they deal with MathType.

  • DB Adapters inserting data into 2 diff tables of same database giving issue

    Hello,
    I am using Oracle soa suite 11g BPEL.
    I need to insert data in 4 different tables of same Oracle database with the requirement of rollback all data if error occurs anywhere.
    I have configured the DB adapater as XA enabled on console .
    In code:-
    I am using 2 DBAdapters to insert data one by one in 2 diff tables of same DB (using INSERT ONLY operations). Before each invoke activity i am using a transformation activity to prepare the input variable of the DBAdapter.
    When i run this code i get below error:-
    Exception occured when binding was invoked. Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'insert' failed due to: DBWriteInteractionSpec Execute Failed Exception. insert failed. Descriptor name: [DBINS_DIANA.XxontPoiHdrsIface]. Caused by java.sql.BatchUpdateException: ORA-02049: timeout: distributed transaction waiting for lock . ". The invoked JCA adapter raised a resource exception. Please examine the above error message carefully to determine a resolution. </summary>
    If i use a wait activity between the 2 invokes i get the data inserted fine , but that means the transactions between inserts would be committed which i want to be rollback fully in case of any errors.
    Can anyone have a clue what is wrong here?
    Thanks
    Shivani

    Hi Anagha,
    Have a look at these links:
    /people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/d5653fd1d3b81ae10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/frameset.htm
    Regards,
    Chandra

Maybe you are looking for