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
Solved

JComboBox in JMenu for font selection.

Posted on 2004-03-22
3
993 Views
Last Modified: 2013-12-03
I'm working on an application where the user may want to frequently change fonts.  I would LIKE to simply include a JComboBox dropdown in my JMenu.  Is there any way I can stick a JComboBox into the menubar?   Or will I be forced to use a popup or a seperate item elswhere in the frame.

Thanks,

Donald HInes
0
Comment
Question by:DonaldHines
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
GrandSchtroumpf earned 50 total points
ID: 10652663
I don't see the point of using a JComboBox in a JMenu.
You can simply use MenuItems to add a second-level menu.
Something like View/Font/ and there you put the different fonts you would have put in the JComboBox.
You can use radio buttons for the different fonts, so only one will be selectable and you'll have a nice little bullit in front of the one that is currently selected.
And you can use a JComboBox in a JToolbar.
0
 
LVL 1

Author Comment

by:DonaldHines
ID: 10654933
I wanted a JComboBox because it allows the user to simply type in a fontname if they wished instead of scrolling through a long list.  BUT I suppose most users are going to scroll anyway.   I'll either use a submenu or try out the JToolbar.  
Thank you for the help.
0
 
LVL 30

Expert Comment

by:GrandSchtroumpf
ID: 10655806
:°)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

809 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