• Post Reply Bookmark Topic Watch Topic
  • New Topic

JScrollPane

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a function that returns a JPanel, which has JComboBoxes and JLabels on it.
I call this function a number of times to add a number of panels to a JPanel on a JScrollPane. (i.e. one scrollpane that has one panel which in turn has a number of panels on it)
The first panel is drawn correctly, but my problem is that the JComboBoxes on subsequent panels are not drawn properly, even though the JLabels are. It appears that the JComboBoxes of the 2nd, 3rd etc panels are drawn on top of the JComboBoxes of the first panel.
How do I get around this problem?
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you specifying that the pop-up on the JComboBox is lightweight or heavyweight? Mixing of lightweight and heavyweight objects on the same canvas will cause problems such as what you describe. Make sure that the lightWeightPopupEnabled is set to true.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!