Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2005

Tip: Looking for answers? Try searching our database.

Known problem with JComboBox?

Thread view: 
Rene Ruppert - 16 Feb 2005 11:13 GMT
Hi,

just wondering if this is a known problem:
I have to set JComboBox.setLightWeightPopupEnabled(false) due to the
constellation of my framework.
Now the scrollbar of the combo won't be updated as long as the box is
entirely displayed within my JFrame. As soon as part of it is out of the
window the scrollbar will work.

What's that all about? Is there a "semi lightweight mode" or something like
that?

Thanks.

Ren?
Rene Ruppert - 16 Feb 2005 12:15 GMT
Hmmm....just wrote a little test up and in there it works...what the heck
could that be? I'm using a JFrame with JInternalFrames and a GlassPane to
simulate modal dialogs.

Here's the test app that shows the correct behaviour...maybe someone has an
ideas of how to modify it to make it NOT work so I can track down the bug.
:-(

import javax.swing.*;
import java.awt.*;

public class Test extends JFrame
{
public Test()
{
 super("Test");
 setSize(500, 400);
 setVisible(true);
 setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

 Object[] items = new Object[100];
 for(int i = 0; i < items.length; ++i)
 {
  items[i] = new String("Eintrag " + i);
 }

 setLayout(null);
 JComboBox comboBox = new JComboBox(items);
 comboBox.setLightWeightPopupEnabled(false);
 comboBox.setSize(320, 20);
 comboBox.setLocation(30, 30);
 getContentPane().add(comboBox);

 repaint();
}

public static void main(String arguments[])
{
 Test test = new Test();
}
}


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.