JComboBox cannot drop down,why?

here is the source code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.applet.Applet;
public class Btn extends Applet
     JComboBox cmb1;
     String[] str={"123","456","789"};
     public void init()
          cmb1=new JComboBox(str);
          add(cmb1);
Here you can see there are 3 items with the cmb1,and when the appletviewer
runs,yes,I can see the JComboBox,and the arrow on it,but when I click the
arrow,it doesn't drop down at all.(When I press arrow keys,the current item
also changes,but doesn't dropdown at all).I don't know why.There seems no
errors....

hi,
two 'mistakes':
- use JApplet instead of Applet
- add your items to an applet and set that panel as your applets contentpane like this:import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Btn extends JApplet
    JComboBox cmb1;
    String[] str={"123","456","789"};
    public void init()
     JPanel pnl = new JPanel (null);
     cmb1=new JComboBox(str);
     cmb1.setBounds(10,10,150,25);
     pnl.add (cmb1);
     setContentPane(pnl);
}greetings,
Stijn

Similar Messages

  • JComboBox not dropping

    I have created a few JComboBoxes on an applet. The problem is they only drop down when once they drop, the dropdown box drops further than the applet. If the dropdown box is within the applet it will not drop but it will move through the choices with the arrow keys.
    I coded the GUI first by hand and then in the JBuilder designer and I get the same error in both.
    Any ideas on why this is happening and how I can fix it?
    Thanks

    Compiling the .java under sun solaris, but running the applet from a WinNT and/or Win98 box.
    Here's the first wierd thing. If the applet ( i should probably have mentioned I'm using these combo boxes from an applet ) is run via the appletviewer, i still see the problem. I've actually since added a 2nd combo, which has 4 elements, and i'm seeing the same behaviour here, but this time, add 5 and it works, 4 and it doesn't. Like you say "real erratic behavior ".
    But....
    Run the applet from a browser ( IE5, netscape 4.5 ), and it all works as expected. JComboBox's dropping down as expected on click.
    All very strange. Must be something to with the appletviewer.
    stripped the code down to bare bones;
    import java.awt.*;
    import javax.swing.*;
    public class SimpleTableDB extends java.applet.Applet {
    public void init(){
    String[] stringArray1 = {"One","Two","Three","Four","Five","Six","Seven"};
    JComboBox JComboA = new JComboBox(stringArray1);
    add(JComboA);
    This doesn't work either via appletviewer or from the browser(s), no matter how many elements i add, and whether i populate using an array or a vector.
    Like you said "real erratic behavior ".
    I'm a little happier at least now my applet is working, but i'd like to know why its so erratic, and if there is any way to avoid this.
    Any more ideas ?
    Thanks

  • Combo box in UI (drop down)

    hai,
    i am new to UI, i connect a datasource to combo box, when i navigate move first, next & last the records changing in combo, but i have a problem that "The contents of Combobox cannot drop down /Listed" can any one help me, its Urgent ?

    Hello
    you navigate using sap databrowser or custom controls made by you?
    about selecting by index you may try
    combo.select(index,psk_Index )
    where combo is your combobox and index is the index you want to select, take a watch at help of combobox ui api (you may select by name,value or index)
    i'm not sure about if is this that you want.
    I hope that this help you,please post some code if not
    best regards
    Salvador Biot
    Message was edited by: Salvador Biot

  • HT5610 How can You authorise your Windows Vista computer??? I do not get this drop down menu nowI cannot get this here, have been trying for hours, why is this so uncooperative? My first impression of I tunes is not so good after that.

    How can you authorise your windows vista computer to play stuff you downloaded from itunes???  I cannot get this drop down menu shown on your support pages whatever I do.    I have been trying for ages.  This is not a good first impression.

    Authorize a Mac or PC
    Review the following before you authorize a computer:
    You can authorize up to five computers with your Apple ID.
    You must authorize your computer to download past purchases, use Home Sharing, or use the Automatic Downloads setting.
    You can play unprotected music that's in the AAC file format without authorizing your computer. This includes iTunes Plus tracks and content  from sources other than the iTunes Store, like your audio CDs.
    To authorize a computer, follow these steps:
    Open iTunes.
    Choose Store > Authorize This Computer from the menu bar.
    You may need to show the menu bar to see this option in Windows.     In earlier versions of iTunes, you can access this option from the Advanced menu.
    Enter your Apple ID and click Authorize.
    If your Apple ID uses an expired MobileMe account, you can still authorize your computer.
    In some cases, iTunes may ask you to authorize the computer again. iTunes should use the same authorization as before if the computer is in your  list of authorized computers.
    Learn what to do if iTunes repeatedly asks you to authorize when you try to play your content.
    http://support.apple.com/kb/ht1420
    Note : If you are Unable to see the Store Tab on your iTunes then click anywhere on your iTunes and press
    Ctrl + B key on your keyboard once and you should be able to see the Store tab in your iTunes.

  • Cannot edit my navigation bar / drop down menu

    Somebody pls help me! I am new to Dreamweaver, but have been
    studying it heavily the pst 3 weeks (using Sams Teach Yourself
    book).
    I have inherited a site and switched their navigation bar
    from the current one to a different (drop down) that was stored in
    the library folder. I have TRIED AND TRIED to edit these links ,
    add drdop down items, delete some, etc but cannot seem to access
    the 'show pop up menu' option...it is GRAYED OUT.
    When I open the library file...only a navigation bar is in
    it. I select one of teh nav buttons, and I am SUPPOSE to see the +
    sign in the behavior panel in bold, but it stays grayed out no
    matter what I do. I have tried double clicking the text (on
    MouseOver), as an MX user suggested, but no menu of options pops up
    here at all (although it did for her). Furthermore, I even tried
    right clicking on the behavior panel where the "on Mouse Over"
    identifies the action as "ShowPop Up Menu" (vs. hide pop up menu)
    and I DO get a pop up menu with "EDIT BEHAVIOR" as an option. I
    click on this, and nothing happens.
    UGH! WHY CAN'T I EDIT THIS???
    Thanks so much for your help!

    I think your friend is confused. You have never been able to
    edit the DW/FW
    pop-up menus in a template controlled page in any version of
    DW. This is
    but one of the many reasons one would never want to use these
    menus. There
    are so many better ways to do them, and Alan has given you
    some links....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "wwjen" <[email protected]> wrote in message
    news:ed41u9$k5q$[email protected]..
    > Hmmmm. So even though my friend could edit the file in
    her Dreamweaver
    > MX, you
    > are saying Dwvr 8 it does not work right?
    > I did try re-creating the navbar in a 'basic page' by
    setting it up like a
    > table (library item was also set up like a table vs.
    "inserting navgation
    > bar"), but then I had a code error that affected ALL my
    pages (totally
    > erased
    > the body of all pages). I do not understand code , but
    my friend said
    > having
    > the html navbar file vs the library item created
    overlapping <head> tags.
    >
    > What else might you suggest? I appreciate your time and
    insight!
    >

  • Cannot change Email Preference in Drop Down Box

    All my software is up to date on Snow Leapord. I use AOL Desktop for accessing my email and it is the most current AOL Desktop for Mac 1.7.722 (722). I just did the desktop upgrade 2 weeks ago.
    I can no longer send pictures through AOL.
    When I go to iPhoto preferences > General > the drop down box next to "Email photos using: has "Mail" highlighted. I cannot choose anything else. They are all greyed out (AOL, Eudora and Microsoft Entourage). I don't use Eudora or Entourage so they don't matter to me, but all 3 cannot be used. I have tried everything to get it to recognize AOL but it does not.
    I called AOL and they had me unistall every AOL application and file on the computer and reinstall the new AOL desktop again but this did not work either. They said it was not their problem and must be with Apple and iPhoto.
    When I called Apple (I have Apple care), they gave me a work around to send photos to the desktop and then attach to an AOL email, They could not help me otherwise, but I would rather use it the way I used to. Why won't it allow me to pick AOL (Which is shown in the drop down)
    Can anyone give me help.

    A good general step for strange issues is to renew the iPhoto preference file - quit iPhoto and go to "your user name" ==> library ==> preferences ==> com.apple.iPhoto.plist and trash it - launch iPhoto which creates a fresh new default preference file and reset any personal preferences you have changed and if you have moved the iPhoto library repoint to it. This may help
    This does not affect your photos or any database information (keywords, faces, places, ratings, etc) in any way - they are stored in the iPhoto library - the iPhoto preference file simply controls how iPhoto works - which is why renewing it is a good first step.
    also note that you probably can select the photo(s) and drag them to the AOL Desktop icon in the Dock to create your e-mail
    I just did the desktop upgrade 2 weeks ago.
    I can no longer send pictures through AOL.
    To me this clearly says that the issue is AOL desktop since it worked until you upgraded and after upgrading does not

  • Loaded Yosemeti, cannot access App Store nor iBook  Cannot sign out from store drop down menu , app crashes and will contact Apple.

    Loaded Yosemeti, Cannot access App Store. It shows I am signed in but when I try to sign out of App Store from the store drop down menu the application crashes and says "will send to Apple on re-open". I can access iTunes okay, just checked iBook store and cannot access this either.

    yup, me too. Only  havent made any changes to any of my 4 Ale/Mac Devices,. Im not sue why so i guess we ait and try later...?

  • In the new Pages 5.0, what is the page break shortcut key. I cannot find the key as indicated on the drop down menu.

    in the new Pages 5.0, what is the page break shortcut key (it used to be the Fn + enter). I cannot find the (new) key as indicated on the drop down menu. Please help.

    Hi Bruce and fruhulda,
    ok, I found the keyboard viewer, it only shows the traditional symbol 'return'.  something like a sideway u-turn continued with the arrow under.  This is the Canadian or US keyboard. 
    btw thanks for your suggestion.

  • Why is my page set up drop down different from your illustration in help for printing background

    ''duplicate - https://support.mozilla.com/en-US/questions/830795''
    The page set up drop down menu looks nothing like the illustration in help. It does not include a box to check for "print background. How do I print background

    first, does it sound like I set it up correctly from what I wrote?
    Yes, all sounds correct.
    Second, I heard that adding a b/g AX to the network will slow everything down to b/g speeds but I have also read that simply using B/G AX's to add speakers by joining the network will not slow down the N network....which is it?
    The b/g AX devices will not slow down the network unless they are actively streaming AirTunes. Even then, audio streaming does not require a great deal of bandwidth, so for the most part, the effect would be negligible. Don't worry about it.
    Is my network slowed down to b/g speeds because of my speaker set up or not?
    The speed on your network will depend on a number of factors..are you downloading something while copying something else? Are you simply browsing? How far is the computer from the closest wireless access point?
    You can check your current available bandwidth on your local network by doing the following:
    Hold down the option key on your Mac while you click on the fan shaped AirPort icon at the top of the screen. Look for the Transmit Rate number.
    "g" wireless = 54 Mbps
    What do you see?
    Oh, and by the way, I don't know if this matters, but while the time capsule serves as the main base station, it is in bridge mode because it is plugged into a 2wire gateway router.
    If the Time Capsule is in bridge mode, it cannot act as the main base station. If you want, you could think of it that way if you are using the wireless on the Time Capsule as your preferred network, but the Time Capsule is not the "main" router.
    Message was edited by: Bob Timmons

  • Cannot remove autocomplete entry from address bar; have already cleared history, and entry is not in the drop-down menu of the address bar either.

    I am having problems removing an autocomplete entry from my address bar; I have tried clearing my history, so it's no longer in that, and I do not have it bookmarked either, so it's not getting the URL from that location either. The autocomplete entry isn't even showing up in the drop down menu, so I can't even scroll through that to delete it.
    Basically, I want to be able to type "st" and go to "store.steampowered.com"; however, despite numerous times of typing in "st" and then going down into the drop-down menu to choose "store.steampowered.com", the bar continues to autocomplete "steamtrades.com", which is exceptionally annoying because I do not have that website bookmarked, or in my history, yet it continues to autocomplete to that address, which I do not want it to autocomplete to, and cannot figure out how to remove because I've already cleared my history multiple times, do not have it bookmarked, and it is not showing up in the drop down of the address bar for me to go down and force delete it.

    Did you try to remove some letters from steamtrades.com to see if that bring this entry up in the drop-down list?
    If it is not in the history then it might be present with a typed=1 flag indicating that you have typed or pasted it in the location bar.
    You can use the SQLite Manager extension in Firefox to inspect the places.sqlite file to see if this entry comes up in the moz_places table.
    *SQLite Manager: https://addons.mozilla.org/firefox/addon/sqlite-manager/
    <pre><nowiki>SELECT datetime(visit_date/1000000,'unixepoch') AS visit_date, url, title, visit_count, frecency
    FROM moz_places, moz_historyvisits
    WHERE moz_places.id = moz_historyvisits.place_id AND url LIKE '%steamtrades.com%'</nowiki></pre>

  • I can no longer organize my drop down book mark list ,from the toolbar in alphabetical order like I used to Why ?

    Used to, I could organize my drop down book mark list from the tool bar, in alphabetical order from A-Z by clicking on view, sort by, select . Now every time I add a new bookmark it goes to the bottom of my bookmark list in Unsorted bookmarks . I can go to the bookmarks and sort the menu in Alpha. order. However, when I go back and drop down the bookmark list from the tool bar, the new bookmarks are still in the Unsorted list at the bottom. The bookmark's menu may or not have them in assorted list. This occurred several updates back. Why can I no longer sort the drop down book marks list in A-Z alph. order? This is a major obstacle when trying to search for a particular bookmark that I have made in the not too distant past.

    That did solve my problem. Madperson Thank You Very Much!!!!! I'm not real literate on the mechanics of working computers even though I use them all the time. Basically I'm a point & click kinda guy and beyond that I'm pure novice! This is going to save me a lot of wasted time.
    Allen C. Geiser
    ageiser34

  • I have two faults! 1, an error comes up in Ps CC 2014 "could not apply the saved panel configuration, restring to default and my tools have disappeared completely and anything ive tried I cannot get them back not even the drop down menu in 'window' helps

    I have two faults! 1, an error comes up in Ps CC 2014 "could not apply the saved panel configuration, restring to default and my tools have disappeared completely and anything ive tried I cannot get them back not even the drop down menu in 'window' helps at all. And 2, Lr everytime I load it up it gives me the option to retry or switch to and it takes a while for me to even get anywhere with it I think it has something to do with the catalogs? I've been using these programs for a few years now on a Mac...no problem but when I use a PC when I'm away coz it's the (only) comp available these happen PC's are so useless! Please can anyone help??...

    I can give a few suggestions on Photoshop CC 2014, but Lightroom is a separate forum and you should ask Lr questions there.
    First close Photoshop.
    Then start Photoshop by double-clicking on it's icon and very quickly after that, hold down the ctrl-alt-shift keys until you see the reset dialog. answer "Yes" to delete settings, and let Photoshop continue to load.
    It's tricky to do and may take a few tries, but at least it should reset Photoshop CC 2014 to defaults.
    Gene

  • SP2010 Bug? Cannot change List View in Ribbon. List view drop down not responding?

    In all of my Libraries I have 3-5 views (standard and custom), I cannot select them from the Ribbon thought, the drop down button does not respond when clicked (nothing happens):
    When going with the mouse over the drop down button it shows "javascript:;" in the IE status bar.
    The only way to change the view, for the moment, is to do it via Library Settings and set the selected view as default.
    Is this a know issue? Is there any settings that I`m missing?
    Many thanks!
    Cheers,
    marek 

    Following is missing in master page, add this and it should work.
    Where to add?? see the appropriate place from V4 master.
    <Sharepoint:UIVersionedContent runat="server" UIVersion="4">
        <ContentTemplate>
         <Sharepoint:SPNavigationManager
         id="TreeViewNavigationManagerV4"
         runat="server"
         ContainedControl="TreeView"
         CssClass="s4-treeView"
         >
           <SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/viewlsts.aspx" id="idNavLinkSiteHierarchyV4" Text="<%$Resources:wss,treeview_header%>" accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"
    CssClass="s4-qlheader" />
            <div class="ms-treeviewouter">
           <SharePoint:DelegateControl runat="server" ControlId="TreeViewAndDataSource">
             <Template_Controls>
            <SharePoint:SPHierarchyDataSourceControl
             runat="server"
             id="TreeViewDataSourceV4"
             RootContextObject="Web"
             IncludeDiscussionFolders="true"
            />
            <SharePoint:SPRememberScroll runat="server" id="TreeViewRememberScrollV4" onscroll="javascript:_spRecordScrollPositions(this);" style="overflow: auto;height: 400px;width: 155px; ">
              <Sharepoint:SPTreeView
             id="WebTreeViewV4"
             runat="server"
             ShowLines="false"
             DataSourceId="TreeViewDataSourceV4"
             ExpandDepth="0"
             SelectedNodeStyle-CssClass="ms-tvselected"
             NodeStyle-CssClass="ms-navitem"
             SkipLinkText=""
             NodeIndent="12"
             ExpandImageUrl="/_layouts/images/tvclosed.png"
             ExpandImageUrlRtl="/_layouts/images/tvclosedrtl.png"
             CollapseImageUrl="/_layouts/images/tvopen.png"
             CollapseImageUrlRtl="/_layouts/images/tvopenrtl.png"
             NoExpandImageUrl="/_layouts/images/tvblank.gif"
              >
              </Sharepoint:SPTreeView>
            </Sharepoint:SPRememberScroll>
             </Template_Controls>
           </SharePoint:DelegateControl>
            </div>
         </Sharepoint:SPNavigationManager>
        </ContentTemplate>
       </SharePoint:UIVersionedContent>

  • I don't have pdf documents listed as a file type in the applications drop down menu so I cannot manage the handling of these file types. How do I get the pdf file recognised?

    I don't have pdf documents listed as a file type in the drop down applications menu, so cannot handle these. How do I add a file type?

    After a little Googling, it looks like B.Media is a content management system from Wave Corporation used for making catalogs. Doubtful you'd be able to license it at less than an enterprise level.

  • While using a drop-down menu i.e. File, edit, image, or even when saving as and choosing the file type; the list appears and I am able to highlight what i want but cannot click on anything.

    While using a drop-down menu i.e. File, edit, image, or even when saving as and choosing the file type; the list appears and I am able to highlight what i want but cannot click on anything. This is becoming incredibly frustrating. It happens at random time and a restart of the computer is all that helps, then with out any notice it starts to do this again.  Mac Book Pro i7 2.2 16 GB 1333 Ram, (2) 450GB SSD both internal to machine. At this point I am losing file because I am unable to save in the file type I need. Does anyone out there know how to solve this issue?
    Thanks
    phil

    I haven't been unify photoshop much in the past month, but I did try your suggestion and it seemed to work for a while. Today when i went to save a document the same thing happened: click on file>save at this point I can not click on save even though it is highlighted. Tryed to use command s that brings up the save dialogue box, but when I try to change file type I again cannot select it from the drop down menu.

Maybe you are looking for