Customizing colors for the MotifLookAndFeel

Hello,
I am new to look and feels other than the default one.
I am supposed to provide an application with a a Motif UI with a specific color scheme (colors of text, backgrounds, menus, etc.).
Is there some API to configure Sun's MotifLookAndFeel colors?
Other than that, here are the options I can list:
1) System config file:
I am not exactly good at Motif configuration but I guess Sun's MotifL&F bundled in the JRE will try to get the default colors from some motif.rsc or whatever it's called, in the user's home.
However I don't want to alter this file as only my application should have custom colors, I don't want toi impact other Motif apps for the same user/host.
2) UIDefaults:
As I understand it, class UIDefaults represents a table provided by the installed LookAndFeel class, which can be changed afterwards, through the UIMAnager class. However, that doesn't force the L&F to take the changes into account. Indeed the MotifL&F doesn't seem to take any of those changes into account.
3) Custom MotifL&F subclass
I assume I could also subclass com.sun.java.swing.plaf.motif.MotifLookAndFeel and override getUIDefaults(), but that seems awkward just to change a handful of colors and no behavior.
I'm not even sure MotifLookAndFeel fetches the color values from UIDefaults once it has initialized it...
Any other suggestion?

Thanks but I don't feel at ease with this solution (extending a class to change its configuration, whereas the base class can be configured through a public API).
However your suggestion to peek a the code truly helped me: the names of the keys I was using in UIDefaults were simply wrong! :o)
Actually I got a list of keys from this page: http://java.sun.com/products/jfc/tsc/articles/lookandfeel_reference/index.html , but in the source for the sun.java.swing.plaf.motif classes you can see the "correct" keys (e.g. MotifMenuItemUI extends BasicMenuItemUI which uses "MenuItem.background" and not "menu").
The other good news is that the keys can be set beforehand (before actually setting the LaF): although the LaF provides its own UIDefaults, the UIManager stores them in a MultiUIDefaults, and the defaults installed via UIManager seem to take precedence...
That was more convenient in my case.
For reference here is an extract of my code:
UIManager.put("menu", new ColorUIResource(0,250,20)); // helpless, wrong key
UIManager.put("menutext", new Color(200,0,200)); // helpless
UIManager.put("MenuItem.background", new Color(255,50,20)); // taken into account
UIManager.put("Panel.background", new Color(166,255,166)); // taken into account
UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");Just for convenience, does anyone know a good Web resource for the keys used by the various LookAndFeel classes, or at least the BasicLookAndFeel? Other than looking at the code for all XxxUI classes, of course :o)

Similar Messages

  • How do you set up a custom color for the standard screen mode

    This new colour scheme has not enough contrast for it to be readable, so I was pleased to find custom screen mode. However, there seems to be no way of setting up a custom color for this. In addition, the icons are so small they are unreadable. Is there any way of making them bigger. I have a 20" and a 22" monitor working together, but they are still not clear enough to use.

    Hi there
    Are you referring to the tool icons in Photoshop CS6? There are a few options you can change to help make the interface more readable, but unfortunately, there is not an option to enlarge the tool icons.
    It sounds like you may have discovered this already, but if you go to Photoshop > Preferences > Interface, you can change the color of the Photoshop CS6 interface.
    You can also enlarge the UI text size in this same window, in the Text preferences box.
    You can also make the size of your layers thumbnails larger. You can do this by clicking on the small menu in the upper right hand corner of the Layers Panel and selecting Panel Options.
    Here you can change the size of the layers thumbnails.
    I hope this helps you out a bit!

  • Can you no longer have a background color for the text box in the new version of hp photo creations

    just updated to the new version of HP Photo Creations, used to be able to have a colored background for the text box - is that no longer possible in this new (not better) version????!!!!! Uuuuuuuuuugh

    Hi Lainey.
    Thanks for asking. We're working on bringing back that feature. In the meantime, here's another way to add text backgrounds: Add a placeable graphic and then click the Arrange button to send it to the back, behind the text.
    That approach also gives you more interesting shapes. The new alignment guides make it a snap to align a graphic with a text box. In the example below (it may take a day for the image to show up here), I also used the new Premium Editing Features to change the color of the graphic.
    P.S. — Applying a thick border to an empty text box (also using the Premium Editing Features) is another way to create a background shape. That has the advantage of letting you pick any color for the box. You'll also find several new text styles at the bottom of the new text menu.
    Let us know if we can help further,
    RocketLife 
    RocketLife, developer of HP Photo Creations
    » Visit the HP Photo Creations Facebook page — news, tips, and inspiration
    » See the HP Photo Creations video tours — cool tips in under 2 minutes
    » Contact Customer Support — get answers from the experts

  • How to create a "Custom Color" for highlighting? (Acrobat XI)

    March 10, 2014
    How to create a "Custom Color" for highlighting? (Acrobat XI)
    The numbers in the RGB and other fields change as various numbers are changed.
    I wanted to create a pale orange:
    Hue               13      Red      255
    Saturation   240      Green  177
    Luminosity    86       Blue     140
    I'd selected one of the orange squares in the color grid, to display the general orange area of the slider.
    I moved the slider to select a pale orange, which generated the above numbers.   Since this wasn't directly available to save to a Custom Color, I tried to  edit the numbers.  Unfortunately, the other numbers changed, making it impossible to actually create a color.
    Any suggestions would be appreciated.
    Note:  I used Techsmith's Snagit to show screen shots in a Word document.
    When I attempted to browse and upload the file, the error message said "[The content type of this image is not allowed.]"
    OK...what images *are* allowed?

    Hi Don,
    I saw Gilad answered your question in another forum post.
    Do you have everything you need at this point?
    Let me know if you need further assistance.
    Kind regards, Stacy

  • To create custom colors for exception

    Hi experts......
    I need to create custom colors for my report in order to set exceptions. Shades of red,yellow and green is just not enough for my client, they want to see blue as well when certain exception rises. Can someone please give me a hint as to how to implement that ...is it got to do st with the mime repository?
    Thnaks in advance!
    Tina

    Hi Tina,
    You can do this by formatting in the workbook. Run the query and in the workbook, on the BEx toolbar, there is a button for formatting. Select the exception cell whose color you want to change > in the Format button choos epatterns and select the color you would like. Once you have made the changes, save the workbook. The changes will remain in place the next time the user runs this workbook.
    Take a look at this link for more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a559ee09411d2acb90000e829fbfe/content.htm
    Hope this helps...

  • Changing the font color for the complete row based on the Keyfigure Values

    Hi Experts,
    Can any one help me to find a solution for this?.
    I have a requirement, in which the Font color for the complete Row needs to be set to RED in Bex Report, when the corresponding Row Keyfigure is more than a particular value.
    Ex: Notification-Material-Customer-Def Qty-delivered Qty
          1000000 - XXXXX- AAAAAA-10-1000
    in the above example, when the Defect qty increses more than 10, then the complete Row Including the characterstics, Notification, Material, and customer Should be Highlighted in Red. This has to happen automatically once the Query is refreshed.
    Please let me know if you have any suggestion here?.
    Regard,
    Muruganand.K

    Hi,
    Step 1: Click the Format Menu in Excel(BEX Analyzer)
    Step 2: Click the Style submenu
    Step 3: there will be number of SAPBEX formats available. Each of these relates to another cell of BEx (Header, Cell Data,
                Result  Row, Hierarchies, etc.). Also, they depend on data types.
    Step 4: Select SAPBEXchatext
    Step 5: Click Modify. This displays all the standard formatting option as shown below.
    Step 6: Select Font, Color (Background/ Font).
    Step 7: Click OK on both the screens. The entire BEx output result row Font and color is modified.
    Hope it helps........
    Regards,
    Suman

  • How do i change the backgound color for the "file edit view history bookmark tools help" bar in Firefox 29.0

    how do i change the backgound color for the "file edit view history bookmark tools help" bar in Firefox 29.0

    You can add a solid color theme to change the color of the top of the browser window, which includes the Menu Bar.
    https://addons.mozilla.org/en-US/firefox/themes/solid

  • How can i do different colors for the category in business graphics

    Hi everybody,
    i have a business graphics and i need different colors for the category. my business graphics is a gantt.
    for example
    category1
    category2
    category2
    and so on.
    Is there a solution for this? How can i do it?
    Best regards,
    Markus

    Sorry.
    In my opinion, this requirement can not be resolved.
    Generally, we use Business Graphic with Category, we just follow:
    DATA:lr_graph TYPE REF TO cl_wd_business_graphics.
    lr_graph = cl_wd_business_graphics=>new_business_graphics(
        bind_series_source = 'NODE_DYN'
        chart_type = cl_wd_business_graphics=>e_chart_type-BARS
        height = 340
        width = 750
    *     BIND_TOOLTIP = 'GRAPH.TT'
        id = 'GRAPH' ).
    DATA: lr_bgr_cs TYPE REF TO cl_wd_category.
    lr_bgr_cs = cl_wd_category=>new_category(
    view = wd_this->mr_view
    bind_description = 'NODE_DYN.CATEGORY').
    lr_graph->set_category( lr_bgr_cs ).
    If we go to SE24, to check  the class "CL_WD_CATEGORY", we cannot find any method  or attribute about how to manipulate  the "Category Font Color"...
    Maybe,any other expert can give you fantastic solution, hope. Best wishes.

  • Set font color for the JTextField

    I'm using JTextField in my project. However, can anybody teach me how to set the font color for the font in the JTextField to other color. The default font color is black. Any idea about this?

    JTextField field = new JTextField(20);
    field.setForeground(Color.blue);
    Good luck ;)

  • How to define new colors for the form?(Finish)

    Hello! Everyone!
    I want to define new colors for the new form.
    But I don't find where I can define it.
    How to define new color for the form?
    Thanks in advance!

    You have to set the Canvas color or as I said earlier you need to use one of the available color schemas on the OAS or Builder runtime.
    If you want to use user defined colors in the builder, then you need to create a new color palette and use it.
    I personally haven't tried it, but there is a section in the online help that describes how to do this.
    Tony

  • How to change the color for the af:messages by skins ?

    Hello All
    How i can change the text color for the af:messages by skins,i want change the color for the messages paragraph not for message header
    Because i know how to change the message header color text by
    .AFErrorTextForeground:alias
    color: Red;
    Error:
    1. You Must Select etc...
    2. Hello All
    i want to change the color nor for the header (Error) ,i want change it for the messages 1 and 2 and its text.
    Regards
    Mohammad Weshah
    )

    Hi Frank
    Unfortunately it dose not work.
    Any another options for this issue .
    Regards
    Mohd.Weshah

  • TS1702 When I try and use the Kindle app on my touch it keeps telling me to register the kindle. I register it using the account and password I used to get the app but it tells me there is no customer found for the email address and password. help

    When I try and use the Kindle app on my touch it keeps telling me to register the kindle. I register it using the account and password I used to get the app but it tells me there is no customer found for the email address and password. help

    No, it is asking you to register with your Amazon user id and password. Your Apple ID won't work.

  • PWA 2010 timesheet: 2 different colors for the rows "Actual " and "Planned

    Hello,
    To make timesheet easier to read and fill, is it possible to have 2 different colors for the rows “Actual “ and “Planned”?
    Thanks,
    soudha

    Hello Soudha,
    By default the timesheet grid shows the cells in white color. But if you have little coding skills or a developer at your end, you can try this using "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\JsGrid.js" java
    script file.
    You may have to modify it but I recommend to take a backup of the file and test in your test environment first.
    Happy troubleshooting.....
    Vikram Daruru - MSFT

  • How to create a Listbox in UI5 with alternate row color for the Listitems.

    Hi,
    I need to create a Listbox for browser (not mobile). But not getting any properties for alternate row color for the list items.
    If anyone worked on this pls share.
    Thanks,
    Nigam

    Hi Guys
    Chandra's solution is sweet.
    Here is another one so that it will not affect the other lists (if any) that you do not want alternate colors.
    -D

  • Is it possible to create a customs declaration for the document which is cleraed from customs

    Hi Experts,
    I want to generate a custom declaration for the declaration which is cleared from customs.
    Is there any function module for this requirement.
    Please post your suggestions ASAP.
    Thanks
    Srinivas

    hi Srinivas,
    It’s not possible to create a new declaration for a declaration that is
    already accepted by customs. There could be below 2 possible options
    1. U need inbound cancellation messages in the respective activity sequence,
    and then u can request customs by mail or phone to send the cancellation
    message. Once the cancellation message is received document gets cancelled and
    u can create new declaration
    2. U need a new optional activity sequence that will have outbound
    cancellation message. once u trigger the cancellation message, customs will
    reply back with the cancellation confirmation message and u can create a new
    declaration
    Hope this helps...
    Regards,
    Santosh

Maybe you are looking for

  • Screen Capture Utility

    Does anyone know of a good screen capture utility for the TouchPad? Thanks! I found a thread answering this at: http://forums.hpwebos.com/t5/HP-TouchPad-Software-​Hardware/How-to-collect-a-Screen-Capture-on-a-Touc​... Woohoo

  • Change of user

    Hi, I've recently purchased a second-hand Palm Z22 and have already used it to store data. When I went on my pc to synchronize I found there was already a user there. I have set up a new username but all the info is stored under the old username. How

  • Kerberos Authentication Setup for MSCRM in cross forest oneway trust environment.

    Dear All, Kindly help related to implement Kerberos authentication on CRM application with multiple Forest environment. My environment details are as below: Number of forests: 2 1. First is with name of domain1.local 2. Second is with name of domain2

  • Move files from iPod to iTunes?

    I lost all of my music on iTunes doing a Windows Re-install. I have retrieved "purchased" items, but can I get my huge library of music from my iPod?

  • I am getting message 'can't sign on because a server error' clicked 'server status' and that confirms all normal - what do I do now?

    Just setting up a new laptop with windows 7, loaded ICloud but rebooting and following instructions to sign in I get the message 'you can't sign in because of a server error' on checking ICloud status, through link, it shows all normal, but still can