JavaRanch » Java Forums »
Java »
Swing / AWT / SWT
| Author |
JComboBox in panel
|
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
i have comboBox in my panel. and i want it to be display as normal as below:  but, after i run it, i got this :  the box of scrolling down is missing, still it can scroll down to select item. I just want the box appear in normal display. my code is fine rite? here is it is: so where is it wrong?
|
From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
works OK for me. post a working sample program, which displays the problem.
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
here is the sample after i run it:  i separate the panel and frame as different class. here is my panel class:
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
i got this in my frame class: when i change it to "com.sun.java.swing.plaf.motif.MotifLookAndFeel", it works on that. how come metallookandfeel not displaying well?
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
shows up normally on my PC winxp pro sp2, java 1.5.0_05 if you are using a different os, search sun's bug database, keywords [os name] JComboBox Arrow ArrowButton
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
|
winxp home sp2, java 1.5.0_05
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
"javax.swing.plaf.metal.MetalLookAndFeel" also works OK (default for 1.5??)
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
weird, the only diff is home vs pro, which, to me, shouldn't make a difference here's your code stripped down to just the combobox and separators, which runs OK on my pc run on yours, see if it still shows incorrectly
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
your code runs ok. so something wrong with my separator?
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
the separators are OK - I left them in only for 'dressing' must be something else in your code, something you haven't posted. as mentioned earlier, post something that we can copy/paste/compile/run and see the problem. unfortunately I'm off to work now, so I won't be able to check back for a while. someone else might be able to isolate the problem.
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
ok. thanks for your posts. now i will included all my coding needed : [ October 16, 2006: Message edited by: Nicky Eng ] [ October 16, 2006: Message edited by: Nicky Eng ]
|
 |
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
|
posted

0
|
swap these th.setVisible(true); th.addCustPanel(); to th.addCustPanel(); th.setVisible(true);
|
 |
Nicky Eng
Ranch Hand
Joined: Mar 26, 2005
Posts: 378
|
|
works now. REALLY thank you for spending time on my problem. thanks alot.
|
 |
 |
|
|
subject: JComboBox in panel
|
|
|
|