Setting Column to Trim of Itself - Not Working

Hello,
I'm trying to update a column in a table using the following code:
UPDATE pweb.pweb_tos
   SET tos_code = TRIM(tos_code);For some reason it is not working. When I select the column using the TRIM function it does trim the white space, but the update is not working.
By the way - I did do a dump(tos_code) of the column and verified that it is in fact white space at the end.
Any help would be appreciated.....
Thanks!
Christine

Hi, Christine,
cad0227 wrote:
Hello,
I'm trying to update a column in a table using the following code:
UPDATE pweb.pweb_tos
SET tos_code = TRIM(tos_code);For some reason it is not working. When I select the column using the TRIM function it does trim the white space, but the update is not working.
By the way - I did do a dump(tos_code) of the column and verified that it is in fact white space at the end.
Any help would be appreciated.....
Thanks!
ChristineTRIM (tos_code) (with only 1 arguement) will only remove space characters, that is, ASCII code 32. If the string begins or ends with some
other kind of whitespace (e.g. linefeed), then that end will not be trimmed. You may have to specify multiple characters to TRIM.
Post the output you get from DUMP.

Similar Messages

  • After update Mac OS 10.9.1 Trim Enabler does not work anymore!

    After updating from Mac OS 10.9.0 to 10.9.1 the program Trim Enabler does not work anymore and my 4 SSDs from Samsung and Kingston are no longer supported.
    What can I do?
    Should I scrap my SSDs?
    Why does Apple do such things?
    Will Apple that I switch to Windows? There Trim works with all SSDs and BluRay will not boycott!

    Apple does not support TRIM for SSDs that were not factory
    installed and TRIM Enabler is a hack to get around this.  Any
    hack is always subject to being disabled, or worse, with any
    system update whether it is OSX or Windows.

  • Column concatenations in transformation file not working

    I am trying to upload data from flat file. I am trying to concatenate two columns of flat file - YEAR and MONTH in transformation file but for some reason it is not working. I have set it as TIME = YEAR + TIME, for instance I want value 201001 for YEAR 2010 and MONTH 01. But it is quite surprising that of I use simple concatenation excel formula in flat file and store value in new column in flat file (for instance NewTime) and then use this is transformation file as TIME = NewTIME it works file. Since I have many excel sheets, I am just wondering if I can get TIME = YEAR + TIME working.
    Any idea mates?

    Hi
    The concatenation is working fine but let's see what you would like to achieve.
    Into transformation file
    ColumnD = ColumnS1 + ColumnS2 it will work fine if
    ColumnD is a a dimension destination and ColumnS1, S2 are source column.
    In your case into source you still have destination fields.
    At least this is showing your example.
    I hope this it will help you.
    Regards
    Sorin Radulescu

  • Setting up home sharing on 4S not working

    I entered my username and password and the first time I did it, I entered the wrong password and now there does not seem to be a way to submit my username and password. I tried rebooting it, though there is not a submit button after typing in both fields. How do you activate home sharing afer typing in both your username and password?
    Thanks.

    I don't see why the songs would even show up if it was an issue with the devices being able to communicate.
    Have you tried playing any songs at all on the iPad - just play something - anything at all - on the iPad itself - not from the shared library.
    Or have you tired quitting the music app completely and then try again. Double tap the home button to get to the music app icon - tap and hold down until it wiggles - tap the minus sign .... I'm sure you know the drill.
    Does the school have something set up security wise that would prevent the songs from playing? Of course, that sort of goes back to the songs are seen so it does appear that the devices see each other.
    Does the Mac see the shared library on the iPad? I can't remember if it is supposed to work both ways. You can click on home sharing in iTunes on the Mac and see.

  • In SSRS , after exporting report in excel,wrap text property for cell and freeze column for SSRS table header not working in Excel

    I am working no one SSRS my table headers are freeze cangrow property is false and my report is working perfect while rendering data on RDL and i want same report after exporting in Excel also , i want my table header to be freeze and wrap text property
    to work after exporting in my report in excel but its not working ,is there any solution ? any patch ? any other XML code for different rendering ? 

    Hi Amol,
    According to your description, you find the wrap text property and fix column is not working after exporting into Excel. Right?
    In Reporting Services, when exporting to excel file, it has limitation for textbox.
    Text boxes are rendered within one Excel cell. Font size, font face, decoration, and font style are the only formatting that is supported on individual text within an Excel cell.
    Excel adds a default padding of approximately 3.75 points to the left and right sides of cells. If a text box’s padding settings are less than 3.75 points and is just barely wide enough to accommodate the text, the text may wrap in Excel.
    In this scenario, it supposed to be wrap text unless you merge cells. If cells are merged, word-wrap does not work correctly. If any merged cells exist on a row where a text box is rendered with the
    AutoSize property, autosize will not work. For the Fix Data Property, it can't be working in Excel. These are features when exporting to Excel. We can't change it because it's by design.
    Reference:
    Exporting to Microsoft Excel (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How to set my default application...not working

    My company has nearly all adobe applications installed from PageMaker 6.5 through InDesign 5.5. We use them all frequently. I'm trying to set my defaults on the Mac Pros and it is not working.
    Specs if Needed:
    OSX 10.6.8 
    Model Identifier:          MacPro5,1
      Processor Name:          Quad-Core Intel Xeon
      Processor Speed:          2.8 GHz
      Number Of Processors:          1
      Total Number Of Cores:          4
      Memory:          6 GB
      Boot ROM Version:          MP51.007F.B01
    +BootCamp dual boot Windows 7
    We proof out all files in the version that it comes to us. Our customers are on different versions than the most current, and it's driving us crazy that we can't set the defaults for
    each Adobe application. For Instance,
    We want for Defaults:
    Photoshop = CS4
    InDesign = CS4
    Illustrator = CS5
    etc.
    The Finder will not allow us to make the change to open all of a certain file type in the version we want by default. We also use a third party application that allows us to "double
    click" InDesign files and open them in the correct version. This saves valuable navigation time and because of the OS's problem with using the correct icons, it also saves us time
    dealing with the "Untitled" document when we accidentally convert by opening in the wrong application by mistake. We have gone through Onyx utilities and massive permissions
    troubleshooting to no avail. Does anyone know how to set the default for ALL files of a type for Adobe Apps? This has been thoroughly tested and is not working on 10 plus
    machines, and only effects Adobe apps.
    Any Ideas?

    I think you miss understand the question. There is a problem with OSX 10.6 and Adobe Apps. 10.5 ok, not sure about 10.7 because of all of the other Adobe problems we downgraded the test machine that we used for the upgrade. There is no way that I have found to make the files “Double-Clickable” through assigning a default application of files with Adobe extensions. We already have an app. that we use and it worked fine until 10.6. I can’t just approve a division-wide purchase of software for a bug that may be solvable by other means (by the way supposed cost of the licensing Soxy is deceiving at $20. Not for us. For companies it’s $20 per platform & also for each time Adobe updates. When we swap out hardware, we have to pay $40 again . Their pricing is absurd). $40 x a couple hundred machines every 18 months or so, uugh! The ten or so I’m working with are just the ones in my immediate department.
    I know you have good intentions with your reply and I appreciate it, however I’m looking to solve the problem, not put a band-aid on it. If the problem is by design so Rorohiko can hold companies hostage, then I guess we’ll just have to deal with the few extra clicks it takes to figure out which version we’re in need of, and dragging to the launch bar.
    Thanks very much for your reply,
    Seth

  • Setting RecordSelectionFormula to multiple subreports is not working.

    Hello,
    I have an application vb.net Vs2005 winform an Crystal Report for .NET.
    I have a report whith 3 subreports : i want to specify RecordSelectionFormula for the 3 subreport but it work only for one (the last have set) :
    Part of my code :
      Dim dob_Report As New CrystalDecisions.CrystalReports.Engine.ReportDocument
    dob_Report.SetDatabaseLogon("SYSTEM", "pass@123", "CP", "DB_LIVE")
                    Dim Tables As CrystalDecisions.CrystalReports.Engine.Tables = dob_Report.Database.Tables
                    Dim table As CrystalDecisions.CrystalReports.Engine.Table
                    For Each table In Tables
                        table.LogOnInfo.ConnectionInfo.ServerName = "CP"
                        table.LogOnInfo.ConnectionInfo.DatabaseName = "DB_LIVE"
                        table.LogOnInfo.ConnectionInfo.UserID = "SYSTEM"
                        table.LogOnInfo.ConnectionInfo.Password = "pass@123"
                        table.ApplyLogOnInfo(table.LogOnInfo)
                        table.LogOnInfo.ConnectionInfo.AllowCustomConnection = True
                           table.Location = "DB_LIVE." & Mid(table.Location, InStrRev(table.Location, ".", Len(table.Location)) + 1)
                    Next
                    Dim osubrpt As New CrystalDecisions.CrystalReports.Engine.ReportDocument
                    For i As Integer = 0 To dob_Report.Subreports.Count - 1
                        osubrpt = dob_Report.Subreports.Item(i)
                        Dim subrpt_Tables As CrystalDecisions.CrystalReports.Engine.Tables = osubrpt.Database.Tables
                        For Each table In subrpt_Tables
                            table.LogOnInfo.ConnectionInfo.ServerName = "CP"
                            table.LogOnInfo.ConnectionInfo.UserID = "SYSTEM"
                            table.LogOnInfo.ConnectionInfo.Password = "pass@123"
                            table.LogOnInfo.ConnectionInfo.DatabaseName = "DB_LIVE"
                            table.ApplyLogOnInfo(table.LogOnInfo)
                            table.LogOnInfo.ConnectionInfo.AllowCustomConnection = True
                                                table.Location = "DB_LIVE." & Mid(table.Location, InStrRev(table.Location, ".", Len(table.Location)) + 1)
                            'table.ApplyLogOnInfo(table.LogOnInfo)
                        Next
                        osubrpt.VerifyDatabase()
                    Next
                    dob_Report.VerifyDatabase()
    '... I passed the code that set log info on the table of report and subreport
                            dob_Report.OpenSubreport("Summary").RecordSelectionFormula = "{a.DOCDATE} >= date(" & strFromDate & ") " & " AND " & "{a.DOCDATE} <= date(" & strToDate & ")" & " AND " & "{a.LOCATIONCODE} = '" & strLocation & "'" & " and " & "{a.DOCTYPE} = '" & "I" & "'" & stroption
                            dob_Report.RecordSelectionFormula = "{s.DOCDATE} >= date(" & strFromDate & ") " & " AND " & "{s.DOCDATE} <= date(" & strToDate & ")" & " AND " & "{s.LOCATIONCODE} = '" & strLocation & "'" & " and " & "{s.DOCTYPE} = '" & "I" & "'" & " and " & "{s.ex} <> '" & "exp" & "'" & stroption
    'Now i want to set RecordSelectionFormula  for subreport
      form1.crystalreportviewer1.ReportSource = dob_Report
                form1.Text = strFormTitle
                form1.ShowDialog()
    when i do that
    first and second subreport don't apply the RecordSelectionFormula and show all data
    third subreport is displaying proper.
    I've tried dob_Report.OpenSubreport(0) this method also but results are same.
    Environment:
    Visual Studio 2005, Crystal Report 10, SAP HANA Studio, SAP 9.0

    Hi Ashish
    Couple of things. You mention you are using CR 10, but I am not sure if this is the version of CR that bundled with VS 2005 (CR 10.2), or a stand-alone version of CR. So. Assuming that this is CR 10.2, make sure you apply SP 1:
    Crystal Reports for VS 2005 and  VS 2008 Updates & Runtime Downloads
    Then see KBA 1204895 - Selection formula is ignored when using Crystal Reports 2008 and VS .NET 2005
    Finally, you may want to consider using the code below:
    //I loop through all the sections looking for subreports and set the log on info, same as the main report:
    foreach (CrystalDecisions.CrystalReports.Engine.Section crSection in crSections)
        crReportObjects = crSection.ReportObjects;
        //loop through all the report objects to find all the subreports
        foreach (CrystalDecisions.CrystalReports.Engine.ReportObject crReportObject in crReportObjects)
            if (crReportObject.Kind == ReportObjectKind.SubreportObject)
                //you will need to typecast the reportobject to a subreport object once you find it
                crSubreportObject = (CrystalDecisions.CrystalReports.Engine.SubreportObject)crReportObject;
                string mysubname = crSubreportObject.SubreportName.ToString();
                //open the subreport object
                crSubreportDocument = crSubreportObject.OpenSubreport(crSubreportObject.SubreportName);
                //set the database and tables objects to work with the subreport
                crDatabase = crSubreportDocument.Database;
                crTables = crDatabase.Tables;
                tableIndex = 0;
                bool SecureDB;
                //loop through all the tables in the subreport and set up the connection info and apply it to the tables
                foreach (CrystalDecisions.CrystalReports.Engine.Table crTable in crTables)
                        crConnectioninfo.UserID = "sa";
                        crConnectioninfo.Password = "PW";
                        crConnectioninfo.DatabaseName = "QTYLTD";
                        crTableLogOnInfo = crTable.LogOnInfo;
                        crTableLogOnInfo.ConnectionInfo = crConnectioninfo;
                        crTable.ApplyLogOnInfo(crTableLogOnInfo);
    crSubreportDocument.RecordSelectionFormula = <selection formula>
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Programatically set where clause or view criteria not working in managed bean

    I get a view using finditerator then then apply setwhere or view criteria but it does not filter the original rows. code is as follows
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");  // not working
       /*   // not working
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    /* not working
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();

    thanks for reply.
    Jdeveloper version is 11.1.1.4.0.
    Actually the vo on which I am trying to set set where is used as source to act as cursor  to get values from filtered rows using set where and copy the this cursor values to another target vo. I am not showing these source values just getting values.
    DCIteratorBinding dcIter2 =
    ADFUtils.findIterator("PlotDtl2Iterator");     
    ViewObject dvo = dcIter2.getViewObject();
    // colors to copy 
    DCIteratorBinding dcIter3 =
    ADFUtils.findIterator("PlanColorsIterator");    
    ViewObject cvo = dcIter3.getViewObject();
    cvo.setNamedWhereClauseParam("Plno","4000");
    cvo.applyViewCriteria(cvo.getViewCriteriaManager().getViewCriteria("PlanColorsCriteria"));
    cvo.ensureVariableManager().setVariableValue("Plno", "4000");
    cvo.executeQuery();
    cvo.setWhereClause("plan_no = :ThePlanType");
    cvo.defineNamedWhereClauseParam("ThePlanType", null, null);
    cvo.setNamedWhereClauseParam("ThePlanType", "4000");
    cvo.executeQuery();
    int totalCount=cvo.getRowCount();
    cvo.setRangeSize(totalCount);
    Row[] rArray=cvo.getAllRowsInRange();
    for (Row r:rArray){
    NameValuePairs nvp = new NameValuePairs();      
    nvp.setAttribute("Description",r.getAttribute("Description"));
    nvp.setAttribute("PlanNo",r.getAttribute("PlanNo"));
    nvp.setAttribute("MainAcc",r.getAttribute("MainAcc"));
    nvp.setAttribute("Plqty",r.getAttribute("Qty"));
    nvp.setAttribute("Cdkid",r.getAttribute("CdkId"));
    nvp.setAttribute("FabricCode",r.getAttribute("FabricCode"));
    nvp.setAttribute("DyeWash",r.getAttribute("DyeWash"));
    //  nvp.setAttribute("Description","test");
    Row drow = dvo.createAndInitRow(nvp);      
    dvo.insertRow(drow); 

  • Set Stroke weight for a frame not working in CS4.

    Hi All,
    How to set Stroke weight for a frame.
    I tried using CreateStrokeWeightCommand of IGraphicAttributeUtils, but its not working in CS4.
    Regards,
    Jasmine
    Message was edited by: Jasmine_Shaikh

    Hi All,
    CreateStrokeWeightCommand of IGraphicAttributeUtils works only when if the frame has some stroke weight already applied to it.
    So do i need to set something else before using CreateStrokeWeightCommand to make it work programatically on a frame with no stroke weight.
    Jasmine

  • Single row/column marquee tool "add to" not working

    I was trying to follow along with a tutorial that was using the single row/column marquee tool.  In it they used shift click to add to the selection.  It's not working for me.  I also tried clicking on the add to icon for the marquee tool, and it still doesn't work.  Does anyone know what the problem could be and how I might fix it?
    Thanks!

    hey i know this is late but if its any help now all u need to do i zoom in a lil closer the proceed with the selection. hope i helped. oh and u have to make sure your grid lines are perfectly on the 10,20,30,... percent mark and u have to be zoomed in if u want to see your lines. the problem is your file is too big and has somn to do with ur computer. its not only mac windows too.
    p.s. when ur done drawing the boxes u can zoom out...i know the tutorial

  • "Set the Desktop Picture" command does not work in certain instances

    I've decided to take a try at using automator. Anyways I've created a very simple workflow.
    Get Specified Finder Items (points to an image file)
    Set the Desktop Picture
    Now this usually works when the desktop is set statically to a specified image. But when I set the desktop to change the picture periodically, the automator action fails to change the picture to the specified image, when executed.
    Is this a bug? Is there any workaround for this?

    Your workflow actually is changing the static desktop picture, it's merely failing to then switch off the "Change picture" feature.
    The "Change picture" feature has a somewhat misleading name in that it's not actually changing your static desktop picture at all. Your static desktop picture remains in place as a new dynamic picture layer is continually drawn and redrawn directly on top of it.
    I don't see any way of testing for or turning off the desktop slideshow automatically, short of writing a GUI AppleScript that opens System Preferences and clicks through to the relevant toggle setting. If you file feedback with Apple they might take a look at it.
    http://apple.com/feedback/

  • Windows 8 and set up iTunes....not working...HELP!

    I have a new Windows 8 computer and downloaded iTunes on it...but I cannot get my purchased music. First it tells me that my computer is not authorized and I followed all of the rules for that which did not work (Windows 8 did not have the option I needed or the new iTunes layout does not work the same as the directions) and now it won't even show me my purchases when I go into the store..

    Yes, it stinks, but one could have known before, one can find out before going to a new OS which applications are already running and which not.
    I am not sure anything Android or Samsung is already running on Windows 8.

  • Setting default value to columns on tabular form is not working.

    Hi,
    I created a tabular form and i want to set some default values to columns based on the values in page items.
    so i set the page item to column value in tabular form attributes by selecting the Default type as PLSQL Expression & Function DEFAULT value &P24_ISSUE_ID. it worked fine but
    in the similar way i tried for the another column by selecting the default type as pl/sql expression & function and default value &P24_CASE_NAME.
    but it throwing an error for this like failed to parse SQL query:    ORA-00904: "C254DB": invalid identifier
    i don't understand where i gone wrong even i checked for the data types of the columns, everything is fine.
    so please help me out of this problem.

    Tulasi 1243 wrote:
    for the first column
    i selected
    DEFAULT TYPE as PL/SQL Expression & FUNCTION
    Default as *&P24_ISSUE_ID.* This is a number data type column
    2nd column
    Default Type as PL/SQL Expression & Function
    Default as *&P24_CASE_NAME.* This is Varchar2 data type column.The appropriate options for a default value from a page item are Item (application or page item name) for Default Type and the item name ( P24_ISSUE_ID, P24_CASE_NAME etc) for Default.
    *&P24_ISSUE_ID.* is not a "PL/SQL Expression or Function".
    but it throwing an error for this like failed to parse SQL query: ORA-00904: "C254DB": invalid identifierWhat you are doing results in the APEX engine substituting the P24_CASE_NAME value "C254DB" into the default value and then trying to evaluate this string as a piece of PL/SQL. Outside of a block in which it is defined as a variable, constant or function "C254DB" is not a valid PL/SQL expression.

  • How do I turn off searching from the address bar. Setting keyword.enabled to false is not working.

    I never want to search from the address bar. I've been able to turn off this horrible annoying feature in the past by setting "keyword.enabled" to false but this no longer seems to work. Is there any way to fix this so that searching from the address bar never happens with any search engine?

    If you set keyword.enabled to false, then what Firefox normally does is check whether your address bar entry is a valid server name (first DNS lookup) and, if not, it will try fixup (e.g., www.+''what you typed''+.com) (second DNS lookup).
    If you get search results, particularly if you get results from some site other than your preferred search engine, there are two possible explanations:
    (1) DNS provider hijack.
    There are some service providers that do not answer the DNS lookups honestly and instead will divert you to their own page of search results. In that situation, there sometimes is a link on the page to opt out, either right there, or behind an explanation (why do I get this page?) or a settings link. You may have to look around. Or if your service provider won't let you opt out, you might need to switch to using OpenDNS or Google Public DNS.
    You probably should also check your connection setting it case that has been modified:
    "3-bar" menu button (or Tools menu) > Options > Advanced > Network mini-tab > "Settings" button
    Try "No proxy" here to see whether that helps.
    (2) Bad add-on.
    Some extensions will divert honest DNS misses to their preferred search site. Here's what I suggest for cleaning out bad add-ons:
    (A) Open the Windows '''Control Panel''', Add/Remove Programs. After the list loads, click the "Installed on" column heading to group the infections, I mean, additions, by date. This can help in smoking out undisclosed bundle items that snuck in with some software you agreed to install. Take out as much trash as possible here.
    (B) Then, in Firefox, open the '''Add-ons page''' using either:
    * Ctrl+Shift+a
    * "3-bar" menu button (or Tools menu) > Add-ons
    In the left column, click Plugins. Set nonessential and unrecognized plugins to "Never Activate".
    In the left column, click Extensions. Then, if in doubt, disable (or Remove, if possible) unrecognized and unwanted extensions.
    Often a link will appear above at least one disabled extension to restart Firefox. You can complete your work on the tab and click one of the links as the last step.
    (C) Search for remaining issues with the '''scanning/cleaning tools''' listed in our support article: [[Troubleshoot Firefox issues caused by malware]]. Note that the tools are free and take considerable time to run. If they seem to finish quickly and then ask for payment, you might have a Fake AV infection. Please use the specialized forums listed in the article in that case.
    Success?

  • Multiple row column-sharing with GridBadLayout does not work as expected

    I was trying to figure out why I could not initially accomplish the following with a GridBagLayout:
    Row0: 0000011111
    Row1:      1111122222
    Row2:           2222233333The above is supposed to be 3 JLabels on three different rows:
    The 1st row has a single JLabel starting in column 0 with a width of 2, extending it to column 1.
    The 2nd row has a single JLabel starting in column 1 with a width of 2, extending it to column 2.
    The 3rd row has a single JLabel starting in column 2 with a width of 2, extending it to column 3.
    The entire grid is 4 columns and 3 rows total.
    Below I have two examples where I attempted the above. Only the 2nd example produces the desired effect. The 1st code example ends up putting both the Row 0 and Row 1 JLabel in the same column. This was surprising because I thought the GridBagLayout would give each column contained by a control enough weight to actually make those columns exist.
    Here is what my first code example below produces:
    Row0: 0000011111
    Row1: 1111122222
    Row2:           2222233333The first two JLabels, 0000011111 and 1111122222, appear in the same column, and the 3rd JLabel appears in the seemingly 2nd column. This was confusing to me which is the point of this whole post.
    In order to gain the desired effect, I had to place 4 blank dummy empty JLabel components in a non-visible Row 0 of the grid. I did this for all 4 columns of that invisible row 0. The row is non-visible because the JLabel have no text or output. After adding this non-visible Row 0, all of the original mentioned Rows 0 through 2 become Rows 1 through 2 respectively.
    For example:
    Row0: iiiiiIIIIIiiiiiIIIII
    Row1: 0000011111
    Row2:      1111122222
    Row3:           2222233333The above shows an inserted Row 0 with invisible labels that are not seen, but they seem to give weight to each column, allowing each to exist. Without doing this, as mentioned, the first code example (shown below) fails. The second example (also below) works, so it appears that putting the invisible controls into the first row, one in each column, somehow gives enough weight to each column to "establish" the column more so than otherwise.
    The big question I have is why didn't the first example work?
    I mean, in that example, I'm giving each JLabel equal weight, and each one takes up a width of 2 columns, so why doesn't the JLabel in the second row end up in column 1? Instead, both the original row 0 and row 1 JLabels appear in what looks like column 0, the same column. Does anyone know why this happened?
    The invisible control solution is fine but I'm just curious why it wasn't as intuitive as it should have been. The only thing I can come up with is that the weight of the 1st and 2nd JLabel (row 0 and 1) got combined in some fashion which combined them into column 1 which end up looking like column 0 since 0 somehow looses all weight. (???)
    ****************** THE FOLLOWING DOES NOT PRODUCE THE RIGHT EFFECTS ******************
    public class TestCoincidingColumns1 extends javax.swing.JFrame {
        /** Creates new form TestCoincidingColumns1 */
        public TestCoincidingColumns1() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new java.awt.GridBagLayout());
            jLabel1.setText("LabelRow0Col0Wid2");
            jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 255)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            getContentPane().add(jLabel1, gridBagConstraints);
            jLabel2.setText("LabelRow1Col1Wid2");
            jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            getContentPane().add(jLabel2, gridBagConstraints);
            jLabel3.setText("LabelRow2Col2Wid2");
            jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 2;
            gridBagConstraints.gridy = 2;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            getContentPane().add(jLabel3, gridBagConstraints);
            pack();
        }// </editor-fold>
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new TestCoincidingColumns1().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        // End of variables declaration
    ****************** THE FOLLOWING WORKS ******************
    public class TestCoincidingColumns1WithFix extends javax.swing.JFrame {
        /** Creates new form TestCoincidingColumns1WithFix */
        public TestCoincidingColumns1WithFix() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
            java.awt.GridBagConstraints gridBagConstraints;
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            DummyRow0Col0 = new javax.swing.JLabel();
            DummyRow0Col1 = new javax.swing.JLabel();
            DummyRow0Col2 = new javax.swing.JLabel();
            DummyRow0Col3 = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new java.awt.GridBagLayout());
            jLabel1.setText("LabelRow0Col0Wid2");
            jLabel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 255)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 1;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(jLabel1, gridBagConstraints);
            jLabel2.setText("LabelRow1Col1Wid2");
            jLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 2;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(jLabel2, gridBagConstraints);
            jLabel3.setText("LabelRow2Col2Wid2");
            jLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 255, 0)));
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 2;
            gridBagConstraints.gridy = 3;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(jLabel3, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(DummyRow0Col0, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(DummyRow0Col1, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 2;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(DummyRow0Col2, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 3;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.weightx = 1.0;
            getContentPane().add(DummyRow0Col3, gridBagConstraints);
            pack();
        }// </editor-fold>                        
        * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new TestCoincidingColumns1WithFix().setVisible(true);
        // Variables declaration - do not modify                     
        private javax.swing.JLabel DummyRow0Col0;
        private javax.swing.JLabel DummyRow0Col1;
        private javax.swing.JLabel DummyRow0Col2;
        private javax.swing.JLabel DummyRow0Col3;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        // End of variables declaration                   
    }

    I think I figured out the general reason for the problem based on a quick trace through of the GridBadLayout code in a simple example, and I wanted to share my findings in case they may be useful to anyone else. I felt there were some concepts gleaned from the source code that don't appear reinforced with documentation or, more importantly, in tutorials or books I checked. That's why I wanted to share my findings with this simple yet perplexing example.
    This example is very much like the one in my original post except it is more simple and only uses two JLabels.
    I created a grid with the following settings:
    JLabel1,gridx=0,gridy=0,gridwidth=2,weightx=1.0
    JLabel2,gridx=1,gridy=1,gridwidth=2,weightx=1.0Using the character '1' for JLabel1, and the character '2' for JLabel2, and 'x' for an "empty" grid cell, the above gives me the following simple conceptual layout:
    11x
    x22But the 'x' cell columns don't receive any weight, so things actually appear as follows:
    11
    22Internally, GridBagLayout (GBL), is really producing the following:
    11x
    x22But since the 'x' locations take no weight, they therefore get no size, so both JLabels appear as though they are in the first and only column.
    From what I can see, it doesn't really matter what I do, I'll never be able to produce the following effect with just two JLabels:
    11x
    x22I cannot do the above with just two JLabel components and a GridBagLayout. The reason is that the GridBagLayout, while it does define a "grid" of rows and columns, the grid is not a grid that actually relates to what is displayed. It's really a grid that defines what I'll refer to as "weight collisions" or "weight pools." If two components share, say, a grid column, their weights will combine with respect to that column. But the total size of the grid doesn't play a role in enforcing that some sort of grid display is maintained. The grid can possibly do that, but it would probably be safer to view that result as a side-effect produced by using the "weight pools" created by the grid itself.
    In the above simple example, JLabel1 ends up giving gridx 1 (0 being first) its full weight of 1.0. The gridx 0 column receive zero weight from JLabel1. What happens is the code in GridBagLayout sees that there are no presently assigned weights to column 0 and it simply assigns all remaining unassigned weight of JLabel1 to JLabel1's last, right-most in this case, gridx column. This means that gridx 1 gets the full 1.0.
    By contrast, though, when processing JLabel2, the GridBagLayout sees the previously assigned 1.0 to gridx 1 (JLabel1's right-most grid column) and it ends up assigning all of JLabel2's weight to that same grid location, gridx 1. In this case, even though JLabel2 supposedly spans through to gridx 2, the actual gridx 2 column gets 0 weight from JLabel2 and therefore gets no width.
    The result is that both JLabel1 and JLabel2 give 100% of their weight to gridx column 1 (what I called above a "weight pool" rather than a grid location), and both gridx 0 and gridx 2 receive 0 weight and I'm guessing appear without any size. What's odd about this is that even though JLabel1 starts at gridx=0, it really doesn't draw itself anywhere but starting at gridx=1. Likewise, even though JLabel2 draws itself supposedly from gridx=1 through to gridx=2, it doesn't really go into gridx=2 because gridx=2 doesn't get any width.
    In fact, given the code in GridBagLayout, it doesn't matter how much weight I give to either JLabel, all 100% of the weight will end up in gridx 1, the "center" grid location. The only way to get columnar distribution is to create other components to force the GridBagLayout to see individual columns which match the "grid." When I do this, the columns allow me to create the JLabels in a fashion where they intent/stagger, where a JLabel can start at a "column" location that is in the middle of another JLabel.
    Given this, I've come to the conclusion that it's not worthwhile to look at the GBL "grid" as a grid that propagates grid-like visual locations. It's more like the grid exists during the computation of weights which end up determining the true columns and rows that will visually exist, which may well not be anything like the grid locations one might visualize when looking at the constraints used.
    I think it's unfortunate that many examples and tutorials don't reinforce this concept with simple examples that help one grasp this easily. Most examples I see actually can fool a user into thinking a grid is a true grid in that positions represent visual locations, or that a control spanning into a grid column means that weight will be (at least) partially distributed there.
    You very often won't see the problem I'm describing above when you have dialogbox-like alignment of components which most tutorials and examples utilize. For example, if I take the same example as above, but intent JLabel so that it's gridx is 2, not 1, then both JLabels will not be sharing a single grid column so their weights won't collide. In such a case, one might be misled into thinking that a GridBagLayout's grid is truly providing row/col locations when it's not really doing that. Instead, in this latter case, one is really gaining that effect because certain unintuitive weight collisions. which would produce unexpected results, are being avoided.
    I thought weightx values would give a weight equally to all gridx columns that a component spans but that doesn't seem to be the case here. In fact, it's not even a components first column in my simple example above. GBL causes JLabel1 to given all its weight to gridx=1 (and nothing to gridx=0) while GBL causes JLabel2 to give all its weight to gridx=1 (and nothing to gridx=2). In one case, JLabel1, all weight goes to its right-most spanned-to column, while with JLabel2, it goes to JLabel2's entire first gridx location.
    I guess this is what makes GridBagLayout (GBL) unintuitive. But I don't think it's so much unintuitive as it is probably not well documented. When you look at the source code, it explains stuff which should be in the docs. In fact, not one single book I saw gave any help in solving this problem. I'm guessing this is largely because folks use GBL through trial and error until they get what they want, and perhaps they don't often need to indent halfway as I'm trying to do with GBL in the above example. If a lot of components are aligned, the results are not as unexpected. I'd say, though, that even in those not-so-confusing cases, GBL can troublesome without knowing its grid is all about a grid of weight pools which may or may not produce a visual grid depending on all components' constraint settings.

Maybe you are looking for