Layout with automatic "newline"

Hello, I have a code
public class Flow extends JPanel {
     public Flow() {
          setLayout(new GridBagLayout());
          GridBagConstraints c = new GridBagConstraints();
          c.fill = GridBagConstraints.BOTH;
          c.anchor = GridBagConstraints.PAGE_START;
          c.weightx = 1.0;
          c.weighty = 1.0;
          JPanel filesPnl = new JPanel(new FlowLayout(FlowLayout.LEFT));
          filesPnl.setBorder(BorderFactory.createLineBorder(Color.red));
          for(int i=0; i < 10; i++) {
               JLabel fileLbl = new JLabel("Files-" + i);
               fileLbl.setOpaque(false);
               filesPnl.add(fileLbl);
          add(filesPnl, c);
     public static void main(String[] args) {
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.add(new Flow());
          frame.setBounds(400, 300, 400, 200);
          frame.setVisible(true);
}Panel with files takes all the place by height, is there a way to make it similar to the height of the text that fills it?
I understand that himself points to stretch panel across the width and height
c.fill = GridBagConstraints.BOTH;
c.anchor = GridBagConstraints.PAGE_START;
c.weightx = 1.0;
c.weighty = 1.0;but if I use only c.fill = GridBagConstraints.HORIZONTAL; then FlowLayout can not switch to a new line

ssisqo wrote:
Hello, I have a codeFor better help sooner, post an SSCCE.
It seems the only thing that would be required to turn that into an SSCCE, is the package imports for Swing and AWT - just two more lines of code.
Many people might have automagic IDEs that can insert the imports for them, but I recommend explicitly including them, since:
a) While some do, others (including me) don't.
b) It can lead to uncertainty about the specific class being used. E.G. if you saw 'Timer' in code, would it mean the Swing class, the one in the java.util package, or the one javax.management.timer?

Similar Messages

  • Problem with Automatic Replies or Out of Office

    Hi mates!
    I´ve just finished migration Exchange 2003 to Exchange 2010. 
    Today I´ve removed Exchange 2003.
    I have a problem with Automatic Replies or Out of Office. When the user active Automatic Replies in Outlook 2010, He has this Error:
    Your Out of Office settings cannot be displayed, because the server is currently unavailable. Try again later.
    If I logged into OWA, (Options > Set Automatic Replies) I could set it up and it worked fine.
    I run Test E-mail AutoConfiguration command to see if AutoDiscover has been configured and the OOF URL is correct:
    https://mail.domain.com/ews/exchange.asmx
    I try to browse the OOF URL from IE, It works fine.
    Authentication Permission for EWS Virtual Directory is:
    Anonymous – Enabled (For IUSER)
    Basic – Enabled
    Windows – Enabled
    Other authentication methods are disabled.
    WebServicesVirtualDirectory configuration for URL:
    InternalNLBBypassUrl :
    https://Server1.domain.local/ews/exchange.asmx
    InternalUrl         
    : https://mail.domain.local/EWS/Exchange.asmx
    ExternalUrl       
      : https://mail.domain.com/EWS/Exchange.asmx
    InternalNLBBypassUrl : https:// Server2.domain.local /ews/exchange.asmx
    InternalUrl         
    : https:// mail.domain.local /EWS/Exchange.asmx
    ExternalUrl         
    : https:// mail.domain.com /EWS/Exchange.asmx
    I use a certificate for Server HUB/CAS from my CA (Active Directory).
    In EMC I have this error for certificate:
    The certificate status could not be determinated because the revocation check failed.
    But when I generated in the past, this status of this certificate was This certificate is valid for Microsoft Exchange.
    I need help, because I don´t know I do…
    Thanks.

    Hi MAS,
    As soon as possible I will install this kb in a PC with Outlook 2010.
    Yes, I reset IIS, with the same result.
    I check this URL, and I run this command: TestOutlookWebServices -identity user01 with this result:
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1019
    Type       : Information
    Message    : A valid Autodiscover service connection point was found. The Autodiscover URL on this object is https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1006
    Type       : Information
    Message    : Contacted the Autodiscover service at https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1016
    Type       : Information
    Message    : [EXCH] The AS service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1015
    Type       : Information
    Message    : [EXCH] The OAB service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1014
    Type       : Information
    Message    : [EXCH] The UM service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1016
    Type       : Information
    Message    : [EXPR] The AS service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1015
    Type       : Information
    Message    : [EXPR] The OAB service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1014
    Type       : Information
    Message    : [EXPR] The UM service is configured for this user in the Autodiscover response received from https://mail.domain.local/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1022
    Type       : Success
    Message    : Autodiscover was tested successfully.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1106
    Type       : Information
    Message    : Contacted the Autodiscover service at https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1116
    Type       : Information
    Message    : [EXCH] The AS service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1115
    Type       : Information
    Message    : [EXCH] The OAB service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1114
    Type       : Information
    Message    : [EXCH] The UM service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1116
    Type       : Information
    Message    : [EXPR] The AS service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1115
    Type       : Information
    Message    : [EXPR] The OAB service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1114
    Type       : Information
    Message    : [EXPR] The UM service is configured for this user in the Autodiscover response received from https://SERVER1.domain.local:443/Autodiscover/Autodiscover.xml.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1122
    Type       : Success
    Message    : Autodiscover was tested successfully.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1013
    Type       : Error
    Message    : When contacting https://mail.domain.local/EWS/Exchange.asmx received the error The request failed withHTTP status 401: Authorization Required.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1025
    Type       : Error
    Message    : [EXCH] Error contacting the AS service at https://mail.domain.local/EWS/Exchange.asmx. Elapsed time was694 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1026
    Type       : Success
    Message    : [EXCH] Successfully contacted the UM service at https://mail.domain.local/EWS/Exchange.asmx. The elapsed time was 31 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1013
    Type       : Error
    Message    : When contacting https://mail.domain.com/EWS/Exchange.asmx received the error The request failed withHTTP status 401: Authorization Required.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1025
    Type       : Error
    Message    : [EXPR] Error contacting the AS service at https://mail.domain.com/EWS/Exchange.asmx. Elapsed time was15 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1026
    Type       : Success
    Message    : [EXPR] Successfully contacted the UM service at https://mail.domain.com/EWS/Exchange.asmx. The elapsed time was 31 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1124
    Type       : Success
    Message    : [Server] Successfully contacted the AS service at https://SERVER1.domain.local/ews/exchange.asmx. The elapsed time was 934 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1126
    Type       : Success
    Message    : [Server] Successfully contacted the UM service at https://SERVER1.domain.local/ews/exchange.asmx. The elapsed time was 93 milliseconds.
    All ok, but with these errors:
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1013
    Type       : Error
    Message    : When contacting https://mail.domain.local/EWS/Exchange.asmx received the error The request failed withHTTP status 401: Authorization Required.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1025
    Type       : Error
    Message    : [EXCH] Error contacting the AS service at https://mail.domain.local/EWS/Exchange.asmx. Elapsed time was694 milliseconds.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1013
    Type       : Error
    Message    : When contacting https://mail.domain.com/EWS/Exchange.asmx received the error The request failed withHTTP status 401: Authorization Required.
    RunspaceId : 1a13d412-b75d-48b5-8938-72ad53f11cb7
    Id         : 1025
    Type       : Error
    Message    : [EXPR] Error contacting the AS service at https://mail.domain.com/EWS/Exchange.asmx. Elapsed time was15 milliseconds.
    In IIS for EWS has this method Authentication:
    - Anonymous
    - Basic
    - Windows
    For SSL Settings in EWS has this configuration:
    - Require SSL
    - Client Certificate: Ignore
    For Default Website in IIS, SSL Settings:
    - Require SSL
    - Client Certificate: Ignore
    I don´t have ISA/TMG. I use HLB KEMP for publishing OWA...

  • Line Layout with Reference Key in F-03

    Dear all,
    Iu2019m facing the following problem.
    I modified the line layouts for F-03 through O7Z4S. In particular I created a line layouts with the field Reference key 1. The problem is that in F-03, using this variant, the field XREF1 appeared always blank. The same thing happens for XREF2 while for XREF3  everthing is ok.
    Is something that I forgot in customizing?
    Thanks in advance

    Dear Alberto,
    I created the same - Reference Key in IDES it works if you create with text and then insert Reference key as part of Field with this.
    Hope this would surely help...
    Deven.

  • How do I create a crystal report layout with a table and borders

    My crystal report is a signin sheet. The sign in sheet has an ID column, Name column, Institution column, Place to signin column, and Weekday columns with checkboxes in each column for the visitor to checkoff.
    How do I display the data that is being used int he crystal report in a table layout with borders around each cell? And is it possible to center vertical alignment of the data within eacvh cell like Excel?

    Blahahaha! Great answer Deb!
    Seriously though... There is no vertical alignment in CR. There have been several past threads related to this issue and all of them have various workarounds. None of them are very elegant.
    The best workaround I've found (especially if you are grid or borders) is to turn off the boarders for the field itself and drawl a rectangle around the field(s). Now you can place the field in the lower portion of the rectangle and adjust the rectangles height to place the field text in the center of the rectangle.
    This will give you more control over the height of your elements than using a carriage return before the text.
    Jason

  • How to display 2 layouts with 2 different Header and Footer in a template.

    Hi,
    I am using XML Publisher 5.5. I have created one template which is having two layouts. I am using <?Start: Body?> and <?end body?> for displaying Headers and footers. Now my problem is, I need to display first layout with it's associated Header and footer and then second layout with other header and footer. But the two layouts should come in single template file. How is it possible?. Is there any work around? Please help me as this is the urgent requirement to my client.
    Thanks.
    Siva.

    No problem. Select Insert -> Break from the menu bar. Then select a "Section Break" - Next page.
    Header 1
    <?start:body?>
    Page 1
    <?end: body?>
    Footer 1
    ==================Section Break (Next Page)=================
    Header 2
    <?start:body?>
    Page 2
    <?end: body?>
    Footer 2
    Worked like a charm.
    Klaus

  • Error: Reason codes with automatic charge-off are not permitted here(F-28)

    Hi All
    I creted a reason code in obxl t-code and assigned a gl code in OBXL transaction code, But when I am trying to clear a payment with reason code in F-28, System is throwing the following error..Can some one tell me why i am getting this error?
    Reason codes with automatic charge-off are not permitted here
    Message no. F5605
    Diagnosis
    The reason code entered is designed to ensure that the payment difference amount is posted to an account specially set up for this purpose.  Postings of this nature usually require additional specifications (e.g. tax code, business area). If the difference stems from a single open item, the necessary specifications can be taken from that item. In the case that led to this error message, however, the difference does not stem soley from one item, which means that this method cannot be used.
    System Response
    The reason code entered is not accepted.
    Procedure
    You can either select a different reason code, which would create a new open item for the customer or vendor OR write off the difference using the function Charge off diff.. This function either takes you into a pre-configured account assignment model or into the document overview. From here you can enter the required difference postings.

    Hi Venkata,
    It seems while entering the payment (partial payment / residual items) ... you are clearing multiple items with differences. (e.g. if the difference amount is $30, then may the difference consists of two invoices underpaid by $15 each). In this scenario, F-28 doesn't know which additional account assignment fields should be picked up ... hence the error.
    First of all, to validate that this indeed is the case, try clearing a payment with the same reason code where difference can be attributed to a single invoice. If you still get an error, then there is some other problem.
    Then, to take care of a the business scenario where the difference can indeed be due to multiple documents, select "charge off difference" option and create an entry to post the difference as necessary.
    HTH,
    Manish Patel
    Sr. SAP Solutions Consultant

  • Can no longer open PDF files from my emails sent from other websites. Problem seems to correlate with automatic upgrade of free adobe software (from version 11 to Reader DC)?

    Can no longer open PDF files from my emails sent from other websites. Problem seems to correlate with automatic upgrade of free adobe software (from version 11 to Reader DC)?

    To configure the browser to use Acrobat or Adobe Reader to open PDF files:
    1. Quit Internet Explorer(any other browser)
    2. Start Acrobat or Adobe Reader.
    3. Choose Edit > Preferences.
    4. Select Internet in the list on the left.
    5. Deselect(Uncheck) Display PDF in Browser, and click OK.
    6. Restart Internet Explorer

  • The background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black backgr

    the background behind my pages has turned black, how do i get it to go back to grey? i have switched between preview, normal, bleed, slug and presentation and closed and opened in design and it is still black. I can't imagine layouts with the black background please help!

    or maybe the interface has been set to Dark?
    Go to Preferences > Interface tab, choose Light from Color Theme dropdown on Apearance section (upper part of the window)

  • COPA Report Layout with Object List (ALV)

    Hi,
    I have question about the COPA report layout with object list (ALV). Everytime I executed the report with ALV format, the amount for quantity column always shows with 3 decimal number, menwhile for amount column always follow by 2 decimal number.
    Can anyone help me regarding this matter? I do not know how to turn off the decimal number to be 0 in this type of layout, although in the form itself I already put 0 decimal number.
    Thanks.

    Hi,
    Better to raise this issue in CO Forum. You can expect some solution.
    regards

  • Problem in with automatic payment TRANSACTION    f110  transaction

    Hi
    We are facing problem with automatic payment TRANSACTION    f110  transaction  version SAP ECC6.0
    When there are multiple invoices for the same customer with cash  discount amount  given by the user manually( not  cash discount percent)
    For eg if there  5 invoices with cash discount amount
    When there is  payment method defined on document level for some of the  invoices(3) and  2 invoices payment method is not defined on document level(Payment method is defined on customer master  also for those customers )
    The following dumb occurs
    Settlement  will be created, but the F110 cancelled with a shortdump on customer master balance update
    Database error text........: "[IBM][CLI Driver][DB2] UNSUCCESSFUL EXECUTION
      CAUSED BY DEADLOCK OR TIMEOUT. REASON CODE 00C90088, TYPE OF RESOURCE , AND
      RESOURCE NAME"  
    Internal call code.........: "[RSQL/UPDT/KNC1 ]"
    "DBIF_RSQL_SQL_ERROR" "CX_SY_OPEN_SQL_DB"
    "SAPLF005" or "LF005F01"
    "ZAHLVERHALTEN_FORTSCHREIBEN"
    Any help in this is highly appreciated
    Thanks
    Sarath

    1615356     F110 Code improvements
    1255455     F110 Exception BCD_FIELD_OVERFLOW during item output
    1237330     F110 Error if more than one down payment
    1105073     F110: Program termination DBIF_RSQL_SQL_ERROR

  • ALV Standard Layout with problem for excel download

    Hi, i have a alv grid report with this problem:
    I execute the report and see all data ok.
    chose the download option to spreadsheet.
    *When open the spreadshet only see headers and no data.
    The report have a standard Layout with 4 of 12 column selected, if i execute this report and add a new column for the pool the download works fine, if i save this new layout as default and execute the report again the download don't work fine.
    ¿Some idea? Thxs

    Just a wild guess. In your system, check the MS excel security settings. Excel->File->options->Trust center settings. We had some similar issues with excel columns visibility when you click on the ALV spreadsheet button or download which was corrected by changing the trust center settings. I don't exctly remember which settings affect this. You may have to compare the settings with another system (If it works fine in some other system which was the case in our issue). Pls ignore if not relevant.
    Regards,
    Gokul

  • Fluid Grid Layout with Sidebar

    I am fairly new to dreamweaver and trying to build a fluid grid layout with a sidebar which needs to span the full height of the website and I am having trouble. I cant get the sidebar to span multiple columns using the fluid grids. I know I can do it with pure css using display options but wanted to know if. Can do it visually using dreamweaver's built in tools and UI.
    Can someone point out if I am going about this correctly? I can provide more info if needed.
    Thanks.

    I started using FGL when first introduced. In the meantime they have improved quite a bit, but I was so taken aback that I decided not to go down that path again.
    I have used Foundation and am now using Bootstrap. Although I would prefer to use the former as I think that it is better, the general trend is towards Bootstrap.
    You can start with the free of charge Bootstrap extension.

  • UIX Custom table layout with ADF Bindings

    hello,
    Please point me to examples of binding ADF data controls on UIX table and also the UIX table layout with different row and col spans.
    Thanks in Advance.

    bump.

  • Layout with insertcomponent

    Hi all,
    I'm inserting components in a JTextPane using the insertComponent method.
    How can I use a layout with that? I want to have 2 items at the top and one at the bottom, when I resize my window, the components are shifted into one line
    Thanks a lot

    You don' use layout managers with a JTextPane. The text "flows" from one line to the next. A component is just considered part of the text.

  • Layout with rows defined by variables

    Joint Venture Name is one of our characteristics. We will create a planning layout with two rows, for two different Joint Venture Names selected by the user. The Joint Venture Names should be selected by the user, preferably when opening the layout using a planning folder.
    We are already using variables for making the user select year and period in other layouts. This is easily done by using variables in the planning level (or package) selection. But these values are only a part of the header area in those layouts.
    Variables may easily be inserted in the rows of the layout. The problem is to set their values. The variables are defined as Fixed Value. "Restriction of Value Required by User" is checked. When entering a range in the the Selection Conditions (or nothing), we get an error message when trying to insert the variable into the layout: Variable ASSET1 could not be replaced in row. The problem is we need a single value and not a range. We would like the user to be able to select that single value. Using "Set Variables" doesn't work. We are not allowed to select a value for those variables. No error message though. If we instead enter possible values in the Selection Conditions, one per line, we may use Set Variables to select a single value per variable and then insert them into the layout. The user will then be able to change value later. However, the number of values is large and may change. So adding all possible values is both time consuming to do the first time and to maintain. Any ideas how to avoid this?

    Alrighty! Got it working =]
    onClipEvent(Load){this.mt="Portfolio";
    this.mc=mt // used elsewhere for transition effects
    this.texter.autoSize = "left"
    rt = this.texter.textWidth
    _x=(_root.intro.footer.Home._x)+(_root.intro.footer.Home.rt)+10
    on(rollOver){this.gotoAndPlay(11)}
    on(rollOut){this.gotoAndPlay(1)}
    on(release){
    this.gotoAndPlay(21);
    _root.sectioncontrol.nextsection=mt;}
    What id like to know now if possible, is how to refresh the movie clips?
    In the last "link area" of the lower linkbar I have this line of code to determine the correct placement of the first link area upon which all the rest are aligned
    widther= (_x+((_root.intro.footer.Home._x)*-1)+rt)
    _root.intro.footer.Home._x=(widther/2)*-1
    And that places the "Home" link area in the correct location for what I'm looking for,
    since all of the other areas get their x locations on load, and I dont want them sitting there checking the area every frame, I know there is a "refresh" function, I'd just like to know how to apply it (when placing after the "middle location" code for home) to the rest of the clips =]

Maybe you are looking for

  • SQL LOADER - How to combine 3 rows into 1

    Hi, I have an input file composed of 4 different data types in 4 rows. line1 has fld1 text(100) line2 has fld2 number(4) line3 has fld3 date(10) "mm/dd/yyyy" line4 has fld4 date(10) "mm/dd/yyyy" all line has data in it. This is my control file: LOAD

  • Accessing object payload type attributes by index?

    Plz help Using object type in queues enforce some limitations to altering object type. You can use only ALTER TYPE and use alteration that only "expand" properties. It'is possible to change column type from VARCHAR2(10) to VARCHAR2(20) but not vice v

  • CBO madness after bulk loading

    This is an extension of my other recent posts, but I felt it deserved it's own space. I have a table of telephone call records, one row for each telephone call made or received by a customer. Our production table has a 10-field PK that I want to dest

  • ESata internal connectors

    Hey guys, I've been having some problems with my firewire lately. I use all firewire and my computer keeps getting kernel panics 5 times a day. For work I just got some drives that came with a eSata extender with the ability to connect on my mother b

  • Need to have a separate iCloud account for daughter's iPod touch

    I would like to manage all my iOS devices under one appleID, but with separate icloud accounts for my two daughters, each with their own iPod.  How do I retain my Apple ID on daughter's iPod but have a separate iCloud address so that she doesn't rece