Changing the font of a non-editable ComboBox

Hello everyone,
I need a small combobox. So I set a font of a specific size to the combo's
editor. That works nice als long as the combo is editable; but when it becomes
uneditable, the default bold font is used and some items don't fit in the
field any more. How to prevent this?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.plaf.*;
class ComboEditorFont extends JFrame {
  Font fontM= new Font("Monospaced", Font.PLAIN, 13);
  public ComboEditorFont() {
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(100,100);
    setLayout(null);
//  Changing the font in the UIManager doesn't work either
/*    Font defaultComboBoxFont= UIManager.getFont("ComboBox.font");
    FontUIResource fui= new FontUIResource(fontM);
    UIManager.put("ComboBox.font", fontM);
//    UIManager.put("ComboBox.font", fui);
    JComboBox cmb = new JComboBox(new String[]{"ABC","DEF","GHI","LMO"});
    cmb.setBounds(20,20, 48,20);
//    cmb.setEditable(true);
    JTextField editor= (JTextField)(cmb.getEditor().getEditorComponent());
    editor.setFont(fontM);
//    cmb.setRenderer(new MyCellRenderer());
    add(cmb);
//    UIManager.put("ComboBox.font", defaultComboBoxFont);
    setVisible(true);
  public static void main(String args[]) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
     new ComboEditorFont();
  class MyCellRenderer extends JLabel implements ListCellRenderer {
    public MyCellRenderer() {
      setOpaque(true);
    public Component getListCellRendererComponent(JList list,
                                                   Object value,
                                                   int index,
                                                   boolean isSelected,
                                                   boolean cellHasFocus) {
      setFont(fontM);
      setText(value.toString());
      Color background;
      Color foreground;
      JList.DropLocation dropLocation = list.getDropLocation();
      if (dropLocation!=null && !dropLocation.isInsert() &&
       dropLocation.getIndex() == index) {
     background = Color.BLUE;
     foreground = Color.WHITE;
      } else if (isSelected) {
     background = list.getSelectionBackground();
     foreground = list.getSelectionForeground();
      } else {
     background = list.getBackground();
     foreground = list.getForeground();
      setBackground(background);
      setForeground(foreground);
      return this;
}

- an offense to the english grammarThe exaggeration was meant to be ironic, not mean. Seriously, if a post is unreadable why bother posting it at all?
offense/non offense, I'd start to teach this language on 15/oct/2009, untill now ---> MSDN, ASM,I don't know if you refer to the Java or English language...
Either way, hopefully you have merely started learning it - not teaching it! :o)
- ranging from slightly to completely off-topic
always exists the different way, my off-topic "for you hide" declaracion for topic,
I agreed with some rules, disagre with strict..., Swing = something based on variable interpretations about Java decl., isn't exist stricts borders there, only God can tell us, If is it Swing, or if isn't Swing relevants, not my trully,No, no, I meant "off-topic" with regard to the poster's question: he had tackled the problem for editable comboboxes already, and was specifically talking about non-editable comboboxes, so obviously altering the editor as you suggested was hopeless.
- giving out "coding advice" without any justification
be sure that 99pct from "answers" fired these guys find out the "coding advice" on Go..., on another forum(s), and they will not returns back here anymore, for not-acceptable Hot Potato Games (if is or isn't topic relevant for this forum), I'm afraid the grammar prevented me to understand this whole sentence...
help is by Camickr's company, by German Kommunität (rel. for EU TimeZone), I'm only to learn (somehow) this language, Read - Translate ---> T - Write, An online translation system may help you to read these forums, but really don't post text translated this way!
with peaceFullFace and takeAnyNoticeOfIt kopik,No personal offense meant, I now think you're well-intended (but really awkward all the same).
Edited by: jduprez on Nov 6, 2009 4:06 PM - fixed spelling - mind you, I'm not a native english speaker either!

Similar Messages

  • Can we change the font size of (none) style in RH8?

    In RH8 when you add bullets, numbers or a new row to an existing table the style immediately to (none).  And (none) is 12pt.  Our "Normal" is a 10pt....and the font size does NOT show in the editor for (none)...only in Preview or compiled webhelp.  So many people are missing that they have a (none) applied somewhere in the topic until its in Production.
    I can't find (none) in the stylesheets and it doesn't allow me to select and edit it.
    Is there a way to change the (none) size font to Arial 10pt?  The Arial seems to hold from Normal to (none) but the 12pt is killing us.
    It would be nice if it would keep the Normal that was origionally applied...but if I can force 10pt life would be much, much simpler.  ??
    THANK YOU for your creative answers!!!

    Hi Teri.
    You certainly can change the "None" style but I think it is not good to leave text in topics with no style assigned to it. When assigning things like bullets using the formatting toolbar icon it applies a "None" style forcing you to select a style (e.g. Normal). See here for further details (look in the RH8 section).
    If you want to change the "None" style, expand the "Other" styles section of your CSS file. In there is a "Background + Text [Body]" style that can be changed. It is this style that is used by the "None" style.
      The RoboColum(n)
      @robocolumn
      Colum McAndrew

  • How can one edit a .gif file graphics background and change the fonts in Photoshop Elements 13?

    I am trying to change the color and fonts of some of my web sites .gif files. Can I change the color to another hexadecimal color and change the fonts of the letters in Photoshop 13? I am using Windows 7 and heard that you could save the .gif file to another format, edit it, then change the file back to a .gif file. Is this true? If so, how do you do it? The file just has a solid color with the letters "Firm " on it. No animation.

    You can edit a gif without changing the format, but once you save the file as a gif the text becomes part of the image, not text anymore, so you would need to clone or heal away the existing text and then create a new text layer and use save for web to create a new gif.
    For access to the most editing tools, while the file is open in the editor go to image>mode and change it from index color to RGB. Saving as a gif will change it back to index mode.

  • How does one change the font size for folders and/or file lists in the Bookmarks Library?

    How does one change the font size for folders and/or file lists in the '''Bookmarks''' Library?
    Since the upgrade to version 9.0.1 of Firefox, the Bookmarks feature changes are confusing me. They seem to be confusing themselves as well. The list of bookmarks has changed. The font size is so small that my aging eyes cannot read it without fogging the screen with my breath. Some folders are out of alphabetical order (where I know they were previously good), and some are missing altogether (folders to which I frequently add references).
    As for missing or deranged files or folders, was there something that I should have done or now need to do to recover those after the upgrade (or before)?
    With regard to font size,
    1. there is no “Edit Bookmarks” or like option to edit the list in this version
    2. the “zoom” option in the “view” list of functions is greyed out when in “Show All Bookmarks” window
    3. expanding the browser window has no effect on font size
    4. “Preferences” settings for font size has no effect in that window either, including advanced settings
    5. “Help” offers none that I can find.
    Can any of you Help?!?

    Maybe this extension helps:
    *Theme Font & Size Changer: https://addons.mozilla.org/firefox/addon/theme-font-size-changer/

  • Where can I change the font settings for the name of the month in iPhoto's calendar project?

    where can I change the font settings for the name of the month in iPhoto's calendar project?  I just ordered two copies of a calendar I designed in iPhoto and was surprised to find that the calendar's months were printing in something like an Arial 10 pt font.  On previous calendars I've printer via iPhoto and Apple, the font was much larger.  I've tried every menu option in iPhoto and the Calendar Project program and can't find where this is modifyable. Which leads me to ask, what the heck happened here in the first place?  I did not consciously change the default.
    I do remember that I got some notice when I first tried to print the calendar about the default font having been changed, but I don't know how this could have happened, and I didn't know what impact that had on the calendar until it was delivered.  I typically print about a dozen annual calendars but won't buy another until I've got a handle on this problem.  For the most part, the rest of the calendar is okay.
    As a P.S. is there anywhere where one can get a power user's manual, or instruction on iPhoto?
    Message was edited by: KPAausFrankfort

    "Maximum" and "12" usually refer to compression (influencing image quality and jpeg file size in bytes); and as Curt wrote, dpi is meaningless for display by and viewing in web browsers.  (It could be a different matter if you are uploading the jpeg files for someone to download from the web to print.)
    What are the sequence of steps that you and your batch processing take from Bridge?
    You can use call Photoshop's Image Processor from Bridge to create the jpeg files  (Tools > Photoshop > Image Processor).  In the Image Processor you can set jpeg compression, pixel dimensions if desired, also convert to sRGB (good idea for web display).  In my experience the image processor leaves unchanged whatever dpi is set in the source file; or, if none there as might be for a pdf, it will set the dpi value in your New Document Preset Print Resolution (from your Photoshop Units & Rulers preferences).

  • How to change the font size from tabs ???

    Hi
    I found a tip to change the CSS in the apache directory in the forum here.
    but i can´t find the directory on my hard disk/oracle directory
    i got this version installed:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
    PL/SQL Release 10.2.0.1.0 - Production
    CORE 10.2.0.1.0 Production
    can i change the font size of tabs/regions etc in any other way??

    Hi,
    The font size is defined by the style class used for the tab cells (tabs are normally created as cells in a table).
    To do this, the simplest solution may be to edit the page template:
    1 - Go to Shared Components/Templates
    2 - Select the page template(s) that you are using (you will have to do this for each template that you've used that uses tabs)
    3 - Scroll down to "Standard Tab Attributes" - you'll see two sections: Current Tab and Non Current Standard Tab.
    In Current Tab, you'll have something like:
    <a href="#TAB_LINK#" class="t12standardtabcurrent">#TAB_LABEL#</a>
    In Non Current Standard Tab, you'll have something like:
    <a href="#TAB_LINK#" class="t12standardtabnoncurrent">#TAB_LABEL#</a>
    After the class="...." attribute add in style="font-size:12px" (use whatever px value you want)
    4 - You should repeat the process for Current Parent Tab and Non Current Parent Tab as these contain the same settings
    5 - Apply your changes
    Regards
    Andy

  • In portal branding change the font colour of the popup dialog box

    hi all,
    I created  a theme of mine and changed the portal body colour to a dark shade. The porblem i am facing is..whn i click on the "Logout" button of the portal,it displays a popupbox saying "Are you sure you want to logg off?"...i want to change the font color to white as it is black in clour and not reaadable in the dark background colour.......can somebody help me in this ..
    Awaiting for your response..

    Hi.
    First solution is customizing logoffConfirmMsg.jsp (com.sap.portal.navigation.masthead.par) for your personal needs, but some coding is required.
    Second solution:
    1. adjust the color property of class .ctrlTxtStd in ctr_ie6.css and/or ctrl_nn7.css files from your theme:
    .ctrlTxtStd {
                color:#ffffff;
                font-family:Arial,Helvetica,sans-serif;
                font-size:0.7em;
                font-style:normal;
                font-weight:normal;
    2. If you edit css files directly on portal's file system, the restart of portal will be required.
    3.After portal or your theme updates repeat steps 1 and 2.

  • When I convert my pdf doc to word, the fonts go really weird and it also puts some text into boxes. when I try to select the test and change the font, it does not change it properly?

    When I convert my pdf doc to word, the fonts go really weird and it also puts some text into boxes. when I try to select the text and change the font, it does not change it properly? This is making it impossible to amend.

    Hi Janedance1,
    If the PDF that you converted already has searchable text, please try disabling OCR as described in this document: How to disable Optical Character Recognition (OCR) when converting PDF to Word or Excel. (If the PDF was created from a scanned document and doesn't already have searchable text, disabling OCR isn't a great option, as the text won't be searchable/editable in the converted Word doc.)
    Please let us know how it goes.
    Best,
    Sara

  • How can I change the font size on the post of WordPress?

    I have found three websites which address WordPress style sheets:
    Playing With Fonts: http://codex.wordpress.org/Playing_With_…
    Font Size and Color: http://en.support.wordpress.com/editors/…
    How to Change Font Size In Wordpress: http://www.ehow.com/how_5469172_change-f…
    Here are the instructions from the third website above:
    Things You'll Need:
    Site designed in Wordpress
    Administrator access
    Step 1
    First, to change the font size on a Wordpress site you need to log into the site as administrator. If you do not know how to reach the login page, simply add "/wp-login.php" after the "www.url.com" address. Then login using the admin sign in.
    Step 2
    Next, get to the Wordpress file editor by going to Appearance->Editor.
    Step 3
    Once in Editor, identify the Stylesheet file (style.css) and click to edit. This is usually located on the right hand side under the "Styles" heading.
    Step 4
    Once in the style.css file, you want to conduct a search for "fontsize". This parameter is used throughout the style.css file and is the parameter used to control font size. Next to "fontsize" you will see something like "16px". Simply increase or decrease the "16" to change font size. The tricky part is to figure out which "fontsize" you want to edit.
    The way to do this is to first look at the heading it is under. If it is under "comment-template", it is obviously related to either the font size of the comments themselves or perhaps the comment form or the date/time stamp of the comment.
    It may take a little trial and error to find the right "fontsize" to modify. Simply modify the one you think is correct and in a separate window, reload the page with the font you are looking to modify. If it did not change, undo the previous edit and try a different "fontsize".
    I went to the Dashboard and clicked on the “Appearance” icon on the left-hand side, and then clicked on editor. I clicked on Stylesheet (style.css), but I have not been able to find the “fontsize” that would change my post font size. As the author writes: "The tricky part is to figure out which "fontsize" you want to edit." Some of the font sizes are given as a percentage, and I don’t know if these come into question, i.e., if I should try changing one of these to see what happens.
    The end result is that I still have not been able to change my post font size, other than by using the Heading-1-through-6 option, which, I understand, is not the best way to do it.

    From John Waller: “If you're using IE8, hit F12 to launch Developer Tools which give you a point and click method of locating the relevant CSS rule on screen.”
    I have Internet Explorer 8 (IE8) so tried this method.
    This sounded like another promising possibility; however, I have not been able to change the font size in my post using this method.
    I have gone to Dashboard > Posts > Edit > then moused-over my post > clicked on "edit" and then hit F12. An enormous amount (20 pages or more) of CSS appears. I tried picking out the font size that I thought pertains to the post (under Text Area), and I have changed the font size from 13px to 24px; however, I have not been able to “save” the new setting. When I go back to it, it is back to 13px.
    As a result, I have not been able to use a trial-and-error method to establish which font size I must change in order to change the font size of my post.

  • Rs to do, and I selected the font for each 4s clip - now I want to change the font - is there a way to change all fonts on clips in one go?

    Hi I am new to iMovie - and made a 35min film - quite pleased with it - I sub-titled it right through coz we work with deaf people - wanted my first movie to be accessible. Now I want to change the font on each clip - can I do this in one step - and change all the sub-titles to a different font - thanks a lot, Jane

    Maybe some one else can pipe up with a solution, but this would literally take 2 seconds to do for a new project.  And you can create a "template project" that includes this "text" clip.  Save this project and then to a get info and check "stationary pad."  When you double click on this file, fcp will open with a copy of this project and you just need to do a save as. 
    I've been working with computer editing systems for longer than i can remember and at a certain point you just have to adapt your workflow to the limitations of the software.  

  • How to change the font color in a strict type def programatically

    Could someone suggest a way to change the font color of a string indicator in a strict type def cluster programmatically? The cluster contains a label that is color-coded to match the function of the data channel represented by that cluster.  The function of each channel is not predetermined, so the font color needs to be changed programmatically.  To represent all channels, I have arranged a large cluster that contains 100 instances of the control.  This makes it essential that the control be strictly type defined in order to change the layout of the clusters uniformly.
    Can anyone suggest either a method by which I can let the control remain a strict type def and change the font color, or a method by which I can programmatically change the control from a strict type def to a type def?  Currently, I am saving the control as a strict type def every time I make a change and then saving it again as a type def when I am ready to run the program.  This works fine, but just seems inelegant.  This color-coding is used throughout the program in various indicators, so a neat solution would be greatly appreciated.

    As mentioned in my Nugget on Type definitions you can create strict type-defs that contain type-defs.
    If you make your data definition a type and put that definition in a strict type-def (one of each flavor) you can use the appropraite strict type where each is required.
    Yes the data structure will have another level of nesting so if you are "too far gone" you may not like this idea.
    Otherwise you can write a VI that opens the typed-def and do a "save as..." and use it everytime you edit the type-def.
    I hope something helps!
    Ben
    Message Edited by Ben on 10-06-2008 10:26 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Strict_of_Typedefs.PNG ‏30 KB

  • How to make the message choice as non-editable thru personalization

    Hi,
    I have one requirement to make the messageChoice field as non-editable, how to do this thru personalization for particular page.
    because the same region available in some other pages also, so i need to do only for that page.
    How to do?
    Thanks in advance,
    SAN

    Hi Shanthi,
    If you want to make some rows editable and some as read-only, then the best thing to do is use an iterator. It is basically a class that implements interface IF_HTMLB_TABLEVIEW_ITERATOR and allows you to change properties of each cell of your table. You can do the following:
    1. Create an iterator class that implements this interface.
    2. Code method RENDER_CELL_START( ) to set all elements of a given row as read-only or editable as required.
    3. Leave other two methods empty but do activate them.
    4. Declare a public reference in your view implementation class of same type as this iterator class.
    5. Pass this iterator class to 'iterator' attribute of your <chtmlb:configTable> in view htm.
    In the iterator class, you also need to access your table node to decide which rows to make editable and which row to make readonly. To do this, you can declare an attribute in this class of type CL_BSP_WD_CONTEXT_NODE_TV and instantiate it from the CONSTRUCTOR. And you can instantiate this iterator class from DO_VIEW_INIT_ON_ACTIVATION( ) of your view controller.
    Regards,
    Shiromani

  • How do I change the font color for numbering in a matching question slide?

    I have a grey image on a question slide, but the numbering for the answers in a matching question is defaulting to grey so learners can't see to match up.  How can I change the font color of these choices?  Thanks.

    You probably edited the master slide without changing the theme colors? Check the Object Style for Answers in the Object Style Manager. The numbering takes the same color as the answer text.
    All depends on the Theme colors palette that you are using. Normally Question answers use the darkest tint of the fourth color. I started blogging about color management, but description of the use of Theme colors will be published later.
    Colorful 2015 with Adobe Captivate - Captivate blog

  • HOW DO I CHANGE THE FONT OF "Message to Display" IN THE Prompt User for Input

    Hi,
    HOW DO I CHANGE THE FONT OF "Message to Display" IN THE  Prompt User for Input?
    Thanks for your help 
    XN 

    Right click and select Open front panel >> Convert.
    Change the vi as you need. then you can save it as a normal sub-vi.
    If you have Labview 8.6, maybe (i am not sure) you can edit the express vi. Express vis are supported in 8.6

  • How do you change the font size under the event and iphoto view photos?

    I would like to change the font size in iPhoto under the photos that appear in the Events view and in the Photos view. I was told by a tech at Apple that it cannot be done because it is built into the software. What you see is what you get. That seems unusual because the font size in the Photo view is smaller than that in the Events view. The Font control that exists in File/Edit are for fonts used when you open a photo and add your own captionI and have nothing to do with the various views. Does anyone know a way to do this?   Thanks

    I'm afraid it really is WYSIWYG. It can't be changed.  You can send a feature request to Apple via http://www.apple.com/feedback/iphoto.html.
    OT

Maybe you are looking for