How to make a listbox selected item highlight color from code the same as if user click on item?

Hi all,
I have a listbox that gets filled with data when my program starts. I save the last selectedItem value so I set it when the program start again. But the color that the selected item has is not the same as if the user click on it (pictures below).
The color when I set the selectedIndex=someItem is black on light grey (background)
The color when the user clicks on the item is white on blue (background)
Any way to make them both white on blue (background)?
Thanks
This is the user clicking on it:
This is the code:

I think the difference is focus.  When you use the mouse to select it also sets focus to the listbox so you would have to set focus to the listbox when you set the selected item.  How are you setting your selected item?  I think that by
using a property to hold the selected item rather than setting the index that might also fix the problem.
Lloyd Sheen

Similar Messages

  • How to make a only one spectified type object running at the same time ?

    I want to run specified function with java program in unix,AIX environment.But i want only one specified type object can run at this time when i make command "java xxx &" several times at this time.I had used thread but it can not work. I think there are two processes for system so it can not work. Which class or way in java can i use for this problem ? or I use thread in the wrong way.
    please help me . thank you everybody !!!
    ps:the command "java xxx &" mentioned above,xxx is name of java program ,
    & means command run in background.

    RMI is a good option you can think of. There is one registry and only one object can be bound to it with a specified name. But if your application is large, RMI calls can really slow down your application.
    Another option is to use Sockets. When you load the application check if you can start a server socket on a particular port. If you can, then start the program. If not, another application is already running. So exit your program. The socket you have created will be used only to bind to a particular port. In any system, there can be only one socket bound to a port and this guarantees the single instance running. When your application closes, close the socket too.

  • How to make a group in contacts to send them all the same text?

    I am wondering if there is a way to make a group in contacts so I can send a text and have it go to all of the people in that group at once.  Help please.

    I don't think so. Search for an app in App Store or create a message with all contacts you want and use this to send message to this group of people.

  • NewBie Q : How to make one clickable shape jump to a slide with the same name of the shape (button c_1 to slide c_1 f.e.) .

    I made some clickable placeholders on a masterslide
    Then : a new slide based on that masterslide
    and want to use one script or shared  action that says "on success jump to another slide with te samen name as the button...)
    Sorry for this unusual semantic language.
    But already thanks for answering!
    Lucas
    PS I'm using a trial version to try out a branched interactive scenario. A choice of a user leads tot anothe slide with a video reaction followed by other choices,...)

    Sorry, but I'm not a native English speaker, and I have some problems with your question.
    The only interactive object that is possible on a master slide is a shape button. What do you mean by a 'clickable placeholder'?  Why I like Shape Buttons - Captivate 6! - Captivate blog  explains possibilities with shape buttons.  Maybe the idea to have such a shape button on a master slide is not the best, because you cannot control objects on master slides since they do not have an ID. You cannot give a name to a shape button on the master slide, which means the scenario you are talking about is just impossible?
    Moreover: Captivate doesn't like to have the same name/label to be used for different objects. There are some exceptions, you can have an advanced action with the same name as the interactive object that is triggering that action, provided you label first the interactive object before labeling the action. With  "script" you probably mean an advanced action?
    If you tried to explain what you want to do as detailed as possible, maybe I could propose something. You'll see that my blog is focussed on advanced and shared actions. One other puzzling sentence is 'same name as the button'? Are you really talking about the name of the button or about the label ON the button?

  • How to make a JPanel selectable

    When extending a JPanel and overriding the paintComponent() method the custom JPanel can not be selected so that it gets for example KeyEvents.
    But if I make the new Class extend a JButton it gets of course selected and able to receive for example KeyEvents.
    My question is therefore; what does the JButton implement that a JPanel doesn’t so that a JButton gets selectable? Or in other words; how to make a JPanel selectable?
    Aleksander.

    Try this extended code. Only the first panel added can get the Focus.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    class Test extends JFrame
      public Test()
        setLocation(400,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        JPanel panel1 = new JPanel(new BorderLayout());
        JPanel panel2 = new JPanel(new BorderLayout());
        ImagePanel imgPanel = new ImagePanel();
        panel1.setFocusable(true);
        panel2.setFocusable(true);
        panel1.setPreferredSize(new Dimension(0, 50));
        panel2.setPreferredSize(new Dimension(0, 50));
        panel1.setBorder(BorderFactory.createLineBorder(Color.RED,     4));
        panel2.setBorder(BorderFactory.createLineBorder(Color.CYAN,    4));
        imgPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 4));
        panel1.add(new JLabel("Panel 1"), BorderLayout.CENTER);
        panel2.add(new JLabel("Panel 2"), BorderLayout.CENTER);
        getContentPane().add(panel1, BorderLayout.NORTH);
        getContentPane().add(panel2, BorderLayout.SOUTH);
        getContentPane().add(imgPanel, BorderLayout.CENTER);   
        pack();
        panel1.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel1");}});
        panel2.addKeyListener(new KeyAdapter(){
            public void keyPressed(KeyEvent ke){
                System.out.println("Panel2");}});
      public static void main(String[] args){new Test().setVisible(true);}
    class ImagePanel extends JPanel
      Image img;
      public ImagePanel()
        setFocusable(true);
        setPreferredSize(new Dimension(400,300));
        try{img = javax.imageio.ImageIO.read(new java.net.URL(getClass().getResource("Test.gif"), "Test.gif"));}
        catch(Exception e){/*handled in paintComponent()*/}
        addKeyListener(new KeyAdapter(){
          public void keyPressed(KeyEvent ke){
            System.out.println("ImagePanel");}});
      public void paintComponent(Graphics g)
        if(img != null)
          g.drawImage(img, 0,0,this.getWidth(),this.getHeight(),this);
        else
          g.drawString("This space for rent",50,50);
    }

  • How to make Label in selection screen?

    Hi friends.. can anybody explain how to make labels in selection screens and how to split the selection screen vertically? plz.. Thanks in advance

    Arun kumar,
    Check this program. you can put labels like this.
    REPORT  ZVENKAT_TEST1.
    SELECTION-SCREEN BEGIN OF BLOCK block.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(15) text1.
    SELECTION-SCREEN POSITION 17.
    PARAMETERS :p_pernr type pa0001-pernr.
    SELECTION-SCREEN POSITION 26.
    SELECTION-SCREEN COMMENT 27(30) text2.
    SELECTION-SCREEN end OF LINE.
    SELECTION-SCREEN end OF BLOCK block .
    at SELECTION-SCREEN OUTPUT.
      text1 = 'Personal number'.
      SELECT SINGLE ename FROM pa0001 INTO text2 WHERE pernr = p_pernr.
    Regards,
    Venkat.O

  • How to make each drop down a different color?

    I'm looking to do a menu similar to this: http://www.cca.edu/ and I can't figure out how to make each drop down a different color? Any help or resources greatly appreciated!

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Document sans nom</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style>
    ul.MenuBarHorizontal li#yellow ul a,
    ul.MenuBarHorizontal li#yellow a:hover, ul.MenuBarHorizontal li#yellow a:focus,
    ul.MenuBarHorizonta li#yellow a.MenuBarItemHover, ul.MenuBarHorizontal li#yellow a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#yellow a.MenuBarSubmenuVisible {
        background-color: #FF6;
        color: #333;
    ul.MenuBarHorizontal li#yellow ul a:hover, ul.MenuBarHorizontal li#yellow ul a:focus,
    ul.MenuBarHorizonta li#yellow ul a.MenuBarItemHover, ul.MenuBarHorizontal li#yellow ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#yellow ul a.MenuBarSubmenuVisible {
        background-color: #FF0;
        color: #333;
    ul.MenuBarHorizontal li#red ul a,
    ul.MenuBarHorizontal li#red a:hover, ul.MenuBarHorizontal li#red a:focus,
    ul.MenuBarHorizonta li#red a.MenuBarItemHover, ul.MenuBarHorizontal li#red a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#red a.MenuBarSubmenuVisible {
        background-color: #F30;
        color: #333;
    ul.MenuBarHorizontal li#red ul a:hover, ul.MenuBarHorizontal li#red ul a:focus,
    ul.MenuBarHorizonta li#red ul a.MenuBarItemHover, ul.MenuBarHorizontal li#red ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#red ul a.MenuBarSubmenuVisible {
        background-color: #F00;
        color: #333;
    ul.MenuBarHorizontal li#blue ul a,
    ul.MenuBarHorizontal li#blue a:hover, ul.MenuBarHorizontal li#blue a:focus,
    ul.MenuBarHorizonta li#blue a.MenuBarItemHover, ul.MenuBarHorizontal li#blue a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#blue a.MenuBarSubmenuVisible {
        background-color: #6CC;
        color: #333;
    ul.MenuBarHorizontal li#blue ul a:hover, ul.MenuBarHorizontal li#blue ul a:focus,
    ul.MenuBarHorizonta li#blue ul a.MenuBarItemHover, ul.MenuBarHorizontal li#blue ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#blue ul a.MenuBarSubmenuVisible {
        background-color: #00F;
        color: #333;
    ul.MenuBarHorizontal li#pink ul a,
    ul.MenuBarHorizontal li#pink a:hover, ul.MenuBarHorizontal li#pink a:focus,
    ul.MenuBarHorizonta li#pink a.MenuBarItemHover, ul.MenuBarHorizontal li#pink a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#pink a.MenuBarSubmenuVisible {
        background-color: #F99;
        color: #333;
    ul.MenuBarHorizontal li#pink ul a:hover, ul.MenuBarHorizontal li#pink ul a:focus,
    ul.MenuBarHorizonta li#pink ul a.MenuBarItemHover, ul.MenuBarHorizontal li#pink ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#pink ul a.MenuBarSubmenuVisible {
        background-color: #F36;
        color: #333;
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li id="yellow"><a class="MenuBarItemSubmenu" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li id="red"><a href="#">Item 2</a></li>
      <li id="blue"><a class="MenuBarItemSubmenu" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li id="pink"><a href="#">Item 4</a></li>
    </ul>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    Gramps

  • HT204053 How do i make icloud work if my husband and I share the same itunes account but we dont want to get each others contacts, messages, apps etc?

    How do i make icloud work if my husband and I share the same itunes account but we dont want to get each others contacts, messages, apps etc?

    Each of you should set up your separate iCloud account on your own computer using your Apple ID. This gives you two independent iCloud accounts.
    Note that an iPad is not a multi-user device. It can only be synced with one account.

  • How to make all fields mandatory in sales order T- code VA01 initial screen

    Dear all,
    how to make all fields mandatory in sales order T- code VA01 initial screen itself
    The fields are
    Sales Organization
    Distribution Channel
    Division
    Sales Office
    Sales Group
    Regards,
    Amar Reddy

    Hi,
    You can use Transaction Variant to achieve this functionality.Please go through the following link which helps you in creating the same.
    [Link|http://wiki.sdn.sap.com/wiki/display/Snippets/TransactionVariant-AStepbyStepGuidefor+Creation]
    Regards,
    Phani Prasad

  • How to make compressor give me 1280x720   h.264 from my 1440 x 1080 sequenc

    can someone please tell me how to make compressor give me 1280x720 h.264 from my 1440 x 1080 sequence, with compressor I load up my high defition h.264 but i cant see where i can chage the size, I can tab on the preset and change max bit rates and other stuff but not to make it 1280 x 720,
    Thanks for the help,
    Daz

    In Compressor 3's Settings window:
    Apple > Apple Devices > H.264 for Apple TV
    this is one of the presets that is supplied as standard and it is pre-configured for H.264 1280x720 output
    if you're building your preset from scratch then you can set the output frame size in the Dimensions area of the Geometry pane

  • How to make it so my iphone 5 doesn't keep the location of were I took a picture

    how to make it so my iphone 5 doesn't keep the location of were I took a picture?

    Turn the feature off as described in the User's Guide.

  • Help!!! How to make quicktime plugin do not display on top of the web page?

    Any one knows how to make quicktime plugin do not display on top of the web page??? I've tried to change the zIndex property using javascript, but it doesn't work.
    Because we have some widgets which are required to be moved to anywhere on the page, we use iframe to implement that, so it can display on top of quicktime plugin, but the plugin flickers sometimes when we do some operation on the widget which is on top of it.
    Anyone can helps me? Thanks in advance!!!
      Windows XP Pro  

    > Can you tell me how to set the script so that the
    lightbox image is
    > displayed
    > on mouseover instead of mouse click.
    Check the docs. Trent is usually very thorough in his
    instructions.
    Hint: I haven't studied it but it probably involves modifying
    one of DW's
    built-in Behaviors.
    Walt
    "ducati1" <[email protected]> wrote in
    message
    news:gkb906$qrd$[email protected]..
    > Wow that DW extension is just what I needed.
    > Thanks..
    > Can you tell me how to set the script so that the
    lightbox image is
    > displayed
    > on mouseover instead of mouse click.
    > I currently have the thumbnails set to insert the ALT
    text into a text box
    > on
    > mouse click.
    >

  • How do you sync only selected songs to your ipod using the new version of itunes?

    how do you sync only selected songs to your ipod using the new version of itunes?

    Same way you did with the previous versions of iTunes.
    To view the iPod in iTunes, Ctrl S to show the sidebar.
    Create a playlist, add songs and sync that playlist.
    Or drag songs to the iPod in iTunes.

  • I want to transfer an audiobook and a movie from my MacBook Pro to my iPhone 4S, and can't figure out how.  I went to "Help" and it said after connecting the two devices I should "Click Apps," but I can't find anything labeled "Apps" to click.  Help?!!

    I want to transfer an audiobook and a movie from my MacBook Pro to my iPhone 4S, and can't figure out how.  I went to "Help" and it said after connecting the two devices I should "Click Apps," but I can't find anything labeled "Apps" to click.  Help?!!

    If you have iTunes 11 on your Mac then you can enable the left-hand sidebar via option-command-S, that might make it easier to navigate.
    Connect the phone to your Mac and select it on that left-hand sidebar, and on the right-hand side of the screen there should be a series of tabs which you can use to select what to sync to the phone. If it's an audiobook then it should appear on the Books tab for selecting/syncing, and films will be on the Movies tab. When you've got the audiobook on your phone you should get an Audiobooks option in the Music app (you might need to tap the '...' tab at the bottom of the Music app to see it).

  • How do I copy a document from pages into email (not pdf) and have color and format the same as the document created in pages?

    How do I copy an entire document from pages into email (not pdf) and have color and format the same as the document created in pages?

    Pages ’09 v4.3 and Pages v5.2.2 are entirely different document architectures. Consequently, copying and pasting a table from Pages ’09 circumvents the customary translation process  that would occur if you opened that Pages ’09 document in Pages v5.
    Make a backup copy of the Pages ’09 document that has the table in it, and then open this document in Pages v5.2.2. The table is translated into Pages v5 document format and displayed correctly. You can even select this Pages v5.2.2 table, and then copy/paste it into another Pages v5.2.2 document with accurate results.

Maybe you are looking for

  • MPEG-2 codecs missing from Adobe Media Encoder CS6 installed with Creative Cloud Membership

    Some people who have downloaded Adobe Media Encoder with Premiere Pro CS6 as part of a Creative Cloud Membership subscription have a problem in which the MPEG2, MPEG2-DVD, MPEG2-Blu-ray, Dolby Digital, & MXF OP1a codecs are missing. To fix this issue

  • How to use own created STYLE at SMART FORM

    Hi all, i am making a smart forms in which i want to use my own created STYLE even tough i already copied my style from the existing one and activate it it but when i m going to use it at SMART FROM,it give me  SMART FROM default style.i can't unders

  • File processing task

    Hello, everybody! Task for resolve: I have *.txt file with constans which looks like: #define FIRST_CONSTANT 101 #define SECOND_CONSTANT 10101 #define THIRD_CONSTANT 7877 etc... So, I need to parse it and have the java.util.HashMap where keys - names

  • Setting for no dependent reqmt should generate for bulk material

    Hello guys,    I know that for bulk materials system doesn't create any dependent reqmt. In other words system doesn't consider these materials in planning run.But for information purpose you can see the planned order no for bulk material in producti

  • Export command missing in imovie 11 upgrade?

    In the latest upgrade for iMovie 11' there is no "export to QuickTime" or other way to set your preferred export settings? can anyone explain how to do this now?