How to cause JComboBox to open to preselected item?

If you initialize a JComboBox to an item (using setSelectedIndex, for instance), the first time that the comboBox is opened, it will open at the top of the list, not at the selected item. For example:
JComboBox jComboBoxHourPicker = new JComboBox();
// Add comboBox items here
jComboBoxHourPicker.setSelectedIndex(22);
The comboBox will correctly show the 23rd item selected. When the user opens the comboBox, however, it will open at the first item, not at the 23rd. If the user closes the comboBox without changing the selection, though, the next time that the comboBox is opened it will have scrolled to the selected item.
The JList class has the ensureIndexIsVisible() method. Does anyone know how to get the same behavior for the JComboBox class?

This is a known bug that has been fixed in v1.4. Check out the thread below, by me, for all the details. You're following in my footsteps.
If you need a workaround for 1.3, follow the link into the bug database and there's a pretty decent one there.
http://developer.java.sun.com/developer/bugParade/bugs/4337516.html

Similar Messages

  • Openning a Link from MS Office OneNote 2007 launches MS Internet Explorer althoug FireFox is my default Internet browser. Any idea how to cause OneNote 2007 to Launch FireFox instead?

    Openning a Link from MS Office OneNote 2007 launches MS Internet Explorer althoug FireFox is my default Internet browser. Any idea how to cause OneNote 2007 to Launch FireFox instead?

    Below is how it is being done.  This worked perfectly for years. MS Office 2007 does complain that the file extension does not match the data format (it's a tab delimited text file but I'm pretending it's an Excel file so they'll be prompted to view it as a spreadsheet in Excel) but you just click open and it works fine.  This issue with IE is new.  Let me know if you have any more ideas.
    <CFSETTING ENABLECFOUTPUTONLY="Yes" SHOWDEBUGOUTPUT="No">
    <!--- variables used for separating cells with tabs, and for new rows --->
    <CFSET tabchar=chr(9)>
    <CFSET newline=chr(13) & chr(10)>
    <!--- tell browser it's an Excel file --->
    <CFCONTENT TYPE="application/vnd.ms-excel">
    <!--- tell Internet Explorer to open as Excel file --->
    <CFHEADER NAME="Content-Disposition" VALUE="filename=myfile.xls">
    <!--- get data --->
    <CFQUERY NAME="getinfo" DATASOURCE="mydsn">
        select fieldone, fieldtwo
        from mytable
    </CFQUERY>
    <!--- output column headings --->
    <CFOUTPUT><CFLOOP INDEX="q" LIST="fieldone,fieldtwo">#q##tabchar#</CFLOOP>#newline#</CFOUTPUT>
    <!--- output database records --->
    <CFOUTPUT QUERY="getinfo">#getinfo.fieldone##tabchar##getinfo.fieldtwo##newline#</CFOUTPUT>

  • How to restrict Firefox to open word document in browser window with href

    How to restrict firefox to open word document from a website link to open in the browser window, instead it should open in native program.
    1.I have tried other website, and have clicked on similar links they are opening word document correctly in native program
    2. MS word document from one specific site is opening in browser causing junk character in place of word document.
    Could you please help on this.

    Thanks for your response...
    But As i said, I have tried with other website on the same browser, there it is opening word document in native program. Also the above mentioned options have been tried earlier.
    I have some questions related to this?
    How is this href link is behaving differently opening in browser for mozilla only. Technically, Can we make it open it native program only? If so, then how?

  • Each time I open foxfire a popup asking how to process a download opens and inhibits use of foxfire. How do I stop the popup?

    each time I open foxfire a .LNK popup appears asking how to process a download opens and inhibits use of foxfire. How do I stop this and allow me to open and use foxfire browser. This started after I attempted to follow directions to install/associate a .LNK program/file with foxfire to control saving downloads using any browser. Note that I am a novice user. How can I stop this?

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • How to turn off "re-open all application windows"

    How to turn off "re-open all application windows". Even though its unselected in preferences. my computer still tries to do this and causes startup problems and delays. its been a hangup since lion. when are they going to fix this???

    Try this. . .
    You have two choices. You can choose that your applications not resume their previous state when you shutdown or restart the Mac by deselecting the checkbox that appears prior to shutdown:
    Or you can navigate to the General pane in System Preferences and deselect the Restore windows when quitting and re-opening apps option. However, if you do this, applications will never resume their previous state, even when quit and restarted during a single boot session.

  • How to update  pricing in open sale order

    Hi all
    in open sale order suppose my basic price has been changed .how Can i update all open sales order basic price in one shot.

    Dear Sachin,
    Please follow the point as given below;
    1. In VTFL for your item category maintain pricing type as B if it is delivery related billing and if it is order related billing VTFA maintain pricing type as B and one more thing maintained Billing Quantity as C if you using VTFA and Billing Quantity as D if you using VTFL.
    2. Create the new condition records in VK11 for your new price ( Do not change the existing  condition record in VK12) with proper validity dates
    3. Use update button in billing the system will pick the new record by accessing VK11 in billing.
    Try this, it will work.
    Regards,
    Bharat B

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • I am trying to open PDF files from safari, but when I click on them they open in a separate window and the information is encrypted. Any ideas on how to get them to open them in Adobe? Any help please!

    I am trying to open PDF files from safari, but when I click on them they open in a separate window and the information is encrypted. Any ideas on how to get them to open them in Adobe? Any help please!

    The pdf is loading as html code. If you save it, it will download as :
    605124.pdf.html
    Change the extension to .pdf
    And it opens and works perfectly, I just tested it:
    Use this link to download it automatically:
    http://saladeaula.estacio.br/arquivo.asp?dir=00/1020624/605124.pdf&num_seq=59828 4

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • How do I open multiple history items and restore my last session from more than the last day

    I see I can open 1 history item ant a time how can I open more than 1 if my browser crashed or was force quitted. Also is there a way to open previous items from before I day if I lunch safari and don't open my recent items using history.

    From your Safari menu bar. Click History / Reopen all windows from last session.
    If Safari is quitting unexpectedly, try resetting Safari. From the menu bar click Safari / Reset Safari. Select the top 7 buttons, click Reset.
    If that doesn't help, If Safari has just crashed, press the Report button on the CrashReporter dialog box to view the crash  information.
    Copy/paste the entire contents of the Crash Reporter window into your reply. If the crash report dialog does not appear or the crash is hard to reproduce, crash logs can be retrieved from the ~/Library/Logs/CrashReporter> folder.

  • How to edit a Finder "Open With" entry

    How do I edit an "Open With" entry on the context menu in Finder? I have an application which updated recently and has added a rather long version number to the application name in the "Open With" entry for the app. I have run a command line which was given to me in these forums to update file-type associations and remove old apps from the list but the version number on this app seems to be resisting efforts to be cleaned up. I am guessing there is something in a PList somewhere but I don't know where.
    Any help would be appreciated.

    Use an encrypted disk image or a third-party method. Placing the password in the keychain will automatically unlock the image when your Mac OS X account is active.
    (53277)

  • How to bring in the Open Sales Orders while performing Sales Order Conv

    Hi,
    Could you give some suggestions on the below:
    How to bring in the Open Sales Orders while performing Sales Order Conversion in R12.
    Thanks
    Pravin

    See http://ramugvs.wordpress.com/2011/08/27/how-to-stage-and-import-an-order-using-order-import-api-apps-wms-ebiz-11i-r12/
    Sandeep Gandhi

  • How do I stop an Open Proxy

    I have a G5 server running OS X 10.4.8 hosting a couple of web sites.
    From evidence in my log files I appear to be running a “partial” Open Proxy and would like to know how to stop this.
    This is my setup:
    * Enable Proxy in unchecked (although Control Access to Proxy is checked). Note, until about 3 months ago this was checked by accident.
    * All sites have Performance Cache unchecked.
    * I have ports 80 (http), 443 (https) and 8080 (https) open (I need 8080 for a second digital certificate).
    * I'm running PHP and MySQL.
    I have tested for open proxy (via http://www.euirc.net/en/proxycheck.php) and it reports I’m not running a proxy.
    HOWEVER, if I check my web logs I can see successful accesses (200) from external IP addresses:
    xxx.xxx.xxx.xxx - - [03/Dec/2006:10:26:45 +0000] "GET http://www.yahoo.com/ HTTP/1.0" 200 90 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
    Fortunately, other accesses appear to get rejected with 404:
    xxx.xxx.xxx.xxx - - [03/Dec/2006:05:00:05 +0000] "GET http://www.peopower.com/server/Headers.shtml HTTP/1.1" 404 426 "http://www.yahoo.com" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050511"
    xxx.xxx.xxx.xxx - - [03/Dec/2006:10:49:50 +0000] "POST http://toscontrol.com/CheckProxy.php HTTP/1.0" 404 406 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
    xxx.xxx.xxx.xxx - - [03/Dec/2006:10:51:33 +0000] "GET http://www.hide-my-ip.com/xprox.cgi?ip=74.52.29.146 HTTP/1.1" 404 417 "-" "Mozilla/5.0 (745222)"
    Plus, I’ve done a Google search on my IP address and it appears in various proxy forums !
    These are my questions:
    * Should I be worried (I think yes as I’m concerned they my hide behind my IP address, which could then become black-listed).
    * How do I close my open proxy ?
    * How can I be certain that I'm not running an open proxy ?
    Thanks in advance,
    john
    G5 Server   Mac OS X (10.4.8)   PHP, MySQL

    Thanks Roger for the reply.
    This is a real puzzle ! I wonder if these pages are still sitting in my cache left over from when I was (unintentionally) running an open proxy.
    I’ve just done a quick analysis of last night’s logs and, yet again, I have entries which reference off to other sites and return 200. For example, www.yahoo.com, www.sun.com, www.qq.com. plus some explicit IP address with port mumbers. There’s about 200 in total from about 20 IP address. From the timings they look like robots. Example,
    xxx.xxx.xxx.xxx - - [03/Dec/2006:20:29:02 +0000] "GET http://www.qq.com/ HTTP/1.0" 200 90 "-" "-"
    xxx.xxx.xxx.xxx - - [04/Dec/2006:16:50:33 +0000] "HEAD http://www.sun.com/ HTTP/1.1" 200 0 "-" "Mozilla/5.0 ( Windows; U; Windows 98; DigiExt )"
    xxx.xxx.xxx.xxx - - [04/Dec/2006:17:25:41 +0000] "GET http://xxx.xxx.xxx.xxx:46449/ HTTP/1.0" 200 90 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)"
    But equally, there are far more (thousands) where 404 has been returned !
    xxx.xxx.xxx.xxx - - [04/Dec/2006:19:34:16 +0000] "POST http://www.carhiredeal.com/hitTestAdv.aspx HTTP/1.1" 404 424 "http://www.valuecarrentals.com/" "-"
    xxx.xxx.xxx.xxx - - [04/Dec/2006:19:34:30 +0000] "POST http://ipexposed.com/pr/pst.php HTTP/1.1" 404 413 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;)"
    xxx.xxx.xxx.xxx - - [04/Dec/2006:19:38:43 +0000] "GET http://clickingagent.com/proxycheck.php?ip=xxx.xxx.xxx.xxx&port=80&loc= HTTP/1.0" 404 409 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"
    My current thinking is to stop the IP addresses at the firewall, but this doesn't address the real issue as to why is 200 being returned for some sites ?
    john

  • How to list all currently open Excel files with ActiveX?

    Hello all!
    I would like to program with ActiveX a way to retrieve a list (array of strings) of the filenames of the currently opened Excel files in windows. However, I am fairly new to the ActiveX/Excel business in LV and after hours looking at the "millions" of objects in the property nodes I give up and hope some kind soul here can help me. I couldn't find any information in this forum regarding the same issue, although some were close
    I am using LV 7.1 without the Report Generation Toolkit.
    Thanks!
    /Goran

    Hi KC,
    thanks for your reply. I have in fact been able to find the desired things in the ActiveX properties/methods for Excel in LabView. It took me some looong work going through the functions which I suspected to be the ones. Anyway, I post a little jpeg here of the code if someone ever needs the same functionality. What it does is that it checks how many Excel workbooks are open and controls if each of them matches the searched Excel filename, if one does, it is closed.
    Enjoy
    /Goran
    Attachments:
    List open excel sheets and close open ones.jpg ‏104 KB

  • How come pages won't open PDF files made by Pages?

    How come pages won't open PDF files made by Pages?
    I have files I made with Pages and exported as PDF but I can't open them with pages to edit?
    Also, where are the recent files created by pages located? Can't find those to open either..

    Hi Tom,
    I was delighted when I signed up for Pages. Clunky yes, but it worked. I've been a graphic designer on a Mac for 25 plus years and have logged too many horror stories of "upgrade" wars which cost me massive lost time, data and money forcibly extracted just so I could finish a project.
    When I first used Pages in April of 2012? or there about, I was able to open Word documents exported to .pdf format, emailed to me, which I then dragged into Pages. I could make the changes I needed to make, export as a .pdf, return it back to my client which they could then edit on whatever it was they were using. I'm not a neophyte with this. I've had Original Photoshop as a stand alone, Quark (which locked users out 6 months after I purchased it.) Quark again, Freehand, Pagemaker, Illustrator, Photoshop again, Creative Suite for several upgrades, Acrobat Pro. 2 years ago I lost 6 years of Quicken data and had to and "upgrade" start over. This last go around I  had to "upgrade" my Apple ID - yes I had 2 on purpose, lost my Pandora One and my ability to get into the Tulsa County Library website.
    At this point, I'm retired and feel like what I've paid for in the past should WORK today. I have a 100+ page cookbook in Quark which I was able to export as a .pdf, that I've lost the tags too, Easier to start over. I have artwork that is hundreds of megs in Photoshop. Not the least bit interested in anybody's "cloud".
    Thanks for letting me vent. I'm determined to keep my equipment and software up to date so I can enjoy the skills I've acquired, but I completely cringe at Apple's antics. I truly hate it when I have to respond to some new "tip" or product offer. BooHiss. Happy Turkey Day. Pages is a "turkey" program.
    Best regards, mbd

Maybe you are looking for

  • Report with Planned Order, Frequency and Planned Hours

    Hello Experts, I need a report which can provide me with a list of all the Planned (Preventive) Work Orders, Frequency of the order and the Total planned hours for this work order. Can you please suggest a single report which can provide all these in

  • Open file XDP in live cycle Designer 9.0.1 of SAP

    Hello, I need upload a adobe form, but i dont kown it. The form is a file with extension *XDP. In adobe live cycle designer only import forms in format *XML. Can you help me please? Thanks

  • Error receiver determination

    Hi, i have a problem whith the receiver determination. The receiver determination fails because the Sender Service is used in upper case by the XI. What i can't explain is, that the business system is written in lower case in the SLD and when this sy

  • Mass Change for Vendor CIN (excise) Details.

    Dear Masters, I have an issue to Mass change the Excise data in Vendors master (CIN) details. The concerned table is  (J_1IMOVEND) and the fields are 1) J_1IEXCD 2) J_1IEXRN 3) J_1IEXRG 4) J_1IEXDI Kindly let me know how can this issue be resolved. T

  • Porting modified components across environments

    I am using the HTML code generated for the parameter form of a standard report component in an HTML portlet on a page to call the standard report component. When porting from development to production will these customizations be a problem - do the c