Accelerator text font problem

When I set an accelerator key for a menu item,
the name of that key is displayed beside the
menu item. For example:
fileExitItem.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_X, ActionEvent.ALT_MASK));
The above code will display "Alt-X" next to the
label in the file exit menu item. Now, if I
wanted to change the font for the menu item I
could enter something like:
private class MyMenuItem extends JMenuItem
{   public MyMenuItem(String label, ImageIcon icon)
{   super(label, icon);
setFont(new Font("Dialog", Font.BOLD, 16));
And then define all my menu items to descend from the
above class. The problem is that this does not change
the font used to display the accelerator key. How do
you change that??
My thanks to anyone willing to help out.

<snip>
>
And then define all my menu items to descend from the
above class. Don't do that. See below.
The problem is that this does not change
the font used to display the accelerator key. How
do you change that??Such changes should be done via the UIManager. If you compile and run the code below, you will see that the UIManager has keys such as Menu.font and Menu.acceleratorFont which you can use to do exactly what you want to do with no need to create a bunch of widget subclasses.
==============
public class UILister extends JPanel {
     public static void main(String[] args) {
         try {
         JFrame f = new JFrame("UI Properties");
         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         Set defaults = UIManager.getLookAndFeelDefaults().entrySet();
         TreeSet ts = new TreeSet(new Comparator() {
             public int compare(Object a, Object b) {
                 Map.Entry ea = (Map.Entry)a;
                 Map.Entry eb = (Map.Entry)b;
                 return ((String)ea.getKey()).compareTo(((String)eb.getKey()));
         ts.addAll(defaults);
         Object[][] kvPairs = new Object[defaults.size()][2];
         Object[] columnNames = new Object[] {"Key", "Value"};
         int row = 0;
         for (Iterator i = ts.iterator(); i.hasNext();) {
             Object o = i.next();
             Map.Entry entry = (Map.Entry)o;
             kvPairs[row][0] = entry.getKey();
             kvPairs[row][1] = entry.getValue();
             row++;
         JTable table = new JTable(kvPairs, columnNames);
         JScrollPane sp = new JScrollPane(table);
         f.getContentPane().add(sp);
         f.pack();
         f.setVisible(true);
         } catch (Exception e) {
             e.printStackTrace();
}===========

Similar Messages

  • IWeb Text Font Problems and Loading Times

    Why does my home page show the correct font yet on all other pages the font is the default and won't change?
    Also why does it take so long for the iWeb Wesite I created to load on mine and other computers?
    MacPro   Mac OS X (10.4.10)  

    What is my URL?
    Whatever address people need to type into their browser so they can see it. Usually it looks like
    http://web.mac.com/username

  • Is there a way to have hardware acceleration without the text font change? + Eye straining firefox!

    Is there a way to have hardware acceleration without the text font change? I remember there was a way to go into settings before and getting hardware acceleration to work without the font change. Unfortunately I lost ALL my previous setting when uninstalling the beta ver Nightly and clicking delete settings :(.
    Also, I fixed a problem before where firefox was visually eye straining to me, I think it was some settings in anti-alias tuner, but I cant seem to find the right settings that puts less strain on my eyes, anyone know? Thanks ahead. Currently using FF7.

    Try to toggle some Boolean gfx.font_rendering prefs on the about:config page to disable some features.<br />
    Filter: gfx
    Others to try:
    * set gfx.direct2d.disabled to true to disable Direct2D
    *Anti-Aliasing Tuner: https://addons.mozilla.org/firefox/addon/anti-aliasing-tuner/

  • Font / text edit problem in photoshop CS6

    Hi there,
    I have a strange text edit problem in Photoshop CS6 running on Mavericks.
    Every time I use the text-tool in PS, write a sentence, mark it and change something like color, font size etc., the marked text vanishes.
    I have to "undo" the last step and the changed text appears again.
    Every time!
    I have a clean installed CS6 with no plugins and no other than system fonts installed.
    Everything on a new Mac Pro with OS X 10.9.5
    Any clues? Thanks.

    Do you have the latest updates for photoshop cs6?
    You can use Help>Updates from within photoshop cs6 to check if there are any available.
    Also, if you go to Help>System Info from within photoshop cs6, you can see the Photoshop Version in the top line.
    You should be on version 13.0.6
    See if turning off Dictation solves the issue.
    Go to System Preferences ---> Dictation and Speech -----> select OFF radio button .

  • FCPX crashing when text inspector open, I suspect a font problem. Help!

    I have encountered a problem where FCPX will crash whenever text propertys should show in the inspector tab (Text can be edited when the inspector is closed).
    After searching google, this appears to be a common problem. Everyone seems to say the symptoms indicate a font problem, which I suspected. However after using font book to verify my fonts, getting rid of 3rd party installed fonts and then messing up my fonts library
    terribly (still trying to figure out what exactly I did). I seem to have no luck.
    Has a solution be discovered yet? I need to be able to change my font settings not just edit text! Please help!

    Isn't that just the way things work. After working on this problem for many hours and several days I post here and within a few more hours it works itself out. <embarrassed>
    I used font book to turn off all fonts but the ones the OS needs to run, and it turns out somehow I ended up with duplicates of those ones. After a struggle to get rid of the duplicates I also deleted FXPs preference files. Now I can edit the text in the properties/info pane again!

  • In Firefox (latest version) on Craigslist the text font is a very funky super bold angular font I can barely read. When using safari it's ok using times. is this a firefox problem?

    In Firefox (latest version) on Craigslist the text font is a very funky super bold angular font I can barely read. When using safari it's ok using times. is this a firefox problem?

    You can do a check for corrupted and duplicate fonts and other font issues:
    *http://www.thexlab.com/faqs/multipleappsquit.html - Font Book 2.0 Help: Checking for damaged fonts
    *http://www.creativetechs.com/iq/garbled_fonts_troubleshooting_guide.html

  • HW acceleration (direct2d) causes problems for my site , is there a script to disable it automatically?

    direct2d acceleration on FF4 causes really bad font rendering problems for my site.
    Text goes on to of each other and behind pictures making it impossible to read for some parts. Disabling HW acceleration fixes the problem. Is there a script that I could use to disable it automatically for my site?

    In fact updating my graphics was the cause of the problem. With the old drivers there were no problems. It depends on the system. So far I've tested on 6 Windows PC's. on 2 of them it worked fine. My site should be 100% W3C compliant. It works fine on 3.6, Chrome, IE and Opera

  • Pages 08 fonts- problems with Arial, Times New Roman - how do I repair them?

    Pages 08 fonts- problems with Arial, Times New Roman - how do I repair them?
    Using 10.6.8 on MacBook Pro
    Mikeaaa

    I am running Snow Leopard. Transferring the same texts to TextEdit has no problems, so this is a Pages problem, I think.  Corruption of Times New Roman and Arial fonts, I suspect, but where? and what do I do about it? I just need to be pointed to a source of advice, I think.
    Thanks
    Mikeaaa

  • Glitches in address fill-ins with nicknames; default font problem; plus other glitches in Thunderbird 31.3.0 and 31.4.0; can I roll back to an earlier version?

    I am unhappy with the recent upgrade to Thunderbird 31.3.0 and now 31.4.0. My bottom line question is whether I can roll back to the previous version, which was working well for me.
    The problems I have encountered include:
    1. I used to be able to enter a single letter in many cases in the address field, and the autocomplete would fill in the entry that I always use with that single letter. That function has been lost, as has auto fill-in based on the nicknames I have entered in my Address Book. I see there is another thread on this problem (https://support.mozilla.org/en-US/questions/1036962), but no satisfactory answer so far. Entering a single letter now pulls up completely unrelated address entries that may not even have that letter as part of the name, address or nickname for that unrelated address. I have created new nicknames to try to adapt to this problem, but even these new nicknames no longer work with the 31.4.0 upgrade yesterday, forcing me to create yet more complex and hard-to-remember nicknames to pull up my frequent addressees. This is all very frustrating to me, as I depend on speed and ease when creating messages.
    2. Also, I used to be able to enter a single letter in the address field and then use the mouse to click on the "To:" symbol to the left of the next address line to change the next entry to "Cc:"; doing so would then cause the complete address to fill in in the "To:" address field, and make the next field ready for an entry. That no longer works. If I use that technique, the shortcut that I entered in the first field gets included along with the address (if I'm lucky enough to have the address itself selected now, given the problems I've mentioned above). I now have to press "Enter" in order to get the address in the first field to "take" correctly, and then have to click on the "To:" symbol for the next line as a separate action. Just another inconvenience with the new version.
    3. While still on the subject of addresses, personally I see no reason why the address and subject fields should now be colored blue by default rather than appearing as blank, white fields. I far prefer the old look. And I suspect that changing from the blue color to a nice, clean, white field takes time and computer resources that slow things down.
    4. The default font (Times in my case) no longer "takes" when replying to or forwarding messages. I've checked Tools/Options/Composition, and Times is still shown as my default font. However, when I start to type (in a reply with the original message quoted or in a forwarded message), the result is "Variable Width". In order to get Times, I need to highlight the block of text after typing, including the lead-in to the quoted message or the header of the forwarded message, and select "Times" when "(mixed)" shows up. This is a big pain; I often forget to do so and end up having to edit the Unsent Message (which I check before sending) as New and correct the font.
    5. A minor problem: I rely on the reminder to attach a message which shows up when an "attachment-related" word is entered in the body of the message. It has been a wonderful feature of Thunderbird that has prevented me on many occasions from sending off messages without the attachments. However, in the new versions, even if I have indeed added the attachment, a pop-up comes up on sending the message saying there has been no attachment and asking if I want to add one. It's easy enough to just click "No", but it's yet one more unnecessary and distracting step that this new version is requiring of the user.
    I'm really sad to see these various changes/glitches. I love Thunderbird and it bothers me deeply to find myself mired in so many new problems that slow down my work. I would be grateful for any suggestions and advice, and, particularly, for any information as whether I can roll back to the version prior to 31.3.0 that was working well for me.

    Thank you, Zenos. I tried rolling back to v31.2.0, since I had not encountered problems prior to December. However, that didn't help. So I followed your valuable suggestion to revert to v24.6; that seems to have done the trick.
    I would like to mark this problem as "Solved" -- the rollback seems to have worked. However, since my original post was a complex mix of things, before I do that, should I post the individual problem sets that I had noted (address fields/nicknames problems -- numbers 1-3; default font problem -- number 4; attachment reminder problem -- number 5) as separate issues which have not been solved?
    Do you know if these various issues are being worked on? I'm glad to have the temporary fix of rolling back to an earlier version, but I'd like to get back on the current update schedule at some point if and when these problems have been corrected.
    Thank you again!

  • How do i restore default text/font settings for fire fox?Text is not displaying correctly some letters not dark and see odd characters inplace of letters in words

    How do i restore my text so that all words are uniform in darkness?Now some letters are fragmented or missing a part of it and see odd characters instead of letters in some sentences.Ive tried different fonts in the Options still the same.Would like to
    be able to restore my default settings for text/fonts.Would that eliminate this problem?

    Try to set the Boolean pref <b>gfx.font_rendering.directwrite.use_gdi_table_loading</b> to <i>false</i> on the <b>about:config</b> page.
    To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
    If you see a warning then you can confirm that you want to access that page.<br />
    *Use the Filter bar at to top of the about:config page to locate a preference more easily.
    *Preferences that have been modified show as bold (user set).
    *Preferences can be reset to the default via the right-click context menu if they are user set
    *Preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean)

  • Dynamic text box problems

    I have created a dynamic text box and an input text box.
    I have produced code that replicates whatever is typed in the
    input box to display in the dynamic box along with a date and time
    stamp once a button is clicked.
    This all works fine, except for the sizes of the fonts. for
    both boxes, i selected font size 10 . The input box is fine,
    however the dynamic box text is huge.
    When i make the dynamic text font smaller, it fits in fine,
    but the input text that is inserted into the dynamic text box comes
    in too big. If i make the input text box font smaller it is
    unreadable when typing it in.
    any soultion to how to make my font consistent. I am assumin
    the problem is because both the text boxes are different sizes,
    however i don't know how to resolve the issue.
    Any help is much appreciated.
    Laura

    hi laura
    i think the problem it's in the targetPath "
    mainClip.newspaper_mc.newinstructions.text =
    lu.welcome[langIdx];".
    chech if you have mistype the instance names of your
    movieClip and rewrite it or in the Actions panel select the path "
    mainClip.newspaper_mc.newinstructions" and click the button
    "Insert Target Path" this will open a popup with a tree of your
    MC's on the stage, so you can browse and find the textfield. i hope
    i helped you if not let me know!

  • Embedded Fonts Problem

    Hi,
    I'm trying to emebed some fonts, but I haven't been able to get it working.
    I'm using this code in a style sheet:
         @font-face{
                src: url("../assets/fonts/lsans.ttf");
                fontFamily: LucidaSansV;
                embedAsCFF:true;
            @font-face{
                src: url("../assets/fonts/ROCK.TTF");
                fontFamily: RockwellV;
                embedAsCFF:true;
            @font-face{
                src: url("../assets/fonts/times.ttf");
                fontFamily: TimesV;
                embedAsCFF:true;
    if I use the fontFamily in Spark labes, it works:
    <s:Label text="Some text here" fontSize="40" fontFamily="LucidaSansV" />
    <s:Label text="Some text here" fontSize="40" fontFamily="TimesV" />
    <s:Label text="Some text here" fontSize="40" fontFamily="RockwellV" />
    But if I use it like this, doesn't work either:
    var cf:TextLayoutFormat = new TextLayoutFormat();
    cf.fontFamily = 'TimesV';
    cf.fontLookup = flash.text.engine.FontLookup.EMBEDDED_CFF;
    cf.renderingMode = flash.text.engine.RenderingMode.CFF;
    Aslo, I've tried using formatted text, like "<p fontSize='32'><span fontFamily='LucidaSansV'>ABCDEFGHIJKLM 18</span></p>" with no luck.
    The behaivor should be oposite, if I declare embedAsCFF:true;, I should be ablke to use it in FTE components and embedAsCFF:false with the old MX components. what am I missing?
    tks.

    I wanted to update the post just in case someone has the same problem.
    I created a ActionScript Library with a class for each font I need and drop the swc to the project where I need to use the fonts.
    In the project, I just need to do this before using the font:
    new ArialFont();
    Each class looks like this:
    package
        import flash.text.Font;
        public class ArialFont
            [Embed(source='assets/fonts/arial.ttf', fontName='ArialV', mimeType='application/x-font', embedAsCFF="true")]
            private static var ArialF:Class;
            [Embed(source='assets/fonts/arialbd.ttf', fontName='ArialV', fontWeight="bold", mimeType='application/x-font', embedAsCFF="true")]
            private static var ArialBoldF:Class;
            [Embed(source='assets/fonts/ariali.ttf', fontName='ArialV', fontStyle="italic", mimeType='application/x-font', embedAsCFF="true")]
            private static var ArialItalicF:Class;
            [Embed(source='assets/fonts/arialbi.ttf', fontName='ArialV', fontWeight="bold", fontStyle="italic", mimeType='application/x-font', embedAsCFF="true")]
            private static var ArialBoldItalicF:Class;
            public function ArialFont()
                Font.registerFont( ArialF );
                Font.registerFont( ArialBoldF );
                Font.registerFont( ArialItalicF );
                Font.registerFont( ArialBoldItalicF );
    Hope this helps someone.

  • PDFMaker font problem

    Can anyone offer any advice on how to debug a font problem?
    I am using a (shareware) symbol font on my Windows XP system. It works great in FrameMaker, and comes out perfectly in Frame-generated PDF files.
    Unfortunately, I also have to convert Excel spreadsheets to PDF, using the same font. When I generated those PDF files with PDFMaker, the font characters all show as little squares. I checked MS Word as well, and it has the same issue.
    I've checked the font properties in the generated file using the TouchUp Text tool in Acrobat - the font is recognised and embedded. If I try to make changes, I get this error message:
    "Some of the characters in the current font are not available, the missing characters will be replaced by place holder characters (maybe dots '.').
    "A work around to this is to select another font which contains the characters in the TouchUp Properties dialog.
    "Proceed with replacement?"
    I'm using Office 2007 under Windows XP Professional. The font is shareware and unsupported. I'd bet my bottom dollar that the problem isn't in PDFMaker, but I don't know a whole lot about fonts, and I'm not sure how to debug this.
    Can anyone offer any advice?

    If you go to the general tab in the Adobe PDF printer properties, there is a button for printing preferences. Select that and go to the Adobe PDF Settings tab. There should be a check box for leaving the log file intact there. You can also simply print to the Adobe PDF printer with print to file selected. Then open the file in Distiller and watch the messages created (these steps are automated if you do not print to file).
    You can also check the fonts in the PDF (use ctrl-D, font tab). If they are embedded, that information is stated in parentheses. If there is no statement of embedding, then it did not get done. That is not necessarily an error if the job settings are not set to embed the font.

  • Illustrator dose not save with any text/fonts then locks up program

    I will start off with. 
    I am using CS4 Design Premium with Windows 7.
    For the last three weeks I had a problem with a few of the programs Illustrator, Indesign, Fireworks.  Not saving while getting an error can’t save this file.
    Also in Illustrator while it is loading running the splash page, as it loads the different files it stops and gives an error   PFDFormat.ai is missing.
    Now I worked with Abode for two of the three weeks.  I finally figured out the problem.  FONTS  I remove a few fonts I recently installed.  Great everything has worked for about 5 days and I am back to the font problem.
    When I open Illustrator it loads fine but once I try to open a file or create a new file I get an error “unknown error has occurred”.
    When I restart my computer then start illustrator when it opens it works with vector objects but no fonts at all. I tried to even use the default Myraid Pro no luck.
    So in short when I try to put text in a file in any program of Adobe CS4 I can not save and it stops that program from working.
    I know this is a font problem.
    How can I remove all the extra fonts with out removing the required ones for Windows and Adobe?  When can I find a list of the fonts? 
    I have also found before you install a particular font check the properties for that file some of them have a block/unblock this file.  This is something I have not found if I do not do this will this cause the problem. I think that is the problem but still not sure which fonts are required and which ones I can delete. 
    I am looking for Windows 7 required fonts and
    Adobe required fonts so I can delete all others.

    If you are having a program loading and locking up fist thing check your fonts with a font program, it is worth the time.  I have been working this problem for a month.  I even had the Adobe support confused after they spend about 6 hours all together on my system they still did not figure it out.  I did I have five different fonts corrupted.  They were already installed I did not add any fonts either.  Good luck everyone!

  • Solution for font problem using iTunes store (iTunes 9 @ Vista)

    For all those of you who experience font problems rendering the iTunes store (I got partly jibberish many letters rendered as squares). For me it turned out that
    my Arial fonts were corrupted (there were other files with the same font names residing in my Windows font directory). Deleting all Arial and installing them new from another Vista machine solved the problem.
    I got to analyze the problem as follows: the rendering of the iTunes 9 store is done by the webkit. This reads a list of available fonts with files names from the registry and stores it in the file C:\Users\YOURNAME\AppData\Local\Apple Computer\WebKit\FontsList.plist (do not edit, it is generated each time you start iTunes anew). If you compare (e.g., using diffdaff) this file to the one of a Vista computer that does not show the font problem, you pretty soon realize which font family might cause the problem for you. For me it was Arial (which is used by Windows as a substitution for the Helvetica fonts BTW).

    You can try to download items one at a time to get rid of this error message. Follow these steps for such:
    1) Open iTunes.
    2) From the Store pull-down menu at the top, choose Check for Purchases.
    3) Enter your account name and password, then click Check. Your purchases should begin downloading.
    4) Under the STORE section on the left, click Downloads.
    5) Click the Pause All button in the lower-right corner. This will temporarily pause all of your downloads.
    6) To resume only one of the downloads, click the refresh button that appears to the right of one of the paused downloads.
    If that doesn't help, you may want to consider performing the following to be sure no software is conflicting with iTunes:
    1.) Disable all anti-virus software you may have running
    2.) Disable all firewall software you may have running
    3.) Disable all web acceleration software you may have running
    4.) If you are connected to the internet via an internet router, please disconnect it and connect directly via your broadband modem
    Hope this helps =)

Maybe you are looking for

  • Major screen/graphics distortion while editing in iPhoto.  Any ideas?

    Hi there, I have a 13" MacBook Pro purchased in late 2011.  We bought the computer specifically for photo editing, as I have a DSLR camera.  The issues with iPhoto started almost immediately after the computer was purchased.  Here's what happens - I'

  • D6060 low ink light and no print.

    The low ink warning light blinks, printer does not print, but all cartridges are between 50 and 100% full.  No paper jams apparent.  Have followed directions to reset printer (remove cartridges, turn off, wait 10 mins, turn on). Same result with blin

  • JMS Listener in webtier

    Dear all, I Hav som problems . sombody plz help me out. Is it a good practise to implement Jms listener in the web tier. Is there an alternative method like using web service or some thing like that. Thnx in adv

  • Best setup to sync properly

    I need help in figuring out the best setup before I buy the 3GS (hopefully on the 9th of July...). What I want is to use my MacBook Pro as the computer that I connect my phone to for syncing. Also, I want the phone to sync with my MobileMe account, a

  • Apps on waiting status

    I have 4 apps that are in waiting status and trying to download. They have been that way since yesterday . I can't even delete them and re- download them. I tried tapping on app to see if it will start to download and nothing. I've logged out of iPad