• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SelectFontAction in a JComboBox

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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic