Solved

Horizontal ScrollBar in JComboBox

Posted on 2002-06-23
3
1,761 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cipher Configuration on Apache HTTPD 4 50
HSSFWorkbook cannot be resolved error 10 49
custom annotations 9 29
Error trying to install RTMT Win7 5 38
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…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…

930 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

9 Experts available now in Live!

Get 1:1 Help Now