How to detect if an item of JComboBox is highlighted?

Good day.
How to detect if the selected item of a JComboBox is highlighted or not?
Thanks for your response.

the above code can only detect a highlight if an item is selected from the combo box.
But when the focus is transfered to other Combo box it can no longer keep track if the item was highlighted or not.
for example:
combo box 1 combo box 2
item item2
Highlight should be detected wheneverr the focus is transfered from combo box 1 to combo box 2 or vice versa.
case:
Combo box 1 item is highlighted before transfering the focus to combo box 2 item. by the time the focus is transfered , highlight in combox 1 item should be detected.
The main problem here is how to detect if the previously focused item is highlighted or not.
thank you for your time.

Similar Messages

  • How to change the visible item of JCombobox

    hi,
    i have created a JCombobox having items A, B, C, D and E. The item that is visible on the combobox (without performing any mouse action over it) is A. i have a button "Change to Default" in the same frame. If I click on this button B should become the visible content of ComboBox in place of A. Could anyone suggest me how to do it.
    Thank you very much...

    Well, you could start by reading the documentation for JComboBox: http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JComboBox.html
    There you will find setSelectedIndex and setSelectedItem. Either of those will do it for you.

  • How to detect last external item loaded?

    I can't get my head around this. I know there's a clever way to do this but none of my ideas seem to be the solution. I'd like to dispatch an event when there are no more items to be loaded. I'm working with Drupal and AMFPHP and loading some nodes. The number of nodes may vary from day to day so I need a way to know when the last one has loaded.
    In the code below, I am building an array to use elsewhere in the application. Once all nodes have finished loading I'd like to know what the final length of portfolioItems is.
    public function onNodeLoad( node:Object )
       //trace("Node loaded");
       if (node.nid == 2) {
              about.aboutText_txt.htmlText = node.body;
       }else {
              var nodeStr:String=baseURL;
              nodeStr+=node.flashnode["filepath"];
              portfolioItems.push(nodeStr);
              portfolio.portItems = portfolioItems;   

    Aha, good point! Thanks for the knock in the head.
    I can set a counter on the event handler for the View Load, which is where the node loading gets kicked off. Then check to see if I've reached that last item inside the Node Load handler. I'm posting if anyone else needs an example like this.
    var loadCounter:Number = 0;
    // Called when a view gets loaded.
      public function onViewLoad( _view:Object )
       // Iterate through all of the nodes.
       for each (var node:Object in _view) {
        loadCounter ++;
        // Call Drupal to get the node.
        drupal.loadNode(node.nid, onNodeLoad);
       showAllElements();
    // Called when Drupal returns with our node.
      public function onNodeLoad( node:Object )
       if (node.nid == 2) {
        //trace(node.body);
        about.aboutText_txt.htmlText = node.body;
       }else{
         var nodeStr:String=baseURL;
         nodeStr+=node.flashnode["filepath"];
         portfolioItems.push(nodeStr);
        if(portfolioItems.length == loadCounter){
              portfolio = new Portfolio();
              addPortfolio();
              portfolio.portItems = portfolioItems;

  • How to configure the delivery item text is required text

    Dear All,
            I have issues about delivery item text.  I would like to know how configure to delivery item text is required text (if not enter the text then cannot save delivery and show error message).
           In configuration about delivery text in text control. I configure the delivery item text is (text is obligatory) but the delivery item is only show at incompletion log but not requried field.
           In configuration about incompletion control for deliveries. No table and field is about delivery item text. I trial to enter PTEX(item texts) in field: Screen for creating missing data. The result can detect missing delivery item text but cannot specific delivery item text. If I enter other item text then the delivery can be saved. In additional, when I open screen delivery item text and not enter the delivery item text, the delivery can be saved.   These are incorrect. I would like to check the delivery item text is required text.
           Please suggest me how to solve this issue. Thank you very much. 
    Best Regards,
    Lek Lexus

    the

  • Detect purchase requisition item text changes

    Hi Abap Gurus,
    During a PR modification (ME52N), I need to read the purchase requisition item text at runtime to compare with the stored item text (read text) and detect if it have changes.
    Actually, I am using the badi ME_REQ_POSTED.
    How could I detect the PR item text changes? or How could I read the item text at runtime.
    Somebody could help me with this....
    Other ideas will be welcome.....
    Regards,
    Jaya Sankar.M

    Hi,
    But can you change the purchase requisition item text using the badi?

  • Load items in JComboBox

    Hi all,
    May i know how to load the files from a folder into a JComboBox.
    How can i refresh the items everytime the comboBox is clicked?

    When you instanciate your combo model, create an instance of File with the path to the folder as the constructor's parameter.
    With this File instance, use the method listFiles() to get the list of files contained in the folder. Populate your model with the items.
    For your second question, all of the above can be put in a seperate method, then you only have to call it when the combo is clicked.
    Of course, after your model has been modified, don't forget to fire an appropriate event to the combo.

  • Eliminate Items in JComboBox???

    Hi @all,
    does anybody know how I can eliminate the items of a JComboBox?
    I am reading the items of the JComboBox out of a file and then I add them. When I am adding one item to the file and read the items again, I habe all the items two times in my JComboBox. The new one of course not.
    How can I delete them first.
    Chao
    Juergen

    Thank you.
    Juergen

  • Create a PopupMenu when right click onto an item of JComboBox

    How do I make so that, a popupmenu appear only when I right click onto a item of JComboBox. What I have right now is showing a PopupMenu whenever I right click on the frame.
    I got another question to ask if you guys dont mind. How do I set the ComboBox to scroll horizontally. Right now I set the preferredSize of the ComboBox so if the item's names are too long, it will be cut off. Can I set it so that I can scroll horizontally to see the rest of the item's name?

    My English is very poor, so it's hard to explain...
    3.
    // This is just an example code and has not been tested.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.plaf.basic.*;
    public class ComboRightClickTest{
      public JComponent makeUI(final JFrame frame) {
        frame.setGlassPane(new LockingGlassPane());
        String[] items = {"test1", "test2", "test3"};
        JComboBox combo = new JComboBox(items);
        combo.setUI(new BasicComboBoxUI() {
          protected ComboPopup createPopup() {
            return new BasicComboPopup( comboBox ) {
              protected JList createList() {
                return new JList( comboBox.getModel() ) {
                  public void processMouseEvent(MouseEvent e)  {
                    if(e.isPopupTrigger()) {
                      String s = getSelectedValue().toString();
                      frame.getGlassPane().setVisible(true);
                      final JPopupMenu m = new JPopupMenu();
                      final JMenuItem i = new JMenuItem(
                          new AbstractAction("del:"+s) {
                        public void actionPerformed(ActionEvent ae) {
                          comboBox.removeItemAt(getSelectedIndex());
                          frame.getGlassPane().setVisible(false);
                          m.setVisible(false);
                      i.addMouseListener(new MouseAdapter() {
                        public void mouseEntered(MouseEvent me) {
                          i.setBackground(getSelectionBackground());
                        public void mouseExited(MouseEvent me) {
                          i.setBackground(getBackground());
                      m.add(i);
                      Point p = e.getPoint();
                      SwingUtilities.convertPointToScreen(p, this);
                      m.show(null, p.x, p.y);
                      return;
                    super.processMouseEvent(e);
        JPanel p = new JPanel(new BorderLayout());
        p.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
        p.add(combo, BorderLayout.NORTH);
        p.setPreferredSize(new Dimension(320, 100));
        return p;
      public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {
          public void run() { createAndShowGUI(); }
      public static void createAndShowGUI() {
        JFrame f = new JFrame();
        f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        f.getContentPane().add(new ComboRightClickTest().makeUI(f));
        f.setResizable(false); //XXX
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    class LockingGlassPane extends JComponent {
      public LockingGlassPane() {
        setOpaque(false);
      @Override public void setVisible(boolean isVisible) {
        boolean oldVisible = isVisible();
        super.setVisible(isVisible);
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        if(rootPane!=null && isVisible()!=oldVisible) {
          rootPane.getLayeredPane().setVisible(!isVisible);
      @Override public void paintComponent(Graphics g) {
        JRootPane rootPane = SwingUtilities.getRootPane(this);
        if(rootPane!=null) {
          http://weblogs.java.net/blog/alexfromsun/archive/2008/01/
          rootPane.getLayeredPane().print(g);
        super.paintComponent(g);
    }

  • How to update an existing item in a sharepoint list using the WSS adapter for Biztalk

    Is there a way that a record in SP list be updated using WSS adapter in biztalk ?
    BizTalk 2013 and SP 2013 ..
    Regards
    Ritu Raj
    When you see answers and helpful posts,
    please click Vote As Helpful, Propose As Answer, and/or Mark As Answer

    A ListItem has its own unique row id so in all likelihood, an insert with the same data will result in a new list entry. The Lists Web Service however, has an UpdateListItem method which will take an update request. [refer
    http://msdn.microsoft.com/en-us/library/office/websvclists.lists.updatelistitems(v=office.15).aspx ]
    There is another note in the conference (marked answered) to your List Item Update problem. Probably worth a try too. [refer
    http://social.msdn.microsoft.com/Forums/en-US/bee8f6c6-3259-4764-bafa-6689f5fd6ec9/how-to-update-an-existing-item-in-a-sharepoint-list-using-the-wss-adapter-for-biztalk?forum=biztalkgeneral ]
    Regards.

  • How to clear vendor open items with customer open items in APP?

    Hi Experts,
    Our vendor is our customer - in this scenario how to clear vedor open items against customer open items. I have defined vedor is customer means I have given customer number in vendor master record, selected chek box 'clear with customer'.  Still problem is not solved, hence I am requesting you to help me in this regard.
    Thank you very much,
    Regards,
    Ganesh.

    Hi
    In FBCJ after payment you have clear manually vendor balance in F-44.
    If you want SPL GL in FBCJ then write a Substitution .
    1. step 001 - Special G/L Substitution
    2. Prerequisite - Transaction code = 'FBCJ'
    3. Substitution posting key -- Exit (need help from abap) exit name
                                              G/L Exit (need help from abap) exit name
                                              Special G/L Ind Exit (need help from abap) exit name
    you can't do this without ABAP help
    Best Of Luck
    Tanmoy

  • How to clear vendor open items if vendor invoice currency and payment currency different

    Hi All.
    How to clear vendor open items through f-44 if vendor invoice currency is EUR , payment currency is USD  but local currency is INR
    while clearing through f-44 system showing error as "to large for clearing clearing is not possible"
    I checked all configuration, configuration wise no problem
    BR.
    Chandra

    Hi Chandra,
    You chose any one of the currency i.e. EUR/INR/USD for clearing in F-44. After selecting line items for clearing, system will show a difference. Click on over view button and manually write off the difference by selecting any one account i.e. dummy or small diff.account, after that click on process open items then system will show the difference 0 and simulate the document, here system will post gain/loss exchange GL postings along with other line items. After save the document, manually pass journal entry to dummy account and gain/loss account. I have explained clearly in the below example.
    Invoice is in USD - 1000 & INR - 60000
    Payment is in INR - 60000
    Now I am going to clear these in INR currency in F-44 on 31.03.2015. On this date the exchange rate for USD is 60.10. At the time of clearing system will post the below entry
    Vendor A/c Dr 60000 (invoice)
    Vendor A/c Cr 60000 (Payment)
    Gain from exchange rate A/c Cr  100 (60000 - 60100)
    Small diff.write off A/c (or) Dummy A/c Dr 100
    After done the above posting, we have to pass below manual JV in FB01
    Gain from exchange rate A/c Dr  100
    Small diff.write off A/c (or) Dummy A/c Cr 100
    Regards,
    Mukthar

  • How to split a line item to 2 line item.

    Hi all !
    I have a request, help me please !
    In system I have a invoice with 1 line item value 1000 USD.
    Customer payment 600$. a incoming payment with value 600$ will post to system.
    I want incoming payment and invoice will auto clear 600$ but system can't auto clearing because value is not Identical.
    I want line item of invoice will split to 2 line item. Line item 1 value 600$ and line item 2 value 400$.
    Line item 1 of invoice will auto clear with incoming payment and system will exist a invoice with 1 line item value 400$.
    How to split a line item to 2 line item ? Have FM for split a line item to 2 line item in SAP ?
    If you have other solution for this request, help me please !
    Thanks !

    Hi,
    Have a look at Split line item - Sales Order
    Regards

  • How to process Customer Open Items? If that Customer is also an Vendor.

    Hi All,
    I need some help for  the below configuations,
    1. How to process Customer Open Items? If that Customer is also an Vendor to the Company. ( How to adjust these open amounts)
    1. How to process Vendor Open Items? If that Vendor is also an Customer to the Company. ( How to adjust these open amounts)
    Thanks
    Chandra

    Hi Chandra,
    In addition to all the above, if the Customers and Vendors are in different company codes, then, you would have to also do the following configuration.
    Execute transaction code <b>OBYA</b>, when prompted, type in 1st coy code, say A and then 2nd coy code, say B. This would take you to the "<b>Maintain FI Configuration: Automatic Posting - Clearing Accounts</b>" screen.
    In the first frame, where you have
    Posted in : A
    Cleared Against : B
    Under Receivable
    Debit Posting Key : <b>01</b>
    Account Debit : Account Number (The account can be a G/L account, a customer account or a vendor account)
    Under Payable
    Credit Posting Key : <b>31</b>
    Account Credit : Account Number (The account can be a G/L account, a customer account or a vendor account).
    In the second Frame
    Posted in : B
    Cleared Against : A
    Under Receivable
    Debit Posting Key : <b>01</b>
    Account Debit : Account Number (The account can be a G/L account, a customer account or a vendor account)
    Under Payable
    Credit Posting Key : <b>31</b>
    Account Credit : Account Number (The account can be a G/L account, a customer account or a vendor account).
    So, if you are using the Customer/Vendor approach, company A must be set up as both a Customer(Use Txn Code <b>XD01</b>) and a Vendor(USe Txn Code <b>XK01</b>) in Company B and vice versa.
    Once you have completed this set-up, you can then use transaction <b>F.13</b> and/or <b>F13E</b> to carry out your automatic clearing.
    However, if you intend to use the G/L approach, then the account numbers would be Inter-coy G/L account for each coy code as defined in the chart of accounts.
    I hope the above helps.
    Do not forget to award the points please.
    Regards,
    Jacob

  • How do I delete multiple items at once instead of one at a time?

    How do I delete multiple items at once instead of one at a time? I have several duplicate items in my library and would like to delete the duplicates. Thanks!

    You can select multiple items using shift to select a range and control to add or remove items from it.
    Regarding duplciates, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group of identical tracks to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. This can happen, for example, if you start iTunes with a disconnected external drive, then connect it, reimport from your media folder, then restart iTunes.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background. Please take note of the warning to backup your library before deduping, whether you do so by hand or using my script, in case something goes wrong.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • I have a windows pc.  How can I download purchased items which have become corrupted on my PC.  I can't use iCloud

    I have a windows pc.  How can I download purchased items which have become corrupted on my PC.  I can't use iCloud without an Apple device.  I have gone into purchased but next to each title it merely says 'downloaded'.  I need to download them again.  It will cost a fortune to re-purchase the corrupted music!

    I tried that but it just shows 'downloaded'.  There is no little cloud next to that wording.  On an Itunes help page it shows a 'library icon' once you have logged in but that does not appear on my version of ITunes which is 11.1.  I have lost so many peices of music!  Is this some ploy by Apple to get you to buy them all over again??  Thanks for you response, if you can think of anything else I would be most grateful

Maybe you are looking for

  • What will happen when I put my jailbroken iPhone 4 in the computer?

    I have a jailbroken iphone 4 still running on 4.3.2 firmware and I would like to get rid of the jailbreak and update it to 5. I understand that it will take my jailbreak off, which I have no problem with, but I'm terrified to plug into the computer.

  • RGB conversion to CMYK InDesign CS4 js

    Hi, When we export InDesign into pdf through a script we assign to it a specific color profile. And at first it was converting all RGB files to CMYK as well. Then after one of the crashes my InDesign stopped to convert them. Is there a way to fix tha

  • Can't add artwork to new movies

    Until last weekend, I could add artwork and pictures to movie files I was importing to iTunes. Now I can't. I add the artwork in the usual way, and it immediately reverts to showing the thumbnail of the video, and when I check for artwork under 'Get

  • Netflix no longer available message keeps popping up

    Cannot seem to get Netflix to work on the apple tv anymore..keeps saying Netflix unavailable but Netflix works on my MacBook and iPad ..

  • How to output 3D Surface Graph as image file (bmp or jpg or png)

    I'd like to output a graph from the 3D surface.vi module as a regular image (like a JPG or BMP).  At this time, I'm going through an awkward process of taking a screen cap, then isolating the image with photoshop (painful and time consuming). Any ide