ComboBox and JList working to gether?

Hey
Is it possible to get ComboBox and JList to work together?
Eksampel.
In the ComboBox there are 3 options to pick. Football, Hockey and Baseball. When one of these are picked all the names of the players
from for example football is shown in a JList.
Is this possbile? If yes how? can you give example or link to toturial?

do you know a tutorial on this?Did you read the API for either JComboBox or JList????????
Both contain links to the Swing tutorial.
And why is it so difficult to post a Swing related question in the Swing forum???????

Similar Messages

  • Castom ComboBox and lose binding

    Hello. I'm trying to write my own ComboBox and I ran into a problem.
    public class TestComboBox : ComboBox
    public static readonly DependencyProperty SelectedCarProperty = DependencyProperty.Register("SelectedCar", typeof(string), typeof(TestComboBox), new FrameworkPropertyMetadata(null, OnSelectedCarPropertyChanged));
    public TestComboBox()
    this.Cars = new ObservableCollection<string>() { "Select Car", "BMW", "Mersedes", "Audi" };
    this.ItemsSource = this.Cars;
    this.SelectedItem = this.Cars[0];
    public string SelectedCar
    get { return (string)GetValue(SelectedCarProperty); }
    set { this.SetValue(SelectedCarProperty, value); }
    public IList<string> Cars { get; private set; }
    protected override void OnSelectionChanged(SelectionChangedEventArgs e)
    base.OnSelectionChanged(e);
    this.SelectedCar = (string)SelectedItem;
    private static void OnSelectedCarPropertyChanged(DependencyObject source, DependencyPropertyChangedEventArgs e)
    var car = (string)e.NewValue;
    var editor = (TestComboBox)source;
    editor.SelectedItem = car;
    When I try to install the default value, I lose the binding. If I commented this code, everything works fine.
    this.SelectedItem = this.Cars[0];
    How can I set the default value without losing binding to the VM
    P.S
    TestApp

    I use this code.
    <propgrid:PropertyGrid Margin="0,0,11,7">
    <propgrid:PropertyGrid.Items>
    <propgrid:PropertyGridCategoryItem DisplayName="Main">
    <propgrid:PropertyGridPropertyItem Value="{Binding Car, Mode=TwoWay}"
    DisplayName="Car">
    <propgrid:PropertyGridPropertyItem.ValueTemplate>
    <DataTemplate>
    <wpfApplication1:TestComboBox SelectedCar="{Binding Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type propgrid:IPropertyDataAccessor}}}" />
    </DataTemplate>
    </propgrid:PropertyGridPropertyItem.ValueTemplate>
    </propgrid:PropertyGridPropertyItem>
    </propgrid:PropertyGridCategoryItem>
    </propgrid:PropertyGrid.Items>
    </propgrid:PropertyGrid>
    I found a solution my problem Ijust replacedthe code
    this.SelectedItem = this.Cars[0];
    with this
    this.Loaded += (sender, args) =>
    if (this.SelectedItem == null)
    this.SelectedItem = this.Cars[0];
    And now everything works fine

  • Combobox and checkbox in jexcelapi

    Hay Gays,
    with Writing Spreadsheets i want to cells which contain combobox and other cells which contain checkbox ,i need help with that i tried alot of things ?

    You simply write your own TableCellRenderer that returns a different Component instance for each row.
    It could do this by having three TableCellRenderers installed in it and it simply delegates the call to getTableCellRendererComponent to the appropriate renderer:
    public class CompositeTablecellRenderer implements TableCellRenderer
      private TableCellRenderer[] cellRenderers;
      public CompositeTablecellRenderer()
        // create your nested renderers here
      public Component getTableCellRendererComponent(...)
        TableCellRenderer renderer = cellRenderers[row % cellRenderers.length]; // For example!
        return renderer.getTableCellRendererComponent(...);
    }It's up to your application to determine which renderer to use for which row. Cell editors create another level of complexity but it's still achievable (I wrote one that mapped Class to TableCellRenderer so it could determine the renderer based on the value's class at runtime - it sort of works but subclasses prove tricky).
    Hope this helps.

  • ComboBox and TextInput

    I have to add a change event listener... 
    I did add one something like this.... 
    Private function Change(event:Event):void{
          inputtxt.txt+=event.currentTarget.selectedIndex;
          vs.selectedChild=vsRef;
    <mx:TextInput id="inputtxt"/>
    <mx:Button id="searchBtn" label="Search" change="Change(event)"/>
    ***This does nothing for me though***
    OR
    [Bindable] public var Emp:String;
    [Bindable] public var ary:Array = ["Emp name", "Emp number", "Emp id"];
    This is my combobox array now I have a text box next it, so that the user can enter name, number or id...
    What should be in my change function?, I have:
    private function change():void{
              if  (cb.selectedIndex==0)
                   Emp=cb.selectedItem
              else if (cbEmp.selectedIndex==1)
                   Emp=????
              else
                   Emp=????
    <mx:ComboBox id="cb" dataProvider="{ary}"/>
    and how do I store what user has enter....
    which one is the right approach and how will they work... I'm just a little confused....
    Thanks...

    can you show me how to incorporate valueCommit with TextInput, combobox and search and I do have to search based on what the used enter...
    So if I have
    <mx:Script>
    <![CDATA[
    [Bindable] public var Emp:String;
    [Bindable] public var ary:Array = ["Emp name", "Emp number", "Emp id"];
    ]]>
    </mx:Script>
    <mx:ComboBox id="cb" dataProvider="{ary}"/>
    <mx:TextInput id="inputtxt"/>
    <mx:Button id="searchBtn" label="Search"/>
    <mx:ViewStack id="vs">
    <src:Ref id="vsRef"/>
    </mx:ViewStack>
    Now what I want to do is when the user enter either Employee Name or Number or ID in the textInput box next to the combobox filter based on what is selected in combobox (name, number or id) I have to bring up the viewstack which shows the datagrid with data based on what the user has input...
    Can anyone help me with how do I incoprporate valueCommit or cb.selectedItem....
    I'll really appreciate that.
    Thanks...

  • Strange UI sticking issue with drag/drop and JList

    Hi all,
    I have implemented drag/drop between a jtree and jlist. The jtree can accept drops from the jtree (nodes to other parent nodes) and from the jlist. The jlist can accept nodes of the tree being dropped on it.
    Let me say this much, it all works. Works fine and great. BUT, the purpose of my post is I am seeing a very strange and not easily reproducible problem.
    I should first say that after a successful drop, the list removes the selected items. I do support drag/drop for multiple items.
    When I drag items from the list to the tree, reasonbly normal (not too fast), everything seems to work every time. But if I drag an item quickly from the list to the tree, for some reason after the items are removed from the list, another item is selected, sometimes NOT in the place of where the item(s) were selected. Infact, when I drag quickly, I notice the selection changes in the list itself. I only accept tree objects being dropped in the list, so there is no ability to drag/drop list items onto itself, and thus if I drag a list item around the list normally, nothing changes..the item I am dragging stays selected and the cursor shows the drag arrow.
    So this problem seems seems odd. I can reproduce it fairly easily, but only when I click and drag quickly.
    Anyone have ideas? I don't see where in my list code that as I drag, when drop is done, etc that I select anything in the list. I have tried JDK 1.4.1 and 1.4.2 and it does it in both. I don't see a bug in the bug database for it, and I am not sure its a bug in the JVM or my own code!
    Any help is appreciated. Can't really post code as its a large set of code and it is dependent on our company project, so it would take some time to take the code out into its own app to test it again.

    Hi,
    +" Please note that dropSite==null is a legal value for collection components. dropSite=null and DropOrientation==ON indicates that the drop has happened outside the data portion of the collection component and should be treated as a drop on the entire component Also note that dropSite==null and DropOrientation==AFTER indicates that the drop has happened on an empty collection component and the user intends to append the data."+
    http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e10684/oracle/adf/view/rich/event/DropEvent.html#getDropSite__
    List dropRowKey = (List) dropEvent.getDropSite();
            //if no dropsite then drop area was not a data area
            if(dropRowKey == null){
                return DnDAction.NONE;
            }Frank
    Edited by: Frank Nimphius on Feb 18, 2011 11:18 PM

  • My serial number for Logic Studio doesn't work. I used one from a different box and it worked. How can I get a new number?

    My serial number for Logic Studio doesn't work. I used one from a different box and it worked. How can I get a new number?

    http://support.apple.com/kb/TS2005
    http://support.apple.com/kb/HT1861
    https://ssl.apple.com/support/proapps/serialnumbers/

  • HT1351 my ipod touch 2nd generation is no longer reconized in itunes when connected to my computer. I have tried different ipod cables and nothing works.

    my ipod touch 2nd generation is no longer reconized in itunes when connected to my computer. I have tried different ipod cables and nothing works.

    Hi Imminnie,
    Thanks for using Apple Support Communities.  If iTunes doesn't recognize your iPod touch, this article may help:
    iOS: Device not recognized in iTunes for Windows
    http://support.apple.com/kb/TS1538
    If issues persist, a thorough removal and reinstall of iTunes would be the next thing to try:
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    Cheers,
    - Ari

  • HT204416 My Safari is no longer working with many sites.  However Chrome and Firefox work fine.  I would like to re-install Safari in an effort to clear up the problem I can not resolve.

    My Safari is no longer working with many sites.  However Chrome and Firefox work fine.  I would like to re-install Safari in an effort to clear up the problem I can not resolve.

    1. From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.
    2. Select
              Safari ▹ Preferences... ▹ Privacy ▹ Remove All Website Data...
    and confirm. Test.
    3. If the above steps don't resolve the problem, please describe it in more detail.

  • YouTube will not work on safari for me on the ipad. Is there anyway to fix this? I can go anywhere else on the internet fine and it works on google chrome, but on safari it shows a blank screen with the bar on top after it loads.

    YouTube will not work on safari for me on the ipad. Is there anyway to fix this? I can go anywhere else on the internet fine and it works on google chrome, but on safari it shows a blank screen with the bar on top after it loads, if it's even loading at all.
    I do not know if it's relevant or not, but I got a message on my ipad while on safari saying that my iPhone has a virus. I looked it up and it seems it might have just been an ad from the website I was on, but it happened around the same time YouTube stopped working.

    You will find that using the YouTube app will provide a better viewing experience for YouTube videos.

  • Minus and - not working in query

    Hi all,
    I am operating on 10G R/2.
    I have thsi query where thi sstatement <pre>(COUNT(W_O) - COUNT(W_I))</pre> TOTAL is returning 0.Why is the minus and '-' not working out in this query?.
    <Pre>
    SELECT
    TRUNC(DT) week_start ,
    next_day (TRUNC( DT) - 7, 'Sunday' ) + 6 week_end ,
    to_number(to_char(DT,'FMWW'))wk_no ,
    'I_'||W_I AS IO ,
    COUNT(W_I) TOTAL
    FROM TABLE_A
    WHERE W_I IS NOT NULL
    GROUP BY TRUNC(DT),
    next_day (TRUNC( DT) - 7, 'Sunday' ) + 6,
    to_number(to_char(DT,'FMWW')),
    'I_'||W_I
    UNION ALL
    SELECT
    TRUNC(DT) week_start ,
    next_day (TRUNC( DT) - 7, 'Saturday' ) + 6 week_end ,
    to_number(to_char(DT,'FMWW'))wk_no ,
    'O_'||W_O AS IO,
    (COUNT(W_O) - COUNT(W_I)) TOTAL
    FROM TABLE_A
    WHERE W_O IS NOT NULL
    GROUP BY
    TRUNC(DT),
    to_number(to_char(DT,'FMWW')), 'O_'||W_O
    </pre>
    Edited by: CrackerJack on Jun 14, 2011 8:06 PM

    basic maths
    SQL> select count(object_name), count(owner), count(object_name) - count(owner)
      2    from all_objects;
    COUNT(OBJECT_NAME) COUNT(OWNER) COUNT(OBJECT_NAME)-COUNT(OWNER)
                 52658        52658                               0
    1 row selected.if you take away a number from itself you will get zero. I think you may mean SUM() rather than COUNT()

  • I cant install flash player on my razr i android 4.1.2 what is happen i buy the app and didnt work

    Well when i finally buy my new cell and get out from symbian os one off the first things i gonna do is install flash player for listen my music on last fm and see the movies from streaming but i am too disapoint cause i goo to google store and find a free app from flash this make me soo happy ok i download it when i see its only say the version i need to buy and its 5 euro i am a brazilian here is almost 16 R$ a big assalt for app but i know flash soo good and buyed it via paypal it send me to a download page i get it there but when i gonna install it, it say the app is not install, the pack seens to be corrupt, i see the forum i make my configuration for app from outside but even like this did not install someone can help me i am get crazy with it.

    Hey bro i just asked about a refound but they tell to contact the
    developers cause after 15 min later they cant reefound and other they say
    the app they send is free and i donwload it for free from google play and
    then from there i gef a pay pall link from 5 euro i hope to know what kind
    off app is this cause it is not a official cause is on google play how it
    could be there if this one are discontinued i am assalted:.? In a official
    web site from google or its a official link? I am lost hows i can
    responsability for this? Hope you can help me i know you are not the
    trouble maker but is the only direct aswer i have! Tks about it i was found
    about browser with flash moments ago but i did know about the bateries
    issues good alert hope you can help a litle more too know what happen too
    me and know how responsability for this
    Hope talk too you soon
    Em 21/12/2013 17:28, "Mike M" <[email protected]> escreveu:
        Re: i cant install flash player on my razr i android 4.1.2 what is
    happen i buy the app and didnt work  created by Mike M<http://forums.adobe.com/people/CFMcBlob>in *Installing
    Flash Player* - View the full discussion<http://forums.adobe.com/message/5950011#5950011

  • I have a dilema i use a programme called Mackeeper i accidentally moved several files to my trash,i would like to put the files back where they belong but put back option is in grey and wont work??

    I have a dilema i use a programme called Mackeeper i accidentally moved several checked files to my trash BUT i didnt delete them,i would like to put the files back where they belong but the put back option is in grey and wont work?? i have spoken to Apple and to no avail !!!
    Mackeeper moved my files to my trash so i pulled them out of my trash to my desktop it has copied them to my desktop as well as kept them in my trash!!
    im so confused and things are not working properly anymore such as my google chrome for example...all my book marks are gone BUT i can go to the google file which is out of place on my desktop and view all my bookmarks data...ALL of my files still exist but they are just out of place now which is making it hard for certain options on my computer to work...
    the files includeAccounts,address book plug-ins,addressbook,Adobe,AIM,Alfred,Anquet Maps,Apple,Asramsoftware,Audio,Automatically add to itunes,facebook,facebook 15-53-13-329,faxfresh,five details,flipping book photo album, font collections, fonts, forismatic,Garageband,Gimp,Google,Google 15-53-13-344,icloud,icons,idocument lite,ilife media browser,ilifepage layout,internet plug-ins,ip scanner,itext express,itunes,iweb,Keyboard layouts,Keychains,launch agents,Librarian,limit point software,logs,mail,mail 15-53-13-895,messages,metadata,mobile documents,mobiscope,moso,movie effects,mozilla,MPlayerx,mywebcamBroadcaster,Native instruments,Skype and LOADS more......
    HOW do i get this stuff back to where it is supposed to go so that these programmes work properly again???? i also used delete and command but that did not work either,like i said i have not emptied my trash and ALL the info is there its just totally out of place and the put back option will not work sor some reason!!??? im running 10.8.5 imac someone PLEASE help me!!
    i have not set up time machine either but i do back up to a site called backupblaze...

    Step 1
    Remove "MacKeeper" as follows.
    "MacKeeper" has only one useful feature: it deletes itself.
    Note: These instructions apply to the version of the product that I downloaded and tested in early 2012. I can't be sure that they apply to other versions.
    IMPORTANT: "MacKeeper" has what the developer calls an “encryption” feature. In my tests, I didn't try to verify what this feature really does. If you used it to “encrypt” any of your files, “decrypt” them before you uninstall, or (preferably) restore the files from backups made before they were “encrypted.” As the developer is not trustworthy, you should assume that the "decrypted" files are corrupt unless proven otherwise.
    In the Finder, select
    Go ▹ Applications
    from the menu bar, or press the key combination shift-command-A. The "MacKeeper" application is in the folder that opens. Quit it if it's running, then drag it to the Trash. You'll be prompted for your login password. Click the Uninstall MacKeeper button in the dialog that appears. All the functional components of the software will be deleted. Reboot.
    Failure to remove MacKeeper will result from neglecting any one of these points:
    Quit MacKeeper before dragging it to the Trash.
    Don't empty the Trash after dragging the application to it. Let MacKeeper delete itself.
    Don't try to drag the MacKeeper icon in the Dock to the Trash.
    Here are some general suggestions. If you want your computer to be usable, don't install crapware, such as “themes,” "haxies," “add-ons,” “toolbars,” “enhancers," “optimizers,” “accelerators,” "boosters," “extenders,” “cleaners,” "doctors," "tune-ups," “defragmenters,” “firewalls,” "barriers," “guardians,” “defenders,” “protectors,” most “plugins,” commercial "virus scanners,” "disk tools," or "utilities." With very few exceptions, this stuff is useless, or worse than useless.
    The more actively promoted the product, the more likely it is to be garbage. The most extreme example is the “MacKeeper” scam.
    The only software you should install is that which directly enables you to do the things you use a computer for — such as creating, communicating, and playing — and does not modify the way other software works. Never install any third-party software unless you know how to uninstall it.
    Step 2
    Restore from the last backup that predates the unwanted changes.

  • HT4356 My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    My iPad does not find the printer. I have tried the HP app and it works, but in any other app the printer is not seen. How do I get this printer visible to the iPad. All my other network computers find and print with out a problem.

    hi
    could you tell us what the other app is please

  • HT4623 Please  help!  i have just update my iphone 4s with 7.4 update and my phone is now asking for a password which i dont have.  I have tried my keypad lock i used before the update and also my itunes password and neither work, how do i rectify this ??

    Please  help!  i have just update my iphone 4s with 7.4 update and my phone is now asking for a password which i dont have.  I have tried my keypad lock i used before the update and also my itunes password and neither work, how do i rectify this ???

    Did you buy this iPhone new from an authorized seller?

  • I have added/embedded four videos on my website, but when I scroll down, the videos scroll in front of the top menu instead of behind as it should. I have tried changing layers, etc., and nothing works. Can you help?

    I have embedded 4 videos on my website. It is a single page, scrolling site. When I scroll down, the videos scroll in front of the top menu bar, instead of behind it. I have tried changing layers, etc., and nothing works. Please help.
    Thanks.
    Paul W. Norman

    Hi,
    Kindly create a new layer, via the Layers panel:
    Then, right click on the navigation bar, and choose Move to Layer > Layer 2
    Ensure that Layer 2 is on top of the other layers.
    Hope it helps,
    Sonam

Maybe you are looking for

  • Can no longer play KCRW Left, Right and Center

    Since upgrading my 5G ipod to latest version. It will no longer play certain podcasts. The one listed above is one nbut there are others. Buzzcast from CNET is one it stopped playing for a time but then after teh latest itunes update it now plays it

  • Mac Mini Server with Leopard

    I installed a Mac Mini Server in my media room. Connected it on my Ethernet, where i also have two other mac mini's a Mac Book Pro throughout the house. They all do "see" and "talk" to each other, and share files, like they are supposed to do. The on

  • "InfoObject" with Text data is not showing description/heading/text in IDT...

    Dear All, I'm working on SAP NetWeaver 7.3 and I have an InfoCube for QM and recently I had a requirement to add an "InfoObject" which will show text. I added it into InfoCube and after loading my transaction data, I could see the text of newly added

  • How can I set background for JTextArea

    plz help me!

  • Seeking a developer to the team for a large project

    Need a capable developer in the team. Developing an application that will sync iphone-ipad using the protocol bluetooth message access profile (MAP), ipad will be notified that you have written messages, phone calls.Leave mail address to contact you.