?
Solved

JComboBox items behind other components

Posted on 2005-03-14
8
Medium Priority
?
497 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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