This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SelectFontAction in a JComboBox  RSS feed

Joe Crew
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any experience in adding font change attributes to items in a JComboBox. I have tried various methods to do this with no success whatsoever. I have seen sample code that deals with this form menu items with something along the lines of:
menu.add(new StyledEditorKit.FontSizeAction("12", 12));
menu.add(new StyledEditorKit.FontFamilyAction("Serif","Serif"));
but I have not been able to do this with JComboBox items. I need to be able to change the font family and font size. I experimented with the "setActionCommand()" method with no success either. If anyone has any ideas please pass them along as I would really appreciate it.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!