Changing look and feel for one INSTANCE of a component

I am trying to change the look and feel of just ONE instance of a component. In particular, I want to change the color of the JScrollBar thumb on a certain JScrollPane. I want this change to not affect any other component, either before or after. How can I do this?? Any help would be much appreciated.
AC

Hi acalvin3!
I have a solution. Use the UIManagers database. You should overwrite the default settings for the resource you want to change, the code is self explaining:
      UIManager.put( "Button.margin", commonMargin );
      UIManager.put( "Button.focusInputMap", commonInputMap );
      UIManager.put( "Button.font", buttonFont );To reset values you only have to use
      UIManager.put( "Button.margin", null );
      UIManager.put( "Button.focusInputMap", null );
      UIManager.put( "Button.font", null );Set values before you create your component and reset values immedeately after you created your component, otherwise you may affect other components too.
With following code you can find out default values for the whole UIManagers database:
      Hashtable defaultProps = UIManager.getDefaults();
      Enumeration enum = defaultProps.keys();
      while (enum.hasMoreElements()) {
         Object key = enum.nextElement();
         System.out.println( "key: '" + key + "'\t value: '" + defaultProps.get(key) + "'" );
      }You just have to look for the output for the component you want to change the look and feel.
Have fun...

Similar Messages

  • Customised look and feel for B2B/B2C web shop.

    Dear experts,
                I would like to find out if there is an admin page for SAP E-commerce to customise the look and feel of the webshop?
    Thanks.
    Wein

    Hi Wein,
    To change Look and Feel for Web shop is depends on scenario of eCommerce application i.e. B2B or B2C. B2B has different structure than B2C.
    Web Channel application comes in SAP standard with SAP look and Feel. You have to change look and feel as per client requirement.
    To change look and feel of Both B2B/B2C scenario you have to deal with files like CSS, JSP, Properties, XLF and some time you have to add your custom JAVA, JSP, CSS, Properties files etc...
    To change standard SAP logo youhave to make change in CSS files. Also you have to consider Browser type while changing look and feel because to display your B2B/B2C application correctly in different browser you have to make changes in different CSS.
    You will get better idea with example how to change look and feel in "Dev & Ext. Guide" for Web Shop. You will get this from Service Market place.
    eCommerce Developer.

  • Losing Title Bar when changing Look and Feel on the fly

    Hello,
    I have an option in my Swing app for the user to change the Look & Feel on the fly by selecting from a radio button list. The look and feel is changed when the user make the selection, however the Windows Title Bar disappears. Any ideas what I'm missing?
    private void setLook(String mode)
    String lookAndFeelClassName = null;
    UIManager.LookAndFeelInfo looks[] = UIManager.getInstalledLookAndFeels();
    for (int i = 0; i < looks.length; i++)
    if (mode.equalsIgnoreCase(looks.getName()))
    lookAndFeelClassName = looks[i].getClassName();
    break;
    try
    m_view.dispose();
    UIManager.setLookAndFeel(lookAndFeelClassName);
    SwingUtilities.updateComponentTreeUI(m_view);
    m_view.setVisible(true);
    catch (Exception e)
    JOptionPane.showMessageDialog(m_view, "Can't change look and feel:" + lookAndFeelClassName, "Invalid PLAF", JOptionPane.ERROR_MESSAGE);

    You are disposing the view. My guess is that this is your problem. Try creating a new one instead of just showing the old disposed one

  • Changing Look and feel of template pagelets

    Hello,
    I have a requirement to show different look and feel for different template pagelets.
    Something like:
    Related links - Grey Header
    Related Content - Blue Header
    Other pagelets - Red Header
    I was able to acheive this very easily for homepage pagelets by cloning PORTAL_HP_COMPONENT.
    But looks like PORTAL_HP_COMPONENT HTML is not used for template pagelets.
    Does anyone have any idea which HTML is used to build Template pagelets?
    Otherwise how to meet the above requirement?
    Many Thanks for your help.
    Best Regards,
    Ekta

    Each pagelet has a unique ID based on the CREF ID. Rather than change the HTML template, an alternate option is to add this information to your stylesheet. Look in PeopleTools > Utilities > PeopleTools Options for your stylesheet name. I recommend cloning this one, adding a new free form stylesheet with override information, and then updating the PeopleTools Options to use your new stylesheet.
    I don't believe template pagelets have a common HTML definition. Instead, the "wrapper" HTML depends on the use location. For example, Workcenter pagelets use a different HTML definition than Intelligent Context and Related Content pagelets.

  • Event on changing Look and Feel

    I want to know what event is fired when I change Look and Feel.
    Thanks,
    Pati

    Ideally you'll be using the UIManager.setLookAndFeel() to change the installed LookAndFeel. In the UIManager, the installed LNF is bound to a JavaBeans property using the SwingPropertyChangeSupport with the key: "lookandfeel". Any time this changes, a PropertyChangeEvent will be fired to the PropertyChangeListeners registered with the UIManager. You can simply add a PropertyChangeListener to the UIManager and listen for events that are bound to that particular property, such as...
        UIManager.addPropertyChangeListener( new PropertyChangeListener() {
            public void propertyChange( PropertyChangeEvent e ) {
                if( "lookAndFeel".equals( e.getPropertyName() ) ) {
                    System.out.println( "look and feel changed" );
        });The event encapsulates the new value and the old value so you can do whatever you need with that information.
    I used an anonymous inner class mostly as an example - You may need to consider a cleaner design for your purposes.
    Hope this helps!
    Matt

  • How can we remove the space after changing look and feel to generic

    Hi
    I want to remove the space which left blank after changing look and feel to generic in formsweb.cfg file.
    Can anybody help me to remove this blank space.

    Hi,
    can you be more specific on teh space you mean?
    Frank

  • How to change the look and feel for Heading of quick launch menu in project server 2010

    Hi
    can someone tell me how to change the look and feel of Header names in quick launch.
    I want the header to be displayed in Bold with Underline to it.
    could this be possible for just header in quick launch in project server 2010. 

    Hi Rohan
    It does not work this way. You have to use a content editor webpart.
    See references below that might help you starting with this customisation:
    Http://go4answers.webhost4life.com/Example/sharepoint-2010-quick-launch-look-feel-78379.aspx
    Http://m.sharepointpromag.com/sharepoint/four-ways-add-or-remove-quick-launch-menu-control
    Hope this helps.
    Guillaume Rouyre - MBA, MCP, MCTS

  • NetBeans: Dinamically changing Look and Feel Problem

    Hi there, Java lovers.
    I need some help here!
    I love java, and I used to program my graphical user interfaces by hand. In my applications, there is a dropdown for the user to chose the desired look and feel. Then I save the selected option to a file and on the startup I do something like this:
                UIManager.setLookAndFeel(savedUserSelectedLookAndFeel);That always worked really fine. The look and feel would change and everything worked really well.
    However, programing GUI by hand is really a PITA. So I was seduced by Netbeans. I am using Netbeans 6.0 on Windows XP, and I designed the GUIs really fast now.
    The problem is, the system look and feel works really well, but when I change the look and feel of my application to a different one (Java/Motif/etc..) the look and feel changes but the components positions and sizes becomes all messed up. It really becomes impossible to work with a different look and feel because some components are outside of frames.
    I believe the cause of this is because Netbeans generates the code automatically using Grids and stuff like that, and by doing so, the change of the look and feel becomes messed up. This is a thing that would not happen with my manually created code.
    This is really troubling me. Does someone has the same problem. Is there something I can do? Or do I need to create my GUIs by hand like before?

    Oyashiro-sama (&#23569;&#12375;&#26085;&#26412;&#35486;&#12434;&#30693;&#12387;&#12390;&#12356;&#12427;&#12375;&#12289;&#12381;&#12435;&#12394;&#12300;&#27096;&#12301;&#12387;&#12390;&#12356;&#12358;&#20351;&#12356;&#26041;&#12399;&#12385;&#12423;&#12387;&#12392;&#22793;&#12381;&#12358;&#12391;&#12377;&#12397;&#12288;(^_-) &#12300;&#20887;&#35527;&#12301;&#12387;&#12390;&#12356;&#12358;&#38996;&#25991;&#23383;&#12391;&#12377;&#12290;&#65289;
    Sorry for the delay in reply, but one problem for you is that this is not a NetBeans users forum, thus you will not necessarily receive speedy replies here to your NetBeans questions. The best place to send NetBeans questions is:
    [email protected]
    [email protected] (for NetBeans API issues)
    As for your question, you seem to already know quite a bit about NetBeans UI Look and Feel programming, but have you seen these:
    WORKING WITH SWING LOOK AND FEEL:
    http://java.sun.com/developer/JDCTechTips/2004/tt0309.html#1
    Java GUI Swing Programming Using NetBeans 5 (should apply to NetBeans 6):
    http://wiki.netbeans.org/JavaGUISwingProgrammingUsingNetBeans5
    Regards,
    -Brad Mayer

  • How do I get a more modern look and feel for a compiled help file

    I gather from reading various posts that there is no easy way
    to generate a .chm file with a more modern look and feel (am I
    right about this?). Are there no plug-ins available from Adobe that
    will enable us to generate a help file that looks more modern?
    I hesitate to move to flash help or something like that
    because, of course, then the developers would have to hookup the
    hundreds of dialog boxes we have in our product to the new files. I
    also think that having one file is way easier to manage in terms of
    getting updated help to the customers. What are online Help
    developers generally delivering for apps where users are not
    connected to the Internet except perhaps periodically while using
    the software? I'm a writer (not a developer) so need soemthing that
    is easy to implement :-)
    Thanks for your help. It is much appreciated.

    To add to the advice already offered, you can apply a skin to
    a CHM file which allows you to customise it. However as with most
    things there are issues with this approach. You can read about this
    by downloading Rick Stone's excellent
    tips
    'n tricks file. Just look in the index under "skins". Something
    else you may want to look at is the beta of Adobe's
    AIR.

  • Extending JComboBox  behavior and changing look and feel

    In order to change JComboBox behavior, usually we will extend the MetalComboBoxUI or WindowsComboBoxUI (for example: for controlling the popup width)
    The problem arise when we want to be able to change the pluggable look and feel: all components got the new look and feel except for the comboboxes.
    A dirty solution can be extending our ComboBoxUI from the new look and feel library but in the case of jgoodies it is even impossible because PlasticComboBoxUI is final
    Any ideas?

    In order to change JComboBox behavior, usually we will extend the MetalComboBoxUI or WindowsComboBoxUI (for example: for controlling the popup width).
    The problem arise when we want to be able to change the pluggable look and feel: all components got the
    new look and feel except for the comboboxes. A dirty solution can be extending our ComboBoxUI from
    the new look and feel library but in the case of jgoodies it is even impossible because PlasticComboBoxUI is final
    My best suggestion: request the L&F provider to make his combo box homogeneous with the other components.

  • Changing Look and Feel

    I finally figured out how to change the look and feel of an application, but now I'm trying to figure out how the user can change it during run time. I was thinking that when the user chooses a "look" the program could just reload and send the lookAndFeel (such as com.sun.java.swing.plaf.windows.WindowsLookAndFeel) to the main's arguments, but I'm not sure how I could do this exactly... any push in the right direction would be great.. thanks.

    thanks! I tried using the SwingUtilities.updateComponentTreeUI method, and it worked for the most part, but for some reason now when I use this code:
    try {
         UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
         SwingUtilities.updateComponentTreeUI(this);
         pack();
    catch (Exception e) {
    }The frame seems to turn into a JWindow... as in the title bar disappears.... I'm not sure why it's doing that...

  • Changing Look and Feel of Annual Appraisal document

    Hi all,
    I have the requirement to change the look and feel of Annual Appraisal document.
    I need to add a header to the first column in Appraisal document.
    I am confused as to where the changes are to be made (In HAP_DOCUMENT,Annual template or BSP code)
    Have checked most of the blogs and threads in forums,but no help yet.
    Please let me know where the changes have to made and how?
    Thanks and Regards,
    Sumangala

    Hi,
    Thanks for the reply.
    I checked "Document_header.htm" as you mentioned.
    It agian points to few other header files such as "Document_header_appraisee.htm","Document_header_appraiser.htm" .
    When i go and check these files,  the code refers to settings no of columns,rows. No link to Header text anywhere.
    From where these headers are set actually.Any configuration in template or header text are written in the code only?
    and also curious to know what this line refers to
    "<%= otr(PAOC_HAP_DOCUMENT_UI/TEXT_ADDITIONAL) %> <%= APPLICATION->doc-S_HEADER_TEXTS-OTHER_TYPE_TXT %>"
    Regards,
    Sumangala

  • Changing Look and Feel programatically ??

    Hi,
    Is there a way in WLP815 to apply a look and feel programatically may be by using desktop backing or some other way?
    I tried to use LookAndFeel.setSkin() in desktop backing preRender method to change the skin from 'default' to say 'custom',
    To my surprise, It is rendering images from 'custom' and CSS styles from 'default' skin. Hmmmm.
    I even cleared the cache on my browser. But no luck :-(
    Does any one had this issue and know a work around?
    Thanks in advance!
    -Subba

    I use following code in header backing "init":
    LookAndFeel lookAndFeel = LookAndFeel.getLookAndFeel(request);
    lookAndFeel.setSkin(newskin);
    lookAndFeel.setSkeleton(newskeleton);
    lookAndFeel.reinit();

  • Can i perform SDK 7 Compilation while maintaining SDK6 look and feel for my App

    In our organization we test the App using visual specs and our existing visual specs are aligned with SDK 6 look and feel. When i compile my app with SDK 7 the visual display of the App changes completely and is no longer in sync with the visual specs used for testing. As SDK 7 compilation is a mandate for post Feb 1 submission, is it possible to compile the code with SDK 7 while maintaining SDK 6 visual look and feel?

    What i am actually trying to do is to maintain the existing SDK6 UI Look and Feel on iOS7. Apple has issued a mandate to have all Apps compiled with SDK7 for App Store submission post Feb1, 2014. If i compile with SDK7, even if i set the deployment target as iOS6, when my app runs on iOS7 it will have the new Apple's iOS7 look and feel. How can i accomplish this?

  • How to change look and feel on different pages

    Hi,
    I'm new to oracle portal, i want to chnage the look and feel dynamically,
    for example:
    when i entry page A,i want to use look and feel "RED",when i entry page B,i want to use look and feel "BLUE".
    what should I do in my programming or configuration ?
    thanks!!
    Edited by: user11361456 on 2009-7-6 下午7:16
    Edited by: user11361456 on 2009-7-6 下午7:33

    For a quick result, you can use Portal Templates with Portal Styles
    For a better but slower result, you can write HTML templates (page skins), with your own CSS.
    In both cases, you assign the template to the page. You can also use Portal Templates to mantain the structure of the pages, and Page Skins to change the look.

Maybe you are looking for