Solved

Horizontal ScrollBar in JComboBox

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 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