Simple Question: JList and JDesktopPane in the same Swing app?

Hi,
I'm really inexperienced with Swing and so have hit what I think is quite a simple problem that I hope someone here can help me with.
I have a class Frame which extends JFrame, I would like to have it contain a JTree running down the left hand side, with the rest of the JFrame taken up by a JDesktopPane. I have sorted out the code for both the JDesktopPane and the JTree independently, and can get them displaying on their own, but how can I display them side by side?
I have a feeling that I have to use some layout manager of some sort and add the JTree and JDesktopPane to it, then add the layout to the JFrame or something but as you can tell I'm a little lost.
I hope that this is a simple problem, it certainly seems quite fundamental and so I hope that someone can help!
Thanks in advance
Richard

JFrame by default has a BorderLayout Manager
so to add these two componets for the center one add it as usual, but for the other u have to add it
JFrame.getContentPane().add(instance, BorderLayout.WEST);
or any one of three other values.
hope this is what u ask about

Similar Messages

  • Simple Question - attribute alternative text within the same Word doc

    ok. I am having a brain freeze and can't locate the answer in the OPA help. Simple question.
    Is there a simple way to alias an attribute for use in Word?
    For instance the following two conclusions create 2 attributes where I only want 1 attribute.
    the annual percentage rate = 6
    APR = the annual percentage rate
    Is there a configuration option or something to alias APR as the annual percentage rate for use in Word? I want to use either in the same Word document. Something in my head tells me I saw that once before, but all of a sudden I have a brain freeze.
    Sorry for such a simple question, but sometimes I get too deep in the weeds.

    Hi Paul,
    You may be thinking of the OPA legend style. In the Office 2007 OPM ribbon it's called Table Legend, but I believe it works with non-table rules in Word as well - it certainly used to.
    It's an OPA rule style which can be used when you want to refer to a shorthand version of an attribute, e.g. "APR" instead of "the annual percentage rate". I believe it only applies to the rule immediately below where it has been set in the doc, and not the entire doc.
    I did a quick search in the OPM Help and found references to the legend style, but I didn't find a description of the functionality (I didn't search too thoroughly though).
    Here basically how it works...
    Above the rule write the shorthand version, then the word "is", then the full attribute text, e.g.
    APR is the annual percentage rateSide note: I always bold the "is" in the legend line. This is not required, but I like to do it because it makes it clearer at a glance which part is the shorthand and which part is the full attribute text.
    Then apply the Table Legend style to the line, then put your Word table or regular rule below it, e.g.
    [legend]APR is the annual percentage rate
    the result = APR * 10 I use this functionality occasionally. Usually it's when I've got calculations in Word tables and I'm trying to make the left hand column more readable, e.g. using something "APR" in the formula so that it doesn't take up so much space.
    Cheers,
    Jasmine

  • TS1277 it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    it says apple mobile device fails to start i do not have sufficient priveledges..... this was after i updated my i tunes so i unistalled i tunes and reinstalled but the same question  persists

    Hi annibu757,
    If you are having issues with iTunes after an attempted update, you may find the following article helpful:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Regards,
    - Brenden

  • Airtunes AND ethernet at the same time?

    Aloha All,
    I think I have a simple question.
    Providing I use the WDS option, which requires either a AEBS or a WRT54G router, can I simulatenously run airtunes AND use the ethernet port (not wireless) on my AX?
    I would like to use my AX to supply my non-wireless PC tower with internet, while continuing to use the same AX for airtunes, without buying another AX. I currently do not have either an AEBS or a WRT54G, but am willing to buy one of those...
    Any thoughts?
    Thanks,
    ccolgrove

    Yes that is possible.

  • My wife and I share the same iTunes account.  How can I setup a separate account for her iPhone using my iMac?

    My wife and I share the same iTunes account. How do I setup a separate account for her? Can I do it using my iMac?
    Thanks

    Using More than One iDevice on the Same Computer
    This applies mainly to couples who are adding another device and do not want their email, messages, etc. being duplicated on both devices. To begin read: How to use multiple iPhone, iPad, or iPod devices with one computer. You need to establish a separate Apple ID and password for whomever will use the new iDevice. See Apple - My Apple ID and Frequently asked questions about Apple ID. The easiest way is to do this on the computer using iTunes: iTunes- How to set up an Apple ID within iTunes.
    On the computer create a new user account for the person with the new iDevice. This will be the user account that person will always use. He/She will no longer use the other user account. This way that person will have a separate iTunes Library
    Start by transferring the new device(s) to a new account along with all your data.  Save any photo stream photos that you want to keep to your camera roll (unless they are already in the camera roll) by opening your Photos app, tap on Albums icon at the bottom. Now, tap on My Photo Stream album; tap Select; tap on the photos you want to select;, tap the share icon (box with upward facing arrow) in the lower left corner; then tap Save to Camera Roll.
    If you are syncing notes with iCloud that you want to keep then you need to open each of your notes and email them to yourself. Later you can copy and paste the text into new notes created in your new account.
    Tap on Settings > iCloud > Delete Account (only deletes it from this device, not from iCloud; the person keeping the current account will not be affected,) provide the password to turn off Find My Phone and choose Keep on My iDevice when prompted.  Sign in with a different Apple ID to create your new account. Choose Merge to upload your data.
    Once you are on separate accounts, you can each go to icloud.com and delete the other person's data from your account.
    Note: The essence of the above was created by user, randers4. I
    have made substantial changes to improve readability and syntax.

  • Recording Audio and Midi at the same time in Logic 7 Express Can it be done

    I am wondering if I can record audio and midi at the same time in Logic 7 Express. I am running my guitar thrugh a Roland GR 33, and a line out and using the GR 33 to trigger sounds in the Logic's synth section but cant seem to record all three tracks at once. If any one knows how let me know. Oh and I am running the GR Synth and Guitar into the Prosonus Fire Fox and have the GR 33 out midi to the Fire Box as well. So I guss the question is how do I sent up two audo tracks and one midi track to record in real time. Thanks Victor

    I am wondering if I can record audio and midi at the
    same time in Logic 7 Express. I am running my guitar
    thrugh a Roland GR 33, and a line out and using the
    GR 33 to trigger sounds in the Logic's synth section
    but cant seem to record all three tracks at once. If
    any one knows how let me know. Oh and I am running
    the GR Synth and Guitar into the Prosonus Fire Fox
    and have the GR 33 out midi to the Fire Box as well.
    So I guss the question is how do I sent up two audo
    tracks and one midi track to record in real time.
    Thanks Victor
    Try arming the audio tracks, select one of the tracks, then while holding down the shift key, select the midi track you want to record, arming the "r" on the midi track. Press "record".....
    HL

  • Designer 6i and 10g on the same machine?

    I have Designer 6i and corresponding repository on my machine.
    The problem with 6i I can't save diagramm in HTML format
    I believe I can save in HTML format in 10g or other?
    Can I install on the same machine 10g designer?
    should I configure new repository?
    TIA

    See my update on your earlier question.
    As for running 6i and 10g on the same machine, yes you can do it. You just have to install them in separate Oracle Homes, and be careful when you tell them which version of EXP and IMP to use. There is one MAJOR caveat, however. They cannot use the same Designer Repository - 6i client won't talk to a 10g repository and 10g client won't talk to a 6i repository. You can upgrade a 6i repository to 10g with the RAU, but take a backup before you do - the only way to go back is to restore your backup. Besides, I think that if you upgrade to the last supported version of Designer 6i (you should be able to get it from MetaLink) you will get the Publish Diagrams utility.
    Frankly, my opinion is that there is only one reason to stay on 6i - if you need to generate and support 6i client/server Oracle Forms. If you don't use Oracle Forms, or if you have moved on to Web Forms with the middle tier Forms Server, I'd recommend an upgrade to Designer 10g and Developer 10g.

  • HT204053 What are the pros and cons of 1) choosing to use the SAME Apple ID for iCloud services on one side, and purchases on the iTunes Store, App Store, and iBookstore, on the other side; or 2) to have and use two separate Apple Ids for these "two sides

    All is in the title, so I repeat it below with a better identation.
    What are the pros and cons of
    1) choosing to use the SAME
                                                  Apple ID for iCloud services on one side, and
                                                  purchases on the iTunes Store, App Store, and iBookstore, on the other side; or
    2) to have and use two separate Apple Ids for these "two sides"?
    P.S.
    I have loads and loads of free podcasts in iTunes in my iMac, that are certainly more thant the 5 gigas the iCloud provides for free, so I don't want those to go to the cloud. But this is perhaps a different question...
    Also need to mention that I have itunes on a mac, a pc and an iphone.
    Sorry to look so silly with this question, but I don't get the "big picture".

    You need to create a user account for your wife (or yourself depending on who has the current user account). When syncing, each of you should sign in as a separate user, login to iTunes and then sync. I had this problem when my sister got an iPhone. When we did her initial sync, everything on my iPhone showed up on hers. Apple gave me this solution.

  • I have two devices (Iphone and Ipad) on the same Apple ID. When I go to Icloud and click at the "find Iphone" I see only one of my devices. How can I do to see both of them?

    I have two devices (Iphone and Ipad) on the same Apple ID. When I go to Icloud and click at the "find Iphone" I see only one of my devices. How can I do to see both of them?

    Obvious question, but have you got 'Find My iPhone' set on both devices?  Settings>iCloud>Find My iPhone.

  • HT2204 I have 3 iphones and all use the same apple ID,how do I change this so each phone has its own id,do i restore the phones to factory settings first??as im having problems with contacts being added to and deleted from each phone.

    I have 3 Iphone 4S and all have the same apple ID which is causing problems as far as contacts are concerned,when i sync 1 of the phones to my comp the contacts appear on all the phones.How do i create a new ID for each of the phones do I have to reset the phones to factory settings first,any help would be appreciated.:)

    Hello marie196,
    Thanks for the question, and welcome to Apple Support Communities.
    You do not necessarily need to restore the device to factory settings, but rather sign out of the four services that utilize your Apple ID: iCloud, iMessage, FaceTime, and iTunes & App Stores. Once signed out, you can sign in with a new Apple ID. For more information, see the following article:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/HT4895
    Additional Information: You may encounter an error regarding a 90-day limit. For information on this, see the following article:
    iTunes Store: Associating a device or computer to your Apple ID
    http://support.apple.com/kb/HT4627
    Thanks,
    Matt M.

  • HT201077 my daughter and I share the same apple id but can we have separate photo stream

    My daughter and I share the same apple ID for music and apps. Is there any way for us to have separate photo streams. We do not want to share photos.

    Hi
    I also have 2 iphones (mine and my wifes), all on ONE iTunes ID and ONE iCloud ID.
    I want to backup our photos only automatically to my Windowns 7 PC using Photostream & iCloud from both devices BUT I dont want her photos on my phone and vice versa.
    I too would like to keep 1 iTunes account and because I dont  want her photos streamed to my phone I will create separate iCloud IDs.
    My question is.....
    Can I set up my iClound control panel in Windows to backup photos from BOTH the iCloud IDs on the 2 phones?
    I dont mind the backups going to the same folder on my PC, but I do want to keep the pics on the phones separate.
    (also I am happy to use 3rd party software or manual options if not possibe with Apple products)

  • How do I read and write on the same CAN Port

    I have a PXI chassis with a NI PXI 8464 CAN card.  I am learning to use this device.  I am trying to send messages back and forth between the two ports on the card.  I have four simple VIs:ReadWas; WriteWas;ReadSteering; and WriteSteering.  I have been starting the read VIs first then starting the write VIs.  When I start the write VIs I get an error from CAN init saying I am trying to change an object that is running. 
    Is it possible to send and receive on the same port of the CAN card without stopping then reinitializing the card?
     I have attached ReadWas, ReadSteering and WriteSteering to this post.  ReadWas and WriteSteering share a CAN port.
    Any help is greatly appreciated,
    Thanks,
    Phillip
    Attachments:
    ReadWAS.vi ‏112 KB
    ReadSteering.vi ‏143 KB
    WriteSteering.vi ‏114 KB

    have you looked at this example, (CAN Send & Receieve using NI-CAN Frames) it is in the example code section 
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=E993D9B56C3D2BABE0340003BA230ECF&p_...
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=E993D9B56C3D2BABE0340003BA230ECF&p_...
    Basically, you are getting the error because the second time you call CANconfig it realizes it is already open. Try consolidating the 2 pieces of code into 1 CAN VI.

  • My SB Audigy 2 card can't use headset and musicamplifier at the same time

    Hi, i just bought a SB Audigy 2 [D400] and i have downloaded drivers and programs. I run Windows XP SP2.
    The soundcard works fine but it is very very annoying that i physically have to change the jack in the green=line out jack from headset to musicamplifier when i want to use my musicamplifier and change back the jack in the green=line out from musicamplifier to headset when i just want to use the headset/headphones .
    In the shop they told my that i can connect both amplifier and headset at the same time and then with creative software control whether there is sound in the headset or in the amplifier. But i can't simple get it work.
    I tried to use the green to the amplifier and the headset/speakers in the black (line out 2) and then with creative speaker settings softeware choose headphones but still the ampliefier receive the sound and no sound in the headphones. Why? In fact no matter what configuration i try the headphones doesn't work.
    But if i change the jacks so headset is in the green line out then only headset is working and the amplifier doesn't work no matter i put it in sort=line out 2 jack or orange=line out 3 jack.
    Can somebody here tell me if it is possible or not to connect both headset and external amplifier and control by software which to play? and how?
    please help, thx.
    Michael

    If you can have an ASIO compatible music playing system, then it might be possible to have system like you wish when using Creative Audigy 2 card. Since ASIO bypasses Windows Audio System, you can use both 'drivers' (ASIO - WDM/MME/DS) side by side.
    Say you want to play a game (using headset /w mic) and someone other like to listen music at the same time. With ASIO capable system you can output your music for example to "center L/R (stereo) channels" and same time output sounds from other source (using MME/DS/WDM drivers) to normal output channel (Front L/R). Only thing is, you need to set your speakersystem to 4 or 6 (depending which other channel you're using) (and for better 'balance' to adjust "angle" on THX console. You get the THX console by installing Audigy 2 Zs software).
    Try for example http://img332.imageshack.us/img332/463/djs9mo.jpg[/img] width="406" alt="Image Hosted by ImageShack.us" >
    Another option:
    Say you want to play music through external amplifier and play game online with your headset + microphone (eg. others but you listen the music, you play games)
    --> try free http://img332.imageshack.us/img332/4589/tbp7rz.jpg[/img] width="406" alt="Image Hosted by ImageShack.us" >
    If you use ASIO on BeatPort Player you can select L/R individually from the list(s). Same rules as described earlier.
    = You can play from 2 different sources simultaoneusly (ASIO + WDM/MME/DS) to two different outputs without disturbance. The other (WDM/MME/DS) source is set 'automatically' output to (Audigy) "green" port, and the other (ASIO) to "black" or "orange" port (as set).
    .jtpMessage Edited by jutapa on 09-5-2005 05:30 AM

  • Why can't Apple TV's and iOS devices see home sharing on my Windows 7 computer when iTunes libraries on other computers on the same network and connected to the same Home Sharing can?

    I have never previously had any problems with Home Sharing, I have always found it to be completely reliable as advertised. I have 2 computers in the house, (one MacBook and one Windows Desktop) connected to the same Home Sharing account, connected to the same BT Home Hub 4. My situation is that I have nearly 2TB of data of which I would like to share with the home wirelessly, in my mind the desktop is the logical place for this to be shared from.
    When running, iTunes on this desktop broadcasts to other iTunes libraries, but no other iOS devices or Apple TV's connected to the same Home Sharing account cannot see it.
    I have tried turning Home Sharing off, and then turning it back on, closing iTunes, restarting the computer, going to Network and Sharing Centre and unticking IPv6 in the network adapter properties, even completely wiping the computer and reinstalling Windows 7.
    One of the Apple TV's in the house was recently purchased by my parents with the promise from me that everything would work seamlessly... so far it isn't and I am frustrated that the Apple technology that I have come to rely on isn't working as expected.
    One thing that has occurred to me upon writing this is that it is a very large amount of data, and I have not attempted to share this with another computer that is currently working and broadcasting it's Home Share fine.
    I am sorry if I have ommitted any important details, any further questions don't hesitate to ask. I would be so grateful of any suggestions, my parents are depending on me.

    I have found with AppleTV that it is the IPV6 on the computer you want to access is the problem.  The issue is that Homegroup on Win 7 or Win 8 requires IPV6 to work, but AppleTV won't work with IPV6.  (So maybe double check you have IPV6 turned off)
    So you have to make a choice - Homegroup or AppleTV.... but you can't have both, until Apple brings ATV up to date. (crazy that it does not recognise IPV6 - c'mon Apple!)
    You can set up sharing individually in Win 7 or 8 and have the ATV access files that way.
    Having said that, there is always the exception.. I have an old HP home server running Win8 and it services ATV - but is part of the Homegroup... have no idea why it works on both, but no other machine on the home network will talk to both ATV and Homegroup at the same time!

  • Can I run Tiger and Leopard on the same computer

    Hi folks.
    I've been meaning to install Leopard for ages but have never got round to it (I bought the retail box when it first came out). I have upgraded my RAM to 2GB and my hard drive to 320GB with no problems.
    My upgraded hard drive has been partitioned into 2 equal parts of 160GB. These appear on desktop as Mackintosh HD1 and HD2. HD1 is the disk with all my files, music, OS etc and HD2 is empty
    I have 2 bootable clones of my present system - one is on a 160GB external and the other is the original 80GB HD that I replaced.
    My question is this - can I install Leopard on to my 160GB external HD, then clone it on to the empty HD2. If I do this would I be able to run both Tiger and Leopard on the same Macbook?
    Is there any problems with this plan? Would I be able to transfer between the 2 OS and how do I install Leopard on the external drive. Is it just a case of inserting the Leopard DVD and choose the external drive as the target?
    As usual thanks in advance
    Del

    # Original Tiger in the internal HD, New Leopard in the external HD.
    # New Leopard in the internal, Legacy cloned Tiger in the external.
    # Split internal, one partition with Tiger, another with Leopard.
    Leopard is backwardly compatible with older Macs, just make sure yours fulfills the minimum system requirements, both use the same filesystem format, so each can see the other. You can't run both at the same time, unless you purchase the server version of Leopard and run it virtualized. 99.9% of Firewire external HD's are bootable, some USB's are bootable but have to test first. You can choose which system to boot from by pressing the Option key at boot time, before the chime. Just make sure the external HDD is plugged in and turned on if that's where you want to boot from.
    When I migrated my PBG4 from Panther to Tiger, got an external FW HDD, cloned Panther onto it, upgraded using Archive and Install, cleaned up, customized and tested it. When I was satisfied all was ok, cloned the original Panther onto another partition of the external HDD, wiped and tested for failure the internal HDD, then cloned the known good and tested Tiger into it. Only thing that died along the way was my old and ancient Photoshop v2.x, that refused to run on Tiger.

Maybe you are looking for