Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

JComboBox items behind other components

Posted on 2005-03-14
8
Medium Priority
?
503 Views
Last Modified: 2010-03-31
I have a JComboBox with some items inside. JComboBox is just over a JPane. When I change the Jpane with another component, items of JComboBox are displayed behind my new component.

I would like to maintain my JComboBox in foreground.
 
0
Comment
Question by:test75
  • 4
  • 3
8 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 13535032
Is your new Component extending an AWT component?

Extend JPanel, not Panel
Extend JPanel, not Canvas
Extend JLabel, not Label

etc...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13535036
Can you post your code?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13535071
>> When I change the Jpane with another component
At runtime? Or at design time?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Author Comment

by:test75
ID: 13535123
>> at runtime

by extending javax.swing.JPanel instead of a java.awt.Panel it is ok.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13535250
Nice "guess", Tim.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13535323
>>  Nice "guess", Tim.

Lightweight/Heavyweight component clash is the problem 99% of the time with this ;-)

It's usually either that, or adding things to different layers in the JLayeredPane that cause it (add a component above the POPUP layer, and combo popups will appear behind it)

Glad you got it solved test75 :-)

Good luck!!

Tim
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13535386
>> Lightweight/Heavyweight component clash is the problem 99% of the time with this ;-)
I agree. That's why I put "guess" between quotes.
0
 
LVL 35

Expert Comment

by:TimYates
ID: 13535401
;-)
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses
Course of the Month15 days, 4 hours left to enroll

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question