• Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBox - listeners  RSS feed

Bruce Quesenberry
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have JCombo component with a list of items. When I change to a different item, I want a JScrollPane [see scrollPane] to show the update with new text. This does happen, but only when you click inside the scrollPane. Is there a way to fire an action to cause this update. I would think the itemStateChanged method would take care of it. I can rely on users to think about clicking in the scrollPane to see the updated text.

scrollPane = alignmentText.GetTextAndScroll(alignmentBox.getSelectedIndex());


public void itemStateChanged(ItemEvent ie)
//dump the old scrollPane
//get new scrollPane showing text related to the new
//JCombo index
scrollPane = alignmentText.GetTextAndScrollalignmentBox.getSelectedIndex());
//add it

//repaint does not work
//there is a replaceText method - but this is too cumbersome for
//the amount of text involved and even then I bet it will have the same functionality
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!