Purpose of getContentPane()

what is the purpose of method: getContentPane()
like:
JButton btn1=new JButton();
JPanel panel=new JPanel();
add(btn1);
getContentPane().add(panel);

it gets the underlying container's (usually the JFrame or Window)
"content pane" :
content = "stuff"
pane = "place to put stuff"
you can also use
frame.setContentPane( panel )
google "java jframe"
and take the time to read the java documentation

Similar Messages

  • Using getContentPane() in JFrame class

    Hello,
    I'm reading Bruce Eckel's book.
    In chaapter 14, I read TextArea.java.
    My question is:
    What is the purpose of getContentPane() in the constructor TextArea() in the code below ?
    Isn't JFrame IS a Container ? why bother to get another Container ?
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.util.*;
    import com.bruceeckel.swing.*;
    import com.bruceeckel.util.*;
    public class TextArea extends JFrame {
    private JButton
    b = new JButton("Add Data"),
    c = new JButton("Clear Data");
    private JTextArea t = new JTextArea(20, 40);
    private Map m = new HashMap();
    public TextArea() {
    // Use up all the data:
    Collections2.fill(m, Collections2.geography,
    CountryCapitals.pairs.length);
    b.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Iterator it = m.entrySet().iterator();
    while(it.hasNext()) {
    Map.Entry me = (Map.Entry)(it.next());
    t.append(me.getKey() + ": "+ me.getValue()+"\n");
    c.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    t.setText("");
    Container cp = getContentPane();
    cp.setLayout(new FlowLayout());
    cp.add(new JScrollPane(t));
    cp.add(b);
    cp.add(c);
    public static void main(String[] args) {
    Consoleb.run(new TextArea(), 475, 425);
    }

    I appreciate the reply.
    There are endless API to read.
    I found this:
    For conveniance JFrame, JDialog, JWindow, JApplet and
    JInternalFrame, by default, forward, by default, all
    calls to the add, remove and setLayout methods, to
    the contentPane. This means you can call:
    rootPaneContainer.add(component);That was introduced in 1.5. May people still use older versions of Java, so use that add method with caution. I myself see no reason to use it, since it is a bit of a hack.
    Another question on the side:
    How can I remove a topic that I created ?Like karma, no thread ever goes away :-)

  • Using multiple apple id's for different purposes

    We are a family of 4 with numerous devices. Here's the setup we've been using to manage different aspects of our apple life!
    Each of us has an individual apple id, which we use on our individual devices for storage/backup, photo stream, facetime, calendar etc
    We have one apple id, used on all devices for all app store/itunes purchases
    We entered this id on each device with everything turned off except "find my iphone". This way we could be logged into the find my iphone app with one id and be able to see all our devices.
    This has worked really well for us as a family. Well, yesterday my kids updated their phones (one 5 and one 4s) to ios 7. I have not done it yet. It does not seem to allow for the above setup, specifically where "find my iphone" is concerned. When I enter in that specific apple id as an additional icloud account, it doesn't offer the option of find my iphone. My ios 6 device says "only your main account can use photo stream, documents & data, and backup". Their device adds "find my iphone" to this list.
    Does anyone know if this is a specific change apple made, or something that went wrong when initially setting up their updated phones.
    TIA!

    Thanks for your reply. But what I don't understand is, can I no longer have multiple icloud accounts, to be used for different purposes? Like I said, we have been using one apple id/icloud for storage etc and one for find my iphone.

  • While defining a columnar table, what is the purpose of column store type

    Hi folks
    I have two questions related to columnar table definition.
    1. What is the purpose of column store type.
    While defining a columnar table, what is the purpose of column store type (STRING ,CS_FIXEDSTRING,CS_INT etc) , when I define a table using the UI I see that the column is showing STRING but when I goto EXPORT SQL it does not show.  Is this mandatory or optional ?
    2.VARCHAR Vs. CHAR - In the UI when I create the table I do not see the CHAR option , but I do see lot of discussion where people are using CHAR for defining the columnar table. Not sure why UI dropdown does not show it. I also read that we should avoid using VARCHAR as those columns are not compressed, is that true, I thought the column store gives compression for all the columns. Are there certain columns which cannot be compressed .
    Please let me know where I can find more information about these two questions.
    Poonam

    Hi Poonam
    the CS_-data types are the data types that are used internally in the column store. They can be supplied but it is not at all required or recommended to do so.
    SAP HANA will automatically use the correct CS_-data type for every SQL data type in your table definitions.
    To be very clear about this: don't use the CS_-data types directly. Just stick to the SQL data types.
    Concerning VARCHAR vs CHAR: fixed character data types are not supported anymore and don't show up anymore in the documentation.
    I have no idea why you believe that VARCHAR columns are not compressed but this is just a myth.
    create column table charcompr (fchar char(20), vchar varchar(20));
    insert into charcompr (
        select lpad ('x', to_int (rand()*20), 'y'), null from objects cross join objects);
    -- same data into both columns
    update charcompr set vchar = fchar;
    -- perform the delta merge and force a compression optimization
    merge delta of charcompr;
    update charcompr with parameters ('OPTIMIZE_COMPRESSION' ='FORCE');
    -- check the memory requirements
    select COLUMN_NAME, MEMORY_SIZE_IN_TOTAL, UNCOMPRESSED_SIZE, COUNT, DISTINCT_COUNT, COMPRESSION_TYPE
    from m_cs_columns where table_name ='CHARCOMPR'
    COLUMN_NAME    MEMORY_SIZE_IN_TOTAL    UNCOMPRESSED_SIZE   COUNT   DISTINCT_COUNT  COMPRESSION_TYPE
    FCHAR       3661                    70285738            6692569 20              RLE
    VCHAR       3661                    70285738            6692569 20              RLE
    We see: compression and memory requirements are the same for both fixed and variable character sizes.
    - Lars

  • I buy adobe creative suite for teachers and students about one year ago but now i'm not longer a student. Can I still use this programs legally for commercial purposes or do I have to buy some upgrades or something like this? Please help

    I buy adobe creative suite for teachers and students about one year ago but now i'm not longer a student. Can I still use this programs legally for commercial purposes or do I have to buy some upgrades or something like this? Please help

    The license did not have use restrictions Licenses and terms of use | Adobe
    BUT... when your one year Education account ends, I do not think you will be able to renew at the Education rate

  • I need Expert Decomposition of classes in Source Code for my reaserch purpose. Any body can help me in this regard?

    <blockquote>Locked by Moderator as a duplicate/re-post.
    Please continue the discussion in this thread: [tiki-view_forum_thread.php?comments_parentId=698286&forumId=1]
    Thanks - c</blockquote>
    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    I need Expert Decomposition of classes in Source Code of Firefox for my research purpose. Any body can help me in this regard?
    == This happened
    ==
    Not sure how often
    == Firefox version
    ==
    3.0.19
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.19) Gecko/2010031422 Firefox/3.0.19
    == Plugins installed
    ==
    *-Default Plug-in
    *RealPlayer(tm) LiveConnect-Enabled Plug-In
    *6.0.12.1662
    *Office Plugin for Netscape Navigator
    *Google Update
    *Shockwave Flash 10.1 r53
    *Yahoo Application State Plugin version 1.0.0.7
    *Next Generation Java Plug-in 1.6.0_18 for Mozilla browsers
    *Adobe PDF Plug-In For Firefox and Netscape
    *DRM Netscape Network Object
    *Npdsplay dll
    *DRM Store Netscape Plugin

    Please let me tell you that I Expert Decomposition may be of any Version of Firefox or Thunder Bird.

  • Have CS5 and CS6.  Need to reduce size of file from 6Mb to 2 Mb for contest purposes without losing original

    Have CS5 and CS6.  Need to reduce size of file from 6Mb to 2 Mb for contest purposes without losing original

    Just save the document to a new jpeg file name using a lower quality setting or re-size the image down in  size the save a high quality smaller new jpeg image.

  • PLEASE: How can I save my iphone texts and "notes" (not "the note") to my computer? I need them for reference and legal purposes. I have yet to find an app for this and iphone doesn't sync either one.

    Greetings!
    I am brand new to using a Support Community -- I'm more of a in-person show me learner but...huge snowstorm and I don't want to
    to make an appointment at a Genius Bar, driving 15 miles, especially since I asked about this once before  and no one there was able to
    give me an "official" Apple answer .  I do hope I am posting my question (and plea) for help properly.
    LOL when I had my first lil' Mac Classic, over 20 years ago, my participation in the techno world was soooo much easier, simpler.
    My current situation: I have soooo many texts on my iphone and I haven't deleted many because I need the information contained in them for
    future reference and for legal purposes.  I would really like to find a means and way to save them other than on the phone itself.
    I've done searches for various apps yet I'm not finding what I think I would need.  It appears Apple does not sync the texts between the iphone and
    my MacBook Pro.
    Also I often use Notes for quick journaling as well as copy and pasting from other apps, usually inspirational, that I know I am going to want
    to read again (always with credit noted ) and these too are taking up space.  If I could email myself I would but the apps I'm using don't offer that and each day there is a new commentary -- no way to go "back".
    I am currently using OS 10.6.8 on my MacBook -- my disc drive doesn't work and upgrading has to be done at the Apple Store so I don't have iCloud yet.
    My iphone 4  is running OS 6.0.1 -- no upgrade until I'm at a wifi connection -- most of the time I'm using my personal hotspot.
    I'm a very busy self-employed Nana raising grandchildren and a great-grandchild.  I don't have a lot of time and certainly not enough for copying and pasting every text as well as note and emailing it to myself.  There has got to be a better, easier way, yes?
    I'd be most appreciative of any and all assistance here.  Oh, someone mentioned to me I ought to get a "stick" for downloading but were talking
    in a language I'm still learning. 
    Thank you!
    Melinda

    SkyDaughter29 wrote:
    My current situation: I have soooo many texts on my iphone and I haven't deleted many because I need the information contained in them for future reference and for legal purposes.  I would really like to find a means and way to save them other than on the phone itself. I've done searches for various apps yet I'm not finding what I think I would need.  It appears Apple does not sync the texts between the iphone and my MacBook Pro.
    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php
    Best of luck.

  • I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008.

    I am trying to integrate simulink model (.mdl) file with SIT of Labview for RCP and HIL purpose. I am using Labview 8.6, Simulink 6.6 with RTW 6.6 and RTW embedded coder 4.6 ,Visual C Express 2008 and Visual C++ Express 2008. I have selected system target file as nidll.tlc,make command as make_rtw and template nidll_vs.tmf. When I try to generate .dll file I get the following error.
    Attachments:
    SITProblem.JPG ‏101 KB

    Hi,
    No . I could not solve the issue. Presently we are using microautobox (from Dspace)for doing the RCP.
    Himadri 

  • I am trying to edit my website which was composed in iweb. I have my website saved on my hard drive. When I open iweb, I can't seem to load the website folder into iweb for editing purposes. Anyone know a quick solution to this?

    I am trying to edit my website which, was composed on iweb about 2 years ago. I have the website stored on my hard drive. When I open iweb, I can't figure out how to load the website into iweb for editing purposes. Any help would be greatly appreciated! Thanks

    You need to migrate to a modern, supported webpage development application and leave iWeb behind.  It hasn't been supported for 2 years now and was behind the curve feature wise when it was dropped by Apple.
    One app that many have migrated to because it is very similar to iWeb in the GUI and features is Everweb.  It has a demo version that you can try.  Text and photos from you current published site can be copied and pasted into Everweb to help the migration over.
    There are other possible candidates.  Just search the iWeb forum for "iWeb alternative" or "iWeb replacement" to get a list of topics discussing them.

  • I am having trouble trying to get my address book from my mac (just downloaded Lion for this purpose) to my 3G ipad. Set up an icloud account but still confused! Please help !

    I updated my mac with  os x Lion so that I could accomplish moving my address book from the mac to my new IPad 3G. I also set up an icloud account for this purpose, but I *still* cannot figure out how to move my address book from one computer to the other. When I'm on my mac and try to use bluetooth to export the address book, I'm able to find my ipad but I soon get a message that it does not support the necessary services. I have no idea what's going on and would appreciate any advice. tks in advance, Sarah

    blacksheepfibers wrote:
    I updated my mac with  os x Lion so that I could accomplish moving my address book from the mac to my new IPad 3G. I also set up an icloud account for this purpose, but I *still* cannot figure out how to move my address book from one computer to the other. When I'm on my mac and try to use bluetooth to export the address book, I'm able to find my ipad but I soon get a message that it does not support the necessary services. I have no idea what's going on and would appreciate any advice. tks in advance, Sarah
    The address book syncs via iCloud, not Bluetooth or iTunes.
    You upgraded to Lion so you could use iCoud.
    On the computer. go to Apple menu > System prefs > iCloud.
    Sign into your iCloud account.
    Tick everything.
    This enalbes the se items syncing to iCloud.
    On the iPad, Settings > Mail, Contacts, Calendars.
    Create a new iCloud account.
    Sign in with the same AppleID as your computer.
    Settings > iCloud and turn everything on.
    BAM!
    That is all you need to do.
    Your contacts (and all other checked items checked) will sync between computer and iPad.
    No need to use iTunes

  • Purpose of AP_INTERFACE_CONTROLS in the payables open import program.

    Hi,
    Can anyone explain the purpose of the table AP_INTERFACE_CONTROLS in the payable open import program.
    Regards
    Deepak

    Hello Deepak.
    AP_INTERFACE_CONTROLS is a temporary table that holds control information about segregated data in the AP_INVOICES_INTERFACE table during the Payables Open Interface Import. The table ensures that each import must be unique with respect to the combination of SOURCE and GROUP_ID. This allows the submission of multiple imports at the same time.
    Your Oracle Payables application deletes the information from this table when you complete an import.
    Octavio

  • Purpose & usage of t.code MR11(Maintain GR/IR Clearing account)

    Hi All,
    Could you pls let me know the Purpose of the T.Cde MR11(Maintain GR/IR Clearing account) and how do we use it.
    Is that only to verify and post the valiances between GR & IR.
    Rquest for quick help as we have user training tomorrow.
    thank you
    Chandu

    MR11 is used to clear quantity difference between GR and IR.
    Some time we may have delivery surplus or Invoice surplus this lead to credit or debit balance in GR/IR account for specific PO.
    For e.g. you have PO for 10 quantities at price RS 100 per Unit.
    You received GR for 8 Quantity and invoice for 10 quantities.
    GR/IR account has Debit balance for Rs 200 because of above business scenario. Suppose after few days or months you realize that vendor is not going to send remaining 2 quantities for which you have already invoiced and paid.
    Now you clear GR/IR account through MR11 by updating the stock value if there is enough stock coverage to the value of 200, if there is no enough stock coverage then difference is posted to price difference gain or loss account.

  • MM(PO) :: Not purpose any info record when PO creation

    Dear Expert,
             I have the problem with PO creation. Our user required to not purpose any info record information when create PO.
    Because they want fresh blank PO. I don't know how to do to not activate any info record. Please advise.
    Thank you in advance ^^

    Hi,
    If you want to delete the info record, you can set the deletion indicator with ME15  or if you want that after PO the info record should not get updated in the PO at item level in material data de-select the check box info update.
    regards,
    zafar

  • I imported some 24P HD videos from my DSLR to Aperture but these videos do not show up in iMovie '09 for editing purposes. Although my previous 24P HD Videos from iPhoto '09 show up. Why can't I access these videos stored in Aperture library?

    I imported some 24P HD videos from my DSLR to Aperture but these videos do not show up in iMovie '09 for editing purposes. Although my previous 24P HD Videos from iPhoto '09 show up. Why can't I access these videos stored in Aperture library? I assumed that like  the videos in iPhoto, I would be able to access the videos in Aperture through iMovie. Come on Apple! I am starting to get frustrated with your products here. And this is saying a lot when I have been using and loving apple products for the last 4 years.

    Hi. My camera is a Canon 600D. And yes my videos are stored in the Aperture library and they are not referenced. Even then I tried to select all the videos in Aperture and clicked 'consolidate masters' and there was a messge that said all 'none of the files are referenced',... so they didn't need consolidating.
    I also tried preferences> export> external video editor > choose > iMovie. And then right click on the video to edit with imovie. Even then the video didn't show up in iMovie. It seems like the only option for me is to import the videos directly to iMovie which means there will be two versions of the same file stored in my computer eating up space.
    APPLE. What are you doing?

Maybe you are looking for

  • Videos default to movies folder

    can any1 help when i put movies into my ipod 160 classic they all go to the movies folder i would like to have some go into music videos , some into tv shows and such is there a way to move this over to each selected folder

  • Report with double aggregation

    Hello I need to produce the following reports : Material Group Counter MG1                    12 MG2                    30 The counter counts the numbers of materials of respective material group whose sales are higher than value entered by user. The

  • External web services deployment

    Hi, I am facing a situation of web services deployment. I am using Jdeveloper 10g and oracle bpel process manager 10.1.3.1.0. I am not able to deploy web services. The following are the steps that I followed to consume that web service called web ser

  • Best Approach to create Security / Authorization Schema for an APEX Apps

    Hi, I am planning to create a Security / Authorization Schema for an APEX Application. Just want to know what is the best approach to create the security feature in APEX, so that it should be re-used in other APEXApplications too.. I am looking for f

  • Connecting ipad 2 to Bluetooth sound bar

    How do you connect Ipad 2 to a Bluetooth enabled sound bar? The Ipad has a Bluetooth icon but it never discovers any devices.