Solved

Horizontal ScrollBar in JComboBox

Posted on 2002-06-23
3
1,741 Views
Last Modified: 2012-05-04
I have made a combo box but the length of characters dispalyed is longet the hieght I have set. I have no option to increase the height but the ComboBox only gets the vertical scrollbar and not the horizontal scrollbar. Is there a way out for the same so that a horizontal scrollbar appears.

Second if that is not possible(to set the horizontal scroll bar) then how to show a toop tip of a particular item in scroll bar so that it appears completely.

0
Comment
Question by:dumdum420
  • 2
3 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 7102680
Hi  dumdum420,

     I think the following will be useful for you in setting the tool tip.

class test
{
  JComboBox comboBox = new JComboBox() ;

  public void test()
  {
    comboBox.addItemListener( new ItemListener()
      {
        public void itemStateChanged( ItemEvent ie )
        {
          String strComboItem = comboBox.getSeletedItem().toString() ;
          comboBox.setToolTipText( strComboItem ) ;
        }
      }
  }

}    

siva
0
 
LVL 5

Accepted Solution

by:
Calron earned 30 total points
ID: 7103051
0
 
LVL 26

Expert Comment

by:ksivananth
ID: 7103138
Sorry, what I said is wrong altogether. I think the links given by carlon will cater your need.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now