Down arrow disappears on JComboBox

I have a problem, I�m trying to make a JComboBox in an interface, but when I add it to my JPanel the down arrow wont show:
http://img290.imageshack.us/img290/5240/erroruv9.jpg
Code looks like this, most of it is not important but the funny part is that when I add the JComboBox initiated in startsida() it works fine, but when I add the JComboBox initiated in skapaContainerWindow() it doe�snt work. It seems that ActionListener messes up something, because if I add the pnlContainerWindow in the constructor it works fine. Any ideas?
import java.awt.*;
import java.awt.event.*;
import javax.swing.border.*;
import javax.swing.*;
import java.util.*;
public class Window extends JFrame implements ActionListener {
     //************ Variabler **************************************************
     Container c;
     //Skapa profilerna
     Vector<Profil> profiler;
     Profil KarlKarlsson, AnnaEriksson, AndersSvensson;
     //F�r headern
     JPanel pnlHeader;
     JLabel lblHeaderBack;
     //Startsida
     JComboBox boxStartsidaProfiler;
     JPanel pnlStartsidaContainer ;
     JButton btnStartsidaNyProfil, btnStartsidaLogin;
     //Ny Profil
     JPanel pnlNyProfilContainer;
     JButton btnSkapaNyAnv;
     //F�r menyn
     JPanel meny;
     //Huvudcontainern
     JPanel pnlContainerWindow;
     //F�r Min Sida
     JPanel pnlMinSidaKnappar;
     JButton btnMinSidaAndraProfil;
     JPanel pnlMinSida;
     JLabel lblMinSida;
     JComboBox boxTest;
     //H�jd och bredd p� containerna
     public static final int MAIN_X = 0;
     public static final int MAIN_Y = 0;
     public static final int MAIN_W = 617;
     public static final int MAIN_H = 491;
     public static final int SECONDARY_X = 0;
     public static final int SECONDARY_Y = 0;
     public static final int SECONDARY_W = 595;
     public static final int SECONDARY_H = 425;
     // ********************** Kontruktor **************************************
     public Window() {
          //Skapa alla sidor som beh�vs
          skapaProfiler();
          startsida();
          skapaHeader();
          skapaNyProfil();
          skapaMeny();
          skapaContainerWindow();
          c = getContentPane();
          c.setLayout(null);
          c.setBackground(new Color(192,192,192));
          //L�gg till.
          c.add(pnlStartsidaContainer);
          c.add(pnlHeader);
          this.setSize(800,600);
          this.setVisible(true);
          this.setResizable(false);
         this.setTitle("SUPERPORRGRAM");
         //this.setIconImage(trayIcon);
          this.setDefaultCloseOperation(EXIT_ON_CLOSE);
     // ********************** Skapa profiler som ska synas i inloggningsf�nstret*
     public void skapaProfiler() {
          profiler = new Vector<Profil>();
          //Egentligen ska dessa h�mtas fr�n n�gon databas, men h�r skapar vi dem bara.
          KarlKarlsson = new Profil("Karl Karlsson", "70", "30", true);
          AnnaEriksson = new Profil("Anna Eriksson", "55", "22", false);
          AndersSvensson = new Profil("Anders Svensson", "85", "25", true);
          profiler.add(KarlKarlsson);
          profiler.add(AnnaEriksson);
          profiler.add(AndersSvensson);
     // ********************** Skapa headern ***********************************     
     public void skapaHeader() {
          pnlHeader = new JPanel();
          pnlHeader.setLayout(null);
          pnlHeader.setBounds(0,0,800,72);
          lblHeaderBack = new JLabel(new ImageIcon("gfx\\logoBack.png"));
          lblHeaderBack.setBounds(0,0,800,77);
          pnlHeader.add(lblHeaderBack);
          pnlHeader.setBackground(new Color(104,225,255));
     // ********************** Skapa startsidan*********************************     
     public void startsida(){
          pnlStartsidaContainer = new JPanel();
          pnlStartsidaContainer.setLayout(null);
          pnlStartsidaContainer.setBounds(75,100,300,300);
          pnlStartsidaContainer.setBackground(Color.WHITE);
          pnlStartsidaContainer.setBorder(new TitledBorder(new LineBorder(Color.BLACK, 1), "V�lj profil"));
          boxStartsidaProfiler = new JComboBox();
          for (int i=0; i<profiler.size(); i++) {
               boxStartsidaProfiler.addItem(profiler.get(i).getNamn());
          boxStartsidaProfiler.setBounds(20,20,200,40);
          boxStartsidaProfiler.addActionListener(this);
          btnStartsidaLogin = new JButton("Login");
          btnStartsidaLogin.addActionListener(this);
          boxStartsidaProfiler.setBounds(10,20,150,30);
          btnStartsidaLogin.setBounds(10,140,150,30);
          btnStartsidaNyProfil = new JButton("Skapa ny profil");
          btnStartsidaNyProfil.addActionListener(this);
          btnStartsidaNyProfil.setBounds(10,80,150,30);
          pnlStartsidaContainer.add(boxStartsidaProfiler);
          pnlStartsidaContainer.add(btnStartsidaNyProfil);
          pnlStartsidaContainer.add(btnStartsidaLogin);
     // ********************** Skapa ny Profil-sidan ***********************************     
     public void skapaNyProfil() {
          pnlNyProfilContainer = new JPanel();
          pnlNyProfilContainer.setLayout(null);
          pnlNyProfilContainer.setBounds(75,100,300,300);
          pnlNyProfilContainer.setBackground(Color.WHITE);
          pnlNyProfilContainer.setBorder(new TitledBorder(new LineBorder(Color.BLACK, 1), "Skapa ny profil"));
          btnSkapaNyAnv = new JButton("Skapa profil!");
          btnSkapaNyAnv.addActionListener(this);
          btnSkapaNyAnv.setBounds(20,200,150,30);
     // ********************** Skapa menyn ***********************************     
     public void skapaMeny() {
          meny = new JPanel();
          meny.setLayout(null);
          meny.setBounds(9,102,151,92);
     // ********************** Skapa huvudcontainer *****************************     
     public void skapaContainerWindow() {
          pnlContainerWindow = new JPanel();
          pnlContainerWindow.setLayout(null);
          pnlContainerWindow.setBackground(Color.WHITE);
          pnlContainerWindow.setBounds(166,73,Window.MAIN_W,Window.MAIN_H);
          pnlContainerWindow.setBorder(new TitledBorder(new LineBorder(Color.BLACK, 1), "Container - Denna ska bort"));
          boxTest = new JComboBox();
          boxTest.addItem("Alternativ 1");
          boxTest.addItem("Alternativ 2");
          boxTest.addItem("Alternativ 3");
          boxTest.addItem("Alternativ 4");
          boxTest.setBounds(20,20,150,30);
          boxTest.addActionListener(this);
          pnlContainerWindow.add(boxTest);
     //************ Actions ****************************************************
     public void actionPerformed(ActionEvent e) {
          //Actions fr�n skapa ny profil
          if (e.getSource()==btnSkapaNyAnv) {
          //Felkontrollen h�r!!
               c.remove(pnlNyProfilContainer);
               c.add(pnlStartsidaContainer);
               c.repaint();               
          //Actions fr�n startsidan
          if (e.getSource()==btnStartsidaNyProfil) {
               c.remove(pnlStartsidaContainer);
               c.add(pnlNyProfilContainer);
               c.repaint();               
          if (e.getSource()==btnStartsidaLogin) {
               c.remove(pnlStartsidaContainer);
               c.add(meny);
               c.add(pnlContainerWindow);
               repaint();               
     //************ Mainmetod***************************************************
     public static void main(String[] args) {
     Window window = new Window();     
}

Swing related questions should be posted in the Swing forum.
Code looks like this, most of it is not important If its not important then don't post it!. We don't want to read through hundreds of lines of unnecessary code.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags so the code retains its original formatting.

Similar Messages

  • ComboBox Down Arrow Disappearing

    Good Day
    Experts:
    I have a peculiar situation with a few of my ComboBoxes.  When I switch to FIND mode, the odd behavior begins.  A vertical line appears to the left of the down arrow essentially making the last part of the ComboBox a square around the arrow.  Then after I make a selection from the list, the arrow disappears! If I click where the arrow should be I still get the list of items in the box. 
    This is not happening on some of my other screens.  I cannot find any differeces.
    Has anyone ever experienced this?  If so, what do I have wrong?
    Thanks,
    EJD

    Ed,
    whenever i had display problems in user forms i tried to solve it with oForm.Refresh and/or oForm.Update
    maybe it helps - at least you can try it
    regards
    David

  • Disabling UP and DOWN arrow keys in JComboBox

    I noticed that JComboBox by default toggles the popup menu up or down when it has focus and the user presses UP and DOWN arrow keys (I am working with JRE 1.3.1). I think this is not consistent with the documented key assignments for JComboBox. But -apart of this- I am trying without success to write a JComboBox extension that ignores UP and DOWN keys.
    Does anyone have any idea? Thanks in advance!

    Hi,
    something like this?:public class MyCombo extends JComboBox {
         public MyCombo() {
              super();
              addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode() == KeyEvent.VK_UP || e.getKeyCode() == KeyEvent.VK_DOWN) {
                             e.consume();
    }

  • Down arrow in scroll bar disappears

    I have a user using Acrobat Professional 8 on Windows XP Pro. When she opens a document in Acrobat she can scroll trought the document using the up and down arrows in the scroll bar. Then, at seemingly random times, the down arrow disappears and she has to restart Acrobat to get it back. Does anyone have any experience with or suggestions for fixing this problem?

    Check the properties of the file, in the Initial View Tab > Hide Windows Controls is not checked. You should always be able to scroll with a scrolling mouse.
    Appligent Document Solutions
    http://www.appligent.com

  • The down arrow of the msctls_updown32 control can fail to display under certain conditions using certain Windows Desktop themes

    I have a very odd issue with the msctls_updow32 control. Depending on the type of window or window heirarchy, when I click the up arrow with the autobuddy being an edit control, the down arrow disappears off the down button. I have to move the mouse back
    over the down button to get it to display. At first I figured it was something in my OnCtlColor code. But I found that the updown control is never passed to OnCtlColor. I get the window class of each input and it never shows up. Nor does it's window handle
    get passed in. Turning off OnCtlColor code and going default doesn't help. What I have found that helps is to turn off WIndows 7 Aero desktop and turn on Windows Classic desktop (Windows 7 Basic has the issue too). I also found that applying a skin to my app
    avoids the issue. Using spy I finally found what appears to be a connection to EM_SETSEL. When that message is sent and processed, the arrow has disappeared. I finally gave up and created my own subclass of a CEdit control (MFC) and called SubclassDlgItem.
    Then I implemented WindowProc and trapped the EM_SETSEL. Then I had to call UpdateWindow on the spin control and finally get the rectangle of the edit (buddy) and spin control and use that in a call to the parent (dialog) window's RedrawWindow.
     So there appears to be an issue with the updown control paired with an edit control that shows up depending on what desktop theme I am using. And to top it off, the window heirarchy seems to matter too (or perhaps the styles of the parent make a difference
    as I found the issue doesn't show up on every window that may contain such a configuration). Consider this a heads up regarding the issue! One other note, changing to any of the "High contrast" Windows 7 desktops also avoids the issue. So Aero and
    Basic seem to be the key.
    R.D. Holland

    Fails on Win 8.1 too. As with Win 7, changing the desktop display to one of the high contrast ones avoids the problem. My work-around is below. I have a video showing the problem. It also shows the display being changed to high contrast and how the problem
    goes away. If only I could figure out how to use this web page to upload the zip file containing the video ...
    LRESULT Myedit::WindowProc( UINT message, WPARAM wParam, LPARAM lParam )
    LRESULT lr = CEdit::WindowProc( message, wParam, lParam );
    if( message == EM_SETSEL )
    CDialog* pParent = (CDialog*) GetParent();
    if( pParent )
    CSpinButtonCtrl* pSpin = (CSpinButtonCtrl*)pParent->GetDlgItem(IDC_SMALL_PARTS_SPIN);
    if (pSpin)
    CRect rectSpin;
    pSpin->GetWindowRect( &rectSpin );
    CRect rectEdit;
    GetWindowRect( &rectEdit );
    CRect both;
    both.UnionRect( &rectSpin, &rectEdit );
    pParent->ScreenToClient( &both );
    //pParent->InvalidateRect( &both );
    //pParent->Invalidate();
    //pSpin->Invalidate();
    pSpin->UpdateWindow();// skip this and the problem remains.
    pParent->RedrawWindow(&both);// skip this and the problem remains.
    return lr;
    R.D. Holland

  • In the top left on my screen where the back arrow is, there used to be a drop down arrow to skip back many pages. After installing 4.0.1, it has disappeared. How do I get it back?

    In the top left on my screen where the back arrow button is to go back to previous webpages, there used to be a drop down arrow just to the right so I can see many of my previous web pages. Since installing Firefox 4.0.1, that arrow disappeared.

    You can get the drop down list by either right-clicking on the back/forward buttons, or holding down the left button until the list appears.
    If you want the drop-down arrow you can add it with the Back/forward dropmarker add-on - https://addons.mozilla.org/firefox/addon/backforward-dropmarker

  • The tab list drop down arrow has disappeared and can't be restored through the customize dialog.

    The dropdown arrow used to be there, as well as the tab scroll arrows when many tabs are open. But both suddenly disappeared. When I bring up the customize dialog, I can then see the drop down arrow in the tab bar, but if I click restore default set and close the customize dialog, there is still no dropdown arrow. If I open the customize dialog and drag the arrow into the dialog, it shows up there. But if I try to drag it back to the tab bar and then click Done, it still does not appear.

    You will only see the "List All Tabs" button in Firefox 12+ if there are that many tabs open that you get the Tab bar scroll buttons appearing.
    * Permanent List-all-tabs Button: https://addons.mozilla.org/firefox/addon/permanent-listalltabs/
    Alternatively you can add code to the userChrome.css file below the default @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    The customization files userChrome.css (interface) and userContent.css (websites) are located in the chrome folder in the Firefox profile folder.
    *http://kb.mozillazine.org/Editing_configuration
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #tabbrowser-tabs ~ #alltabs-button { visibility:visible!important; }</nowiki></pre>

  • Down arrow in scrolling  bar has disappeared

    On most screens the down arrow in the scrolling bar has disappeared or occupies the same space as the page expansion square in the lower right hand corner. Tried having the up arrow both at the top and at the bottom of the scrolling bar. Diappearance occurs on all screens originating from Firefox. It is available on this screen and most linked pages from Firefox.

    Check the properties of the file, in the Initial View Tab > Hide Windows Controls is not checked. You should always be able to scroll with a scrolling mouse.
    Appligent Document Solutions
    http://www.appligent.com

  • The up down arrow box on side of e-mail has disappeared

    on my e-mail pages the blow up down arrow box on the side has disappeared making it impossible to scroll through mail

    hmmm ok so Firefox Crashed and it hasn't worked properly with your email since
    I wander if it is corruption in your existing profile ?
    here is a link here on how to setup a second profile, you could do this to test if the old one is causing the trouble. it's for setting up profiles on Windows, I'm not sure what OS you are using.
    [http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows Setting up a new Profile for Firefox ]

  • JComboBox is not displaying the down arrow..

    jComboBox is not displaying the down arrow..
    I was first using the "choice" component but was having problems with the size only on Unix. So I changed it to a jComboBox and I'm having problems on both NT and UNIX. First the down arrow doesn't show up on NT....and the drop down doesn't even show up on UNIX.
    Any ideas?
    Thanks!
    pt

    could be coz you have not left enough room for it on the layout of your JPanel?

  • JComboBox - selection down arrow not appearing

    Hi All,
    I am writing a swing application which uses a JComboBox with a Vector<String> as it's constructor arguments. This JComboBox is then added to a JPanel derived class which is in turn added to a JFrame. The JComboBox works fine but the selection down arrow does not appear for some reason.
    So I built a quick test application (in a similar fashion) and the JComboBox also works fine but this time the selection down arrow does appear.
    I can't figure out what I'm doing different. Can anyone tell me the circumstances under which the down arrow will / will not appear in a JComboBox?
    Thanks,
    Dougall

    Hi,
    The reason I had used this approach is that sometime I wish the content pane to hold a JPanel type component (only) and sometimes a JTable type (only). I had (foolishly perhaps) assumed that this would not be possible with a standard layout manager.
    As es5f2000 suggests I shall investigate a CardLayout manager.
    If this does not succeed I shall keep the present system which currently works fine (maybe performance issues?). The bounds and size of the parent container are both work fine so long as I remember to call .validate() on the new component being added to the JFrame.
    The JFrame itself is specifically set to be a fixed non-resizable size, surely this is a case in which although not recommended, it's ok to use absolute positioning?
    Thanks again,
    Dougall

  • Upgrade to B1 9.1 - Golden Arrows Disappear

    When we upgraded from 8.82 to 9.1 some of the drill-down (golden) arrows disappeared from the query results.  Why are they still present in some columns but disappeared from others?  The query below worked perfectly before the upgrade...
    SELECT
                      a.[U_ses_EmpAsgn] 'Assigned'
                  ,   a.[DocDueDate] 'B/L Date'
                  , T0.[DocNum] 'PO#'
                  , T1.[DocNum] 'Return'
                  , T2.[DocNum] 'SO#'
                  , T3.[DocNum] 'Partial'
                  ,   a.[NumAtCard] 'Ref#'
                  ,   a.[CardName] 'Company'
                  ,   a.[U_TRC_BOL] 'B/L#'
                  ,   a.[Comments] 'Note'
    FROM
    SELECT
              T0.[DocNum], T0.[JrnlMemo], T0.[CardName], T0.[NumAtCard], T0.[DocDueDate], T0.[U_TRC_BOL], T0.[U_ses_EmpAsgn], T0.[Comments], T0.[ObjType], T0.[DocEntry] FROM OPOR T0  WHERE T0.[DocStatus] = 'O' and ISNULL(T0.[U_TRC_BOL],'') <>''
    UNION
    SELECT
              T1.[DocNum], T1.[JrnlMemo], T1.[CardName], T1.[NumAtCard], T1.[DocDueDate], T1.[U_TRC_BOL], T1.[U_ses_EmpAsgn], T1.[Comments], T1.[ObjType], T1.[DocEntry] FROM ORDN T1  WHERE T1.[DocStatus] = 'O' and ISNULL(T1.[U_TRC_BOL],'') <>''
    UNION
    SELECT
              T2.[DocNum], T2.[JrnlMemo], T2.[CardName], T2.[NumAtCard], T2.[DocDueDate], T2.[U_TRC_BOL], T2.[U_ses_EmpAsgn], T2.[Comments], T2.[ObjType], T2.[DocEntry] FROM ORDR T2  WHERE T2.[DocStatus] = 'O' and ISNULL(T2.[U_TRC_BOL],'') <>''
    UNION
    SELECT
              T3.[DocNum], T3.[JrnlMemo], T3.[CardName], T3.[NumAtCard], T3.[DocDueDate], T3.[U_TRC_BOL], T3.[U_ses_EmpAsgn], T3.[Comments],  T3.[ObjType], T3.[DocEntry] FROM ODLN T3  WHERE T3.[DocStatus] = 'O' and ISNULL(T3.[U_TRC_BOL],'') <>''
    a
    LEFT JOIN OPOR T0 on a.[DocEntry] = T0.[DocEntry] and a.[ObjType] = T0.[ObjType]
    LEFT JOIN ORDN T1 on a.[DocEntry] = T1.[DocEntry] and a.[ObjType] = T1.[ObjType]
    LEFT JOIN ORDR T2 on a.[DocEntry] = T2.[DocEntry] and a.[ObjType] = T2.[ObjType]
    LEFT JOIN ODLN T3 on a.[DocEntry] = T3.[DocEntry] and a.[ObjType] = T3.[ObjType]
    FOR BROWSE

    Hi Nagarajan,
    according to the Note (2037350 - When you run a query in the Query Generator, you find that the link arrow in the Document Number (DocNum) column is missing.) that I mentioned in my earlier Reply, SAP states that this behaviour is an application error and is fixed with 9.0 PL14.
    Now, I have not had any time to verify that myself. Also, I don't know which 9.1 PL Alicia is using (if in her PL the 9.0 PL14 fixes are included) but based on the details from the Note, it should be no problem for Alicia to test and verify it. Using the DocEntry was also mentioned as a workaround in the Note, so again Alicia must know about it by now.
    Kind regards,
    Sonja

  • The up and down arrows for the Finder columns are difficult to bring into view - any way to make them easier or permanent?

    Hi -
    My husband works with multi-level folders, each with way more content than will fit on the screen.  He says that he can't get the up and down arrows to show up when he is looking for a file in Finder, or wanting to move or copy files to another folder several layers up.  They will apparently show up at times, but if he isn't fast enough, they disappear before he can get his mouse over to them.  He cannot use a Magic Mouse or a touchpad, which would solve the problem with finger gestures.  He thinks this happened when I put Lion on our computers several months ago.  My own files are not so extensive, and I can use a Magic Mouse, so I haven't noticed any problem.
    Was there a change in Lion - assuming that finger gestures would replace the up and down arrows onscreen?  Is there a workaround to get this functionality back?
    Any help would be appreciated, thanks!

    Canon cameras don't play will with other FireWire devices on the same bus. You could try disconnecting the WD drive and connecting the camera directly to the computer without and capturing to the internal drive. It should be fast enough for DV.
    One probably is that your version of FCE is not supported on the version of the OS you are running. The last version I think that works with that software is 10.4.10 or earlier.

  • Where have my up and down arrows gone?

    Upgraded my MacBook to Firefox 26.0 and scrolling up and down arrows on the right side have disappeared. If I just use my touch pad it skips around and is very frustrating. I want my arrows back! Can't find anything in preferences to change. Mac is running 10.9.1
    Please help?

    On Mac the scroll bars can be hidden and only have them show when you scroll the page so you can see the current scroll position.
    The idea is that a touch pad is used that doesn't require the scroll bars to be visible and thus have more screen estate for the browsing area.
    You can make the scroll bars always visible:
    System Preferences > General > Show Scroll Bar > Choose "Always"
    *http://heresthethingblog.com/2013/02/25/mac-tip-missing-scroll-bars/

  • Why have I lost the up/down arrows on the right side of inbox page?

    The up/down arrows have disappeared. I haven't been able to recover them. Without them, I can't search my full list of inbox emails. I'm stuck. Is there a particular control to retrieve them?

    Can you post a screenshot of your problem?
    http://support.mozilla.org/en-US/kb/how-do-i-create-screenshot-my-problem

Maybe you are looking for

  • Error -: AIP-18510 while deploying a configuration in B2B

    Hi All, I am getting the following error while deploying a configuration in B2B. Could someone please let me know why is this occurring since from the error there does not seem to be any set-up issue. It looks like some Internal Error. If somebody ha

  • Contents of a custom print program for a custom smartform

    Hi... Can you please tell me if we are writing a custom print program from scratch for a custom smartform for which there is no standard form available what are all the things that need to be coded in the print program.. My doubts on this are if we a

  • Hiding & unhiding items on push of a button

    Hello, hope any one could help... I have a Form with some items there... for some purpose I want to make a button and when it will be pressed for the first time, it hides one item say 'A' and unhide second item 'B' (which was first not visible).. and

  • Error upon starting iMove 7.0

    I just got a new MacPro and loaded iLife 08 onto it. I bought the family pack. All my iLife apps work fine except iMovie. When I try to launch it from the dock it says "You cannot use this version of the application iMovie with this version of Mac OS

  • JTextArea - need event rised on text changed.

    I am making an application which contains a JTextArea. when user writes some data on in, some event must be invoked changing the text of the same JtextArea. Problem is, when i change the text, Java automatically adds to JtextArea typed character, wha