How to make flowlayout available in its caller??

Dear friends:
Good weekends.
I met a problem when I tried to call a Flowlayout Program from another program.
I have a Flowlayout Program called FlowLayoutPane.java, it can display 20 buttons in FlowLayout, run successes, I write another program called FlowLayoutPaneCall.java to call FlowLayoutPane, these 20 icons display also, but not what I want, I need these 20 buttons display in FlowLayoutPaneCall exactly as same as they display in FlowLayoutPane.java, How can I do that??
[1]. FlowLayoutPane.java
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class FlowLayoutPane extends JPanel {
  public FlowLayoutPane() {
    this.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
    String spaces = "";
    for (int i = 1; i <= 20; i++) {
      this.add(new JButton("Button #" + i + spaces));
      spaces += " ";
  public static void main(String[] args) {
    JFrame frame = new JFrame();
    frame.addWindowListener(new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
        System.exit(0);
    frame.getContentPane().add(new FlowLayoutPane(), BorderLayout.CENTER);
    frame.setSize(600, 400);
    frame.setVisible(true);
}[2]. FlowLayoutPaneCall.java
import java.awt.*;
import javax.swing.*;
public class FlowLayoutPaneCall extends JPanel
     FlowLayoutPane sftp = new FlowLayoutPane();
    public FlowLayoutPaneCall()
           add(sftp);
     public static void main(String[] args) {
          FlowLayoutPaneCall dm = new FlowLayoutPaneCall();
          JFrame f = new JFrame();
            f.setSize(400,400);
             f.setLocation(200,200);
             f.setVisible(true);
          f.getContentPane().add(dm, BorderLayout.CENTER);
          f.pack();
          f.setVisible(true);
Thanks so much!!!

it works, thanks, but If I add following code to add one more panel etc, It still not work, see below,
after call, the layout of 20 buttons in main program
is different from the one of original, how can I keep them same for this new updating??
Thanks
import java.awt.*;
import javax.swing.*;
public class FLPCall extends JPanel {
     FlowLayoutPane sftp = new FlowLayoutPane();
    public FLPCall() {
        super(new BorderLayout());
        JLabel jl =new  JLabel("My New Test Start here");
        JPanel panel =new  JPanel();
        panel.add(sftp);
        add(jl, BorderLayout.NORTH);
        add(panel, BorderLayout.CENTER);
    public static void main(String[] args) {
        FLPCall dm = new FLPCall();
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(dm, BorderLayout.CENTER);
        f.setSize(400,400);
        f.setLocation(200,200);
//        f.pack();
        f.setVisible(true);
  

Similar Messages

  • How to make iBooks available in iBookstore for Sri Lanka and India?

    Does anyone know how to make iBooks available for purchase in iBookstore for Sri Lanka and India?  I have tried going through iTunes Connect to add regions, but it doesn't give me the option to add any more.  Thanks

    ali.basheer.ahamed wrote:
    Can I know How to add to the Indian store please. I have been trying the same - unable to add.
    Consult this list to see whether paid books are available in those countries:
    http://support.apple.com/kb/TS3599
    If not, you have to use another store, like Kindle, Nook, Kobo, Googlebooks, or Sony.

  • How to make material availability check work during Work Order creation

    Hi Experts,
    Kindly advice about these matters:
    1. How to make material availability check work during Work Order creation?
    My requirement is Work Order can not be created when it has missing parts. I have set the config to '3' can not created when is has missing parts, but it still does not work.
    I have implemented SAP Notes 1148139 on my system (SAP ECC 6 Ehp 5) also, but still does not have any effect.
    I must not set the config Res./Purch Doc creation to 'immediately', because it does not fit to my user requirement. Is there anyone knows how to solve this requirement?
    2. How to make information message/ Availability check screen appear when sparepart is missing, without clicking Availability Check button? for example: appear when clicking Save button.
    Thank you
    -amoonra-

    Hi Maheswaran,
    I have implement the prerequisite notes. (Notes 790219 and 1034962). Do you know why it is still does not work?
    Thanks
    -amoonra-

  • I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    It may be due to Continuity
    The following quote is from  Connect your iPhone, iPad, and iPod touch using Continuity
    Turn off iPhone cellular calls
    To turn off iPhone Cellular Calls on a device, go to Settings > FaceTime and turn off iPhone Cellular Calls.

  • How to make programs available to all users

    How to make programs available to all users

    By default, all Applications are installed in /Applications. Those are available to all users. If you choose to install in your home Applications folder, they are only available to that user.
    You can also control app usage with Parental Controls. If that is on, that my be why some cannot use certain apps.

  • HT1937 how to make iphone to iphone video call through sim card

    how to make iphone to iphone video call through sim card??

    use facetime to video call or any other app for that. you should have an cellular data connection or wifi to use this

  • How to make it mandatory for a call off order to reference a contract.

    Hi,
    How do I make it mandatory for my call-off orders to reference contracts?
    Thanks.

    Hi,
    Make the field: "Outline Agreement" in the field selection group assigned to your calloff PO document type.
    Umakanth R

  • How to make PDFs available for viewing online only

    Sorry for the odd thread title — it is the only one that makes sense.
    I work for a small non-profit historical group.  We are digitizing to archival standards a collection of newspapers and periodicals and want to make them available to the public.  However we do not want to just put the PDF out there as that offers opportunities for theft.  Some of the already released material has already been lifted from Archives.Org and is now being sold on CDs and the Internet by for-profit nefarious people.
    So..., is there a way to take the PDF and have it so that it will not work unless it is viewed on our website?  In other words, if a person downloads the file to their computer it will not work?  I think it should be possible to include a java script routine somewhere whereby if the file is opened online, it opens.  But if a person downloads it to their computer and tries to open the file and does not see a small script file, it does not open.  OR, is it possible to give each file it's own certificate for online use only?
    A sample PDF can be viewed here.
    Thank you one and all for any replies,
    A. Wayne Webb

    Thank you for the response George and Isakten.
    I found my solution, and better yet it will not break the budget.  CopySafe PDF Protector while perhaps a bit unwieldy for a first-time end user, offers all I needed.  It forces the end user to add an add-on for their browser and we all know that can be difficult at best, but the program takes care of it handily.
    Cordially,
    A. Wayne Webb

  • How to make data available in SAP PI from SAP BI

    Hello All,
    I have certain data in a INFOCUBE ie in SAP BI and as per my requirement i want to push that data to SAP PI
    Can I get to know the process to make data available to SAP PI from SAP BI..?.
    It would really helpful if i get the step by step procedure for the same.
    Thanks in Advance.
    Regards,
    Foram

    Hi,
    SAP PI is the interface to move file from one system to other system like BI, R/3 etc.,
    Create open hub on top of Info cube based on your requirement. Create logical path and assign physical path to logical path using T-code FILE. Provide that logical path in Open hub destination where the file will be placed. Then SAP PI team will pick that file and process that file as per requirement.
    Thanks & Regards,
    Chandra Sekhar.

  • How to make a functions that gets called when the plug in is loaded?

    I'm making an automate plugin, and I want to make a functiosn that gets called when Photoshop loads my plugin. It doen't matter if my plug is never called fro the File->Automate menu. Is there any way to do this? Thank you.
    Daniel

    Hi There,
    I don't believe there is a way to handle this currently within App-V...Other virtualization products do have the ability to exclude processes and force to run outside or the bubble or exclude them from terminating on shutdown.
    It would be a great feature request for a future release. You can easily request it here:
    http://appv.uservoice.com/forums/280448-microsoft-application-virtualization
    PLEASE MARK ANY ANSWERS TO HELP OTHERS Blog:
    rorymon.com Twitter: @Rorymon

  • SAP system requirements to make it available via ITS

    Hi Colleagues,
    We are using SAP R/3 4.6C with kernel 4.6D patch 2225.
    DB is ORACLE release 9.2.0.6.0 and OS is  HP-UX B.11.00
    The package levels are as follows.
    SAP_BASIS SAPKB46C46
    SAP_ABA   SAPKA46C46
    SAP_APPL  SAPKH46C46
    Now  we are thinking of making our system available via ITS.
    We have a seperate ITS instance :
    •     Windows 2003 Server
    •     IIS 6.0
    •     Java (JRE 1.5)
    •     SAP ITS 6.20 Patch level 20
    Could you please let me know some relevant notes/links or some useful documents to check whether our SAP system meets the requirements for ITS?
    Basically I am looking for the minimum requirements in SAP R/3 side before going for ITS 620
    Best Regards,
    Arun

    Hi Arun!
    Yes, ITS 6.20 is the most current release -and I am almost sure that this release will be at least one of the last releases of standalone-ITS.
    Plug-In should fit to your portal on the one hand and your backend on the other hand. The plug-in you mentioned here sounds good ...
    Good luck for your further project progress!
    Regards,
    Volker
    btw: Rewards are always welcome, because SDN needs rewards like the air to breath ...  but only reward people who really helped you, otherwise we will see some kind of "spam" suggestions fishing for points in the near future which would help nobody. Your opinion?

  • How to make the TAB Key Event called

    Hi ,
    I want to make the tab key called twice when I hit on a button. It should jump to the next 2 cell.
    Thanks.
    DT

    Here's a couple related threads
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=583877
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=712386
    I'd also suggest exploring the Search Forums available on the left,
    which is how I found those threads:
    http://onesearch.sun.com/search/onesearch/index.jsp?qt=focus+traversal+tab+text&subCat=siteforumid%3Ajava57&site=dev&dftab=siteforumid%3Ajava57&chooseCat=javaall&col=developer-forums

  • How to make each catergory has its own RenderListItem ?

    Hello:
       Everyone!
       I am using XML Form Builder to creat a Blog,I creat three category which is called most recent blog, topic,bloggers.
       I preview the result iview,after I click every category,the RenderListItem is the same.However I need the RenderListItemevery of each category is different.
       How can I set?
       Thanks in advance!
       lexian

    Hi,
    I assume that in KM each category has its own folder.
    If so then, create XML Resource Renderer for each category  and then assign this
    XML Resource Renderer to a Layoutset and then assign this Layoutset to the Folder.
    In KM to set Layoutset for folder:
    Settings --> Presentation -->Select Profile
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/c2/6e1965a6b6234b91b3332bdf2d9e23/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/63/5206ff8946ca40b849d6b3e4bb85fb/frameset.htm
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/0e/1affa0f8c47447a164998b60025aea/frameset.htm
    Step:
    1. Creating XML Resource Renderer for each category 
    2. Creating Layoutsets for each XML Resource Renderer
    3. Assing Layoutset for each Folder/category.
    Hope this helps
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • How to make set up with first call of method of a custom class?

    Hello
    I have build a custom class with a few custom methods.
    Method1 is called per every record of internal table. I need to set up certain parameters tha are the sme for all the calls  (populate the range , to fill the internal table , etc). This should be done only once.
    call method ZBW_CUSTOM_FUNCTIONS=>METHOD1
            exporting
              I = parameter1
            importing
              O = parameter2.
    Loop at ....
       <itab>-record1 = parameter2
    endloop.
    Methods2, 3 , 4 dont need any set up.
    Can somebody tell me how to do it within class?
    Thanks

    Instance methods (as opposed to static methods) are called on an object, which is an instance of a class. Broadly, think of the class as a template for the creation of objects. The objects created from the class take the same form as the class, but have their own state -- their own attribute values. In pseudo-ABAP (this won't even close to compile), let's say you have the following class:
    CLASS cl_class.
         STATICS static_attr TYPE string.
         DATA attr1 TYPE string.
         DATA attr2 TYPE i.
         CLASS-METHOD set_static_attr
              IMPORTING static_attr TYPE string.
              cl_class=>static_attr = static_attr.
         ENDMETHOD.
         METHOD constructor
              IMPORTING attr1 TYPE string
                                 attr2 TYPE i.
              me->attr1 = attr1.
              me->attr2 = attr2.
         ENDMETHOD.
         METHOD get_attr1
              RETURNING attr1 TYPE string.
              attr1 = me->attr1.
         ENDMETHOD.
    ENDCLASS.
    When you create an instance of the class (with CREATE OBJECT oref), the constructor is implicitly called. You can pass parameters to the constructor using: CREATE OBJECT oref EXPORTING attr1 = 'MyString' attr2 = 4.
    You then call methods on the instance you have created. So, oref-&gt;get_attr1( ) would return 'MyString'.
    The constructor is called when the object is created (so, when you call CREATE OBJECT). At this time, the setup is done, and any subsequent methods you call on the object will be able to use the attributes you set up in the constructor. Every object has its own state. If you had another object, oref2, changing its instance attribute values would not affect the values of oref.
    Static methods and attributes are different. A static attribute exists only once for all instances of the class -- they share a single value (within an internal session, I think. I'm not sure of the scope off-hand.) You also call static methods on the class itself, not on instances of it, using a different selector (=&gt; instead of -&gt;). So, if you called cl_class=&gt;set_static_attr( static_attr = 'Static string' ), 'Static string' would be the value of static_attr, which belongs to the class cl_class, and not instances of it. (You can also set up a class constructor, which is called when the class is loaded, but that's another subject.)
    To answer your question more succinctly: no, the constructor is not called before each method. It is only called when you create the object. Any subsequent methods called on the object can then access its attributes.
    Please have a look at [http://help.sap.com/saphelp_nw70ehp2/helpdata/en/48/ad3779b33a11d194f00000e8353423/frameset.htm] for a more thorough treatment of basic object concepts. (The rest of that documentation is very thin, but it'll get you started. Also, it doesn't appear to deal with statics. You'll have to look elsewhere for that.)

  • How to make a Mediator deal with calling an external Asynchronous Service

    Hi,
    Using TP 4.
    I want my Mediator to invoke an Asynchronous Service that is external to the composite application. But I do not know how to get the reply from that service back into my Mediator.
    I have worked with the sample of calling an asynch BPEL component within the same composite - that is fairly easy to accomplish.
    What how can I tell the external service to invoke a callback porttype on my Mediator. Can the SCA container work out the correlation between the external service and the correct instance of the SCA composite? Should the Mediator publish the callback interface as an external service at the SCA Composite level? If so - how would the correlation work? If not, how does it work?
    Any suggestions - even the statement that I always need a BPEL component in between that will support correlation with external asynch services, if that is the case - will help.
    Thanks.
    Lucas

    Kylie, welcome to the discussion area!
    Cable modems behave differently than DSL modems in that they will "remember" the last device that they have associated with. Your modem is "remembering" your MacBook and when you connect the TC, the modem won't connect because it "remembers" the MacBook.
    You need to make the modem "forget" a previous device whenever you make a change in the device that is directly connected to the modem. Here's how:
    Push the reset button on the modem if it's present
    Pull the power cable on the modem
    Pull the battery from the modem if it is easily accessible
    Leave the modem powered down for 25-30 minutes
    Power down the rest of your network as well
    After the wait period, connect the modem to the WAN port on the TC with an ethernet cable
    Power up the modem first and let it run for 3-4 minutes by itself
    Then power up the TC the same way
    Power up the rest of your network the same way
    Depending on how you had your TC configured with the DSL modem previously, you may need to make a few changes in the settings.
    Post back on your progress.
    Message was edited by: Bob Timmons
    null

Maybe you are looking for

  • The connection to the server was reset while the p...

    For the past week i keep getting the below error page every minute or so---> "The connection to the server was reset while the page was loading.   The site could be temporarily unavailable or too busy. Try again in a few     moments.   If you are una

  • Can't download developer edition

    I can't download FMS DE Linux Version. Windows version starts downloading instead (the Flashmedia3_5_Int_Strm_ALP file). Help required urgent! Thanks in advance.

  • ALV cell without displaying Zero.

    Hi ABAP gurus,    I am working on alv report  and  i came across situation where we don't want to display zeros in   some of the Cell based on some condition.   i don't want to do it on column level otherwise i can use no_zero. i like to do it on cel

  • HELP GridBagLayout borders

    is there anyway to create a border going along when you set the gridy (ie like a table) ??? Any help greatly appreciated. MJ

  • How do I verify my iCloud on my iPad?

    I cannot get my iCloud verified. I have received emails with a link to get it verified. When I tap on the link nothing happens. What should I do?