Copy tab contents to another tab

Hi,
I am designing a GUI application which has a JTabbedPane at the center. I have 2 tabs in the pane and i want the second tab to look same as the first one (i want to use the same components on the second tab too). In other words, i want them to be grafically the same. I do not want to duplicate code and create the same elements as in the first tab. How can i do this copying?

You can't have the same component added to different containers. A component has a single parent, and if you add it to a second container, it gets removed from the first. Try switching the order of the specified lines to see the difference when you add the button in a different order:
package sandbox;
public class ParentTest extends javax.swing.JFrame {
    private javax.swing.JButton button;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    public ParentTest() {
        initComponents();
    private void initComponents() {
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        button = new javax.swing.JButton("Hello");
        getContentPane().setLayout(new java.awt.FlowLayout());
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("panel 1"));
        getContentPane().add(jPanel1);
        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("panel 2"));
        getContentPane().add(jPanel2);
        // switch these two lines to see which panel gets the button
        jPanel1.add(button);       
        jPanel2.add(button);
        pack();
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new ParentTest().setVisible(true);
}

Similar Messages

  • I created a new layer and copied the contents of another layer into the new layer. Now whenever I ed

    I have a template that I am editing. I have created new layers by duplicating an existing layer. The problem I am having is that anytime I make a change to a duplicated layer it changes the original as well. ie if I attempt to edit the action script on the new layer it changes the action script on the original? It seems as though they are linked and I can not find a way to unlink them??

    You should be able to edit the immediately present contents of different layers without affecting other layers, but if you are editing anything at a level below the layer, such as doubleclicking to edit an object in that timeline, you are changing it anywhere it is used.

  • Copying tabs

    I want to be able able to copy tabs from one text box to another.
    The text in one text box is formatted with lots of different styles and I need to use the same tabs on another text box (lots of others). I cannot use a style sheet as we are coming in after design and there are none and we do not want to format all the text again.
    So is there a way to selct all the text in one box and just copy the tabs and then paste the tabs into antoher text box with out copying any other formatting. I remember there used to be a short cut in Quark to do this but I cannot find on in InDesign.

    You should be able to do this with the Eyedropper tool. Double-click on the Eyedropper. In Paragraph Settings, uncheck everything except Tabs. Uncheck all other attributes.

  • Copy a folder and all contents to another Mac

    I have a folder of other folders and albums. I would like to copy that folder and all of its contents to another Mac. So the other Mac will see it just like I do after the copy. Same folders and albums.
    I do not want to just move the library as that would destroy what is already on the other Mac. I just want to copy the folder and all its contents in one "transfer" to another iPhoto.

    Is this Folder in the iPhoto Window?
    Use iPhoto Library Manager to move Photos/Albums/Events and associated metadata between libraries
    Regards
    TD

  • To Copy the file content to another file and to delete the orginal file.

    Hi ,
    Can you pls let me know how i need to copy the contents of one file to other,
    For e.g   P_FL Consits of following records ( Assume that file need to created on application server)
      This is standard header ( header record)
    name  school class adreess ( item records)
    xyz     abc     1        kkkkk
    jjjj        cba     2       jkjkjkj
    uiui      cab     3       oioioioi
      i need to copy the above mentioned file contents( P-FL) into another file say P_NEWFL.
    so how i need to create this new file and how to copy the content of old file to new file.
    After copying the contents of old file to new file i need to delete old file.

    Sample code to implement this
    PARAMETER: p_file TYPE file DEFAULT 'd:\interface\In\barcoinbound2sap.txt',
               p2_file TYPE file DEFAULT 'd:\interface\In\backup_barcoinbound2sap.txt'.
    START-OF-SELECTION.
      OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      OPEN DATASET p2_file IN TEXT MODE ENCODING DEFAULT FOR OUTPUT.
      DO.
        READ DATASET p_file INTO line.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        TRANSFER line TO p2_file.
       IF sy-subrc NE 0.
         EXIT.
       ENDIF.
        SPLIT line AT ',' INTO lit_barco-prodnorder lit_barco-quant lit_barco-machtime lit_barco-duedate.
        APPEND lit_barco.
        CLEAR lit_barco.
      ENDDO.
      CLOSE DATASET p_file.
      CLOSE DATASET p2_file.
    dalete dataset p_file

  • HT1727 My old computer died on me with no warning signs. I didn't know or need to copy my music to another computer. I would like to know how to get the music that I bought onto my new computer without having to buy it all again.

    My old computer died on me with no warning signs. I didn't know or need to copy my music to another computer. I would like to know how to get the music that I bought onto my new computer without having to buy it all again. I just want to be able to get all of my music that I bought on itunes onto my computer. Right now the money ive spent is just gone and I have no music to show for it.

    Go to the iTunes Store and select "Purchased" from the Quick Links side bar on the right. Go through all the tabs to download again for free

  • Creating pdf files from word document and allow copying of content

    I generate word documents and then save them in PDF format before sending out to clients.  Sometimes these documents contain quite a lot of data in table format and I want my clients to be able to copy the data from the tables and be able to paste it into excel.  How do I save as PDF and still allow copying of content?
    Thanks

    Open such a PDF in Adobe Reader: File | Properties | tab Security.  It will tell you if copying is allowed or not.
    I don't know if you can change these security options from Word; you'll have to ask Microsoft.  To change them after the PDF was created, you will need Acrobat.

  • How to create a file and store its contents into another file?

    Hi,
    I'm having some trouble trying to create a code where I have to to create a file and store its contents into another file?
    I read the API, but I'm not certain how this file thing works.
    Here's my code so far:
    public static void main(String[] args) throws Exception
              File file = new File("tasks.txt");
              if (file.exists())
                   System.out.println("File already exists");
                   System.exit(0);
              Scanner scan = new Scanner(System.in);
              Scanner scan2 = new Scanner(System.in);
              //Scans the input line by line
              scan.useDelimiter("\\n");
              //Scans the input by tabs
              scan2.useDelimiter("\\t");
              PrintWriter outputs = new PrintWriter("newtasks.txt");
              outputs.print("ok");
              outputs.println(3);
              outputs.close();
         }

    I managed to change my text into uppercase, but how do I store the uppercase content into another file.
    -So this is what I did so far, I took a text file and modified its strings to uppercase.
    -Now I need to put those modified strings into another text file, is there a way where I can do that with my current code?
    -I already tried printwriter, but it doesn't seem to work
    public static void main(String[] args)throws IOException
              //Task[] oneHundredTasks = new Task[100];
              String uppercase;
              String combine;
              Scanner scan = null;
              FileInputStream in = null;
            FileOutputStream out = null;
            PrintWriter output = null;
            try
                 scan = new Scanner(new BufferedReader(new FileReader("tasks.txt")));
                 scan.useDelimiter("\\n");
                 scan.useDelimiter("\\t");
                while (scan.hasNext())
                     if(!scan.hasNext())
                          scan.next();
                     combine = scan.next();
                     uppercase = combine.toUpperCase();
                     System.out.println(uppercase);
            finally
                if (scan != null)
                    scan.close();
            //The program will try the input and output files
            try
                 in = new FileInputStream("tasks.txt");
                out = new FileOutputStream("newtasks.txt");
                int c;
                //The number "-1" is used to indicate that it has reached the end of the stream.
                while ((c = in.read()) != -1)
                    out.write(c);
            finally
                if (in != null)
                    in.close();
                if (out != null)
                    out.close();
         }

  • How do I copy one image onto another image?

    How do I copy one image onto another image?

    Lots of ways;  Use the Place command to place a file in another.  Open two files and drag one to the other's window tab, drag an image from bridge onto an open file.  Open an image, press ctrl/cmd-A to select all, the ctrl/com-C to copy the image, the ctrl/cmd-V to paste it into another image.

  • Copy its content to show on onother window

    Hello!
    The Problem I'm having is:
    A list of all orders is shown on a view which is defined
    for. Click on a special button opens a new Window
    (external window) and this window should show the same list like the privious view once more.
    With other words it must contain the same content. To do this is
    it necessary to perform the whole program again or can I copy
    its content for showing on the external window. I'm very confused.
    This external window acts as kind of preview of the list.
    Or do you have other suggestions?
    Thanks
    Sas Erdem

    Hi Sas,
              It is better to have 0..n if there is any table or else better to have 0..1;
    Say View1--is your first view
    View2 --is your print view in external window
    your first doubt:Now Copy this node to View2 and map them both.
    How can I map two views to eachother?
    List-- newly created context node 0..n;
    Procedure:
    Select and right click the node List in View1 -> Select Copy
    Open context tab of Controller-> Paste the node (If it is not there already)
    Open data modeler .Map View2 to Controller. Wizard appears. Copy and map the node(just drag and drop from right to left)
    Open context tab of View1
    Do you mean context tab from external window ?
    I guess it is clear now.
    Copy all the values into this node from respective nodes or attributes.
    When I copy all this values from respective nodes or attributes why
    copying this node to View2 again ??
    I mean to say: "What ever values you want to display in print view you need to copy to node List. These values are stored in this List you can display them in print"
    regards,
    Siva
    Edited by: Siva Rama Krushna on Feb 6, 2008 1:57 PM

  • Load content in another viewing space... Button..Viewer..Video..Panorama.. Carousel..Dreamw..Flash..

    Dear Reader,
    I made a site with a custom player to show video. I made my own buttons in Flash. On type showed while hovering over the played video and are used for controlling play/pause - button for homepage and two buttons for the next or previous gallery. The other type are underneath the playing video and let you pick thumbnails whose links were shown in the player window.
    First I wanted to use a carousel (Lee Brimelow) for the second type of buttons, but I couldn't integrate these with the rest of the player code (my flash-code knowledge is rather limited).
    Later on I wanted to show a panorama wich I only got to work with the Away3D-method. In this case I couldn't integrate it with any other code, so I used Dreamweaver to let a viewer choose thumbnails. One can navigate in the viewer window by dragging in the window, so I left out the other navigation buttons within the player window, mentionned earlier.
    Now I am thinking of this concept:
    - Button(s) for Homepage and (Next/Previous) gallery;
    - Viewer window, with
              - timeslider and Play/Pause button integrated in case of a video or slideshow;
              - dragging in case of a Panoramic view;
    - Carousel for picking a subject that will be shown in the Viewer window.
    Question:
    - Can I combine these 3 types of the concept as Flash-movies and buttons/carousel in Dreamweaver and still have the carousel control the viewer window?
    or:
    - Should I do all in Flash and make a personal Flashplayer (like I did before) and study more Flash?
    What tutorials could I take a look at? (For instance I found a lot of sites about how to make a carousel. I don't know how to make it control a viewer window (to make it load content in another window or space.)
    Greatings,
    Richafrost.

    Hi,
    Just wanted to clarify a few things to try and eliminate what could be causing the problem.
    1. You are using rtmps protocol. Do you have SSL certificate configured and port 443 enabled?
    2. When you tried playback via the hosted OSMF player was it via rtmps?
    3. The standard way the request url is protocol://server-domain-or-IP/fms-app-name/[fms-app-instance-name/][codec-prefix:]file-pa th[filename-extension]. Could you try with that?
    I tried to reproduce your issue with simple rtmp prtocol and here are my observations/suggestions :
    1.When I first entered the source url I got the error you mentioned : "The video player is in the connection error state." However, when I publish the same .fla again it works fine.
    2. When you are placing the on a computer on the same network and running the html in the browser, it might not have permission to access the network. You will generally get a pop-up saying "Flash Player has stopped a potentially unsafe option". In any case, in your Flash player settings manager you can go to the Advanced tab and add the location of the folder containing the swf as a Trusted location and then try to reload the page again. I get the "status bar spin" when the folder did not have permissions.
    3. Also, when you try playback via Share Point can you go back to FMS and check if a connection request has actually come to the server. You can check under the access logs in root_install/logs or the application logs under root_install/logs/_defaultVHost_/vod/
    Please let me know if this helps.
    Thanks,
    Apurva

  • How to get(copy) the contents i.e the cell of an excel sheet to other excel

    How to get(copy) the contents i.e the cells of an excel sheet to another excel sheet.
    I can read the contents i.e the text in the cells and able to display it in the Java console
    i want these contents to be copied to another excel sheet with the cells data.
    I am using Java Swing for the UI, POI framework for the excel work.
    Please anyone suggest some code to this requirement.

    [spreadsheets with poi|http://poi.apache.org/spreadsheet/converting.html] Hi
    on the poi apache site there's a number of good examples...
    I started with poi only a week ago, but just from reading these examples
    (especially SS Usermodel code) i managed all i needed to know (so far).
    kind regards
    BB
    Edited by: BugBunny on Feb 22, 2010 4:36 AM

  • Translation of English content into another language in Life an work events

    Gurus,
       I am trying to setup life and work events for various countries. We have "before you start" HTML pages for all the different countries we are implementing the life and work events and each country has its own language. Now, my question is to find out if the content should be manually coded in each country's native language or is there any translation mechanism that can be used within the life and work events of the ESS to translate the English content to another language?
    I also noticed "Add translated resource" inside the "Create Content Package object". I dont know, if this can serve my purpose. Could anybody please suggest how the translation of content can be achieved?
    Thanks,
    Maria Kutty Somori.....

    MariaKutty wrote:
    What is the best practice or approach for copying the standard portal ESS content and home page config for various countries that SAP does not deliver as a standard?
    Refer to SAP note 936179
    http://wiki.sdn.sap.com/wiki/display/ERPHCM/HowtoReuseCountryspecificapplicationsforMolga99
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30b0b66f-3a3d-2c10-4aa3-f53ee3299bb3?quicklink=index&overridelayout=true
    MariaKutty wrote:
    Is there any translation mechanism inside the portal content directory for translating the SAP content to multiple countries
    No you will have to manually create iViews for new countries....
    Maria...it works like this..
    1.. First to select which country structure suits most your requirement...
    2... You reuse that country structure and create services specific for your country...
    e.g. You reused structure of US Address Data to create a service for Polland Address Data....
    3... Now if required you can create an application specific to your needs in NWDI specific to your service...(If enhancements are required)
    4... Create an iview in PCD....for this you can copy the existing iview for the country that you reused in step 1...
    i.e. Copy US address data service and paste it with name Poland address data....Update its "application name" property with new web dynpro application name you defined in step 3...
    Wotever above is written is not specific to LWE....
    For LWE you need to go through an additional step :
    http://wiki.sdn.sap.com/wiki/display/profile/LifeandWorkEvents(LWE)-Other+Countries
    Edited by: Saurabh Agarwal on Jul 3, 2011 7:54 AM

  • Is there an application that will copy the content of a usb secretly?

    for example if i plug in a usb to my computer. and i want to copy all of it's content. without telling it to anything.
    and another that will speed up copying the content of a usb?

    One thing that might work is Mountwatcher...
    http://www.scriptsoftware.com/mountwatcher/
    And a Script to copy if needed.
    My favorite, Tri-Backup...
    http://www.tri-edre.com/english/tribackup.html
    can do this using the Trigger this action when Volumes Mount.

  • Copy layer content between InDesign files

    Hello,
    I'm trying copy layer content between 2 files, the sources file is a Spanish version of a training manual and the target is an English version. Essentially making a single multiple language file out of two single language documents.
    I'm not well-versed in scripting.
    Thanks

    Hello Again Steve,
    Perhaps if I shared a bit more detail.
    We began with an English version. All content was placed on layer 1. At the time some of the manuals were created there was no thought of needing multiple languages.
    These files had their one layer with all placed graphics and text renamed English. The Idea was all the graphics that have text embedded in them have been edited to add the second language onto a new layer in the graphic files. (Many of the manuals share graphics between them, so a common links folder was used to maintain the library of images. The graphics files have an "art layer" and "English" layer and a "second and in some cases a third language layer added.)
    In InDesign the English layer was to be duplicated (duplicating both the graphics and the text) The text was then exported out as tagged type and translated into the second language and was to be flowed back in to the second language layer. InDesigns layer overrides would be applied to each of the duplicate images to turn off the English text layer and turn on the second language layer. One copy of all the graphics and one InDesign file containing each language layer with it's appropriate layer overrides.
    To print the thought was to turn of the language layer visibility you didn't want and turn on the language layer you did want.
    I hadn't anticipated the translation company would override the request to perform the translations in this manner and provided a single language file back instead.
    I thought it was an efficent system. A single copy of each manual to deal with and single graphic files in a common library to be maintained. At some point e-publishing is being considered and I thought one e-book with all the languages in it could be created and within the e-reader the appropriate language could be enabled. Eventually, I anticipate, and hopefully prior to the e-book effort, we will be upgrading to CS5.5 to take advantage of it's enhanced e-pub features.
    Like I said, I am new to this multiple language publication process and imaged the workflow to do the job rather slickly. Rather then having sequential languages one after another in the same book the languages would take advantage of the virtual Z dimension.
    Fewer files to maintain, if a change was made to the english version the change could be made to all language layers on the same page.
    Given your extensive experience I'd be interested in entertaining the pros and cons of sequential verses layered multlingual files. Seemed more efficient to duplicate the text in this manner then to duplicate all the graphic files. In some cases the manuals we are working with are so old (but not outdate) as to not even have digital versions. It's a big project and management within the company doesn't always think very far ahead. I'm attempting to develop a "plan" and not certain nor convinced it is the most appropriate so your advice and opinion would be recieved with great consideration. I haven't found a whole lot of resources regarding multilingual publishing. The project was sort of "thrown" at me and at the moment it's rather difficult to determine if I'm sinking or swimming. My head goes underwater but I could be doing the butterfly and that's suppose to happen.
    Right now language needs are limited to the languages with land masses attached to ours North Central and South America. International Spanish was one choice, rather then having to support each dialect. That will likely change in the upcoming years but I know of no plans when.
    Thanks again,
    Mark

  • I accidentally copied the contents of my iPhoto to my desktop (6,000  photos). How do I undo this action?

    I accidentally copied the contents of my iPhoto to my desktop (6,000+ photos). How do I undo this action?

    Open a finder window, go to 'Macintosh HD/Users/<user folder>/Desktop'.  You can delete all the items from there.  If you had other stuff on your desktop you need to keep, then you could either sort the files by type, or copy the contents of the folder to another location, delete the desktop folder contents, then move back into it what you want to save.

Maybe you are looking for

  • Selection screen fields in SAP Query

    HI friends, I have to make the seletion screen field as mandatory in SAP-Query. Please let me know the procedure to make field as mandatory or Let me know how to validate the selection-screen field in Query. Thanks in Advance, Ravi

  • Font Explorer alternative for PC?

    Is there a Font Explorer alternative for the PC?  Yes, I know Linotype made a beta version of Font Explorer for the PC that they never finalized - its useless.  Anybody have any preferably free font library programs for the PC?  Thanks.

  • Applying formatted search to checkbox

    I want to set the Payment Block checkbox on AP Invoice automatically when a new invoice is created. I tried to do it with a formatted search, but you cannot apply a FMS to a checkbox field. Is it possible? B1 version 2005A SP01 PL18. Regards, Douglas

  • Hide amount column in KB21N

    Is it possible to hide the "amount" and "currency" information in KB21N? I've tried screen variant and authorization. Both don't work here. Can anybody help me on this issue? Thanks~

  • Photo - Edit in - Open as Layers in Photoshop

    Photo -> Edit in -> Merge to Panorama in Photoshop Photo -> Edit in -> HDR Pro in Photoshop Photo -> Edit in -> Open as Layers in Photoshop are all dimmed.  How do you un dim them??