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

Similar Messages

  • 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

  • Can we change the look and feel of the screen layout

    Dear All,
    I am new to ABAP WebDynpro, and would like to know the following with respect to ABAP WebDynpro :
    1. To what extent can we change the look and feel of the screen layout ?
    2. Is it possible to change the background color of the layout?
    3. Is it possible to change the color of, Buttons etc ?
    Any information / document/ link to explain this would be very helpful ..
    Thanks in advance,
    Aditi

    Hi,
    Psl check out these links.
    check out these webdynpro standard components in SE80 tcode -
    WDR_TEST_UI_ELEMENTS
    check out this link on webdynpro for ABAP-
    http://help.sap.com/saphelp_nw70/helpdata/EN/03/0048413e466e24e10000000a155106/frameset.htm-WD for ABAP
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/9319f88f8115ebe10000000a114a6b/frameset.htm -UI elements
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/9319f88f8115ebe10000000a114a6b/frameset.htm-Button Properties
    http://help.sap.com/saphelp_nw70/helpdata/EN/46/9319f88f8115ebe10000000a114a6b/frameset.htm- For different Layouts
    Regards
    Lekha

  • 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...

  • 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 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

  • 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 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.

  • Changing the look and feel of the logon screen and portal themes.

    Dear all,
    we got some  requirements  in the portal  where i have implement the following things..
    1) when we give the portal url in the browser along with logon screen i have to display the some content related to the organaisation ,,, there i want to do logon screen customization also.
    2)once login to the portal i need display the some company related information along with  different ESS services .i want to remove the masthead area and in the  role area want to display different services.
    please guide me   to achive this.
    the client is not at all happy with  present look and feel,
    so what we can do t achieve ths?
    Thank you in advance.
    Swapna

    Hi Swapna,
    Portalapp.xml is the configuration file of portal application holding comonents and services. Where as authschemes.xml file is used to determin and tell portal which of the user authentication schemes is to be used. It also tells portal about which logon PAR file should be used. It is defined inside following tags.
    <frontendtarget>Logon PAR File Name</frontendtarget>.
    Take a scenario for example. You have created a custom logon PAR file and made some changes. You cannot see the changes before deploying it. You have to deploy it first. Now, you want that whenever somone logon to portal, your logon PAR should be referred and executed. Authschemes.xml does this work. It maintains a reference to the PAR file that should be used for logon.
    Now, still have to create a custom authschemes.xml file and upload it. (Follow this link for the authschemes file location http://help.sap.com/saphelp_nw04/helpdata/en/1a/3afd4e641b8f42ac07bb77fe30375b/content.htm)
    Refer this link for details on authschemes.xml file: http://help.sap.com/saphelp_nw04/helpdata/en/d3/1dd4516c518645a59e5cff2628a5c1/content.htm
    Let us see in brief what are the steps executed:
    1) You request a portal login
    2) Portal, after receiving a request, looks for a reference to which Authschemes file to be used. It finds it in Visual Admin
    3) Once portal have the name of authschemes file, it parse this file and determin what are the authentication schemes to be used and which logon PAR should be executed.
    4) Only after these steps, it renders logon page to you
    Once you do all these steps, you can see the result on logon page itself. You do not have to look for deployed PAR file.

  • Changing look and feel with radio buttons

    k this is the code that i have so far, Yes i read the tutorial and stuff but it doesnt seem to make any sense and all. tell me what else i need in this code to do what i want, its the action performed part i didnt put the other code, what else do i need??? but well...you will see grips of duke dollars to whom can do it
    public void actionPerformed(ActionEvent e)
    String actionCommand = e.getActionCommand();
    if(actionCommand.equals("Metal"))
    try
    UIManager.setLookAndFeel( "javax.swing.plaf.metal.MetalLookAndFeel" );
    catch (Exception ex)
    else if(actionCommand.equals("Windows"))
    try
    UIManager.setLookAndFeel( "com.sun.java.swing.plaf.windows.WindowsLookAndFeel" );
    catch (Exception ex)
    else if(actionCommand.equals("Motif"))
    try
    UIManager.setLookAndFeel( "com.sun.java.swing.plaf.motif.MotifLookAndFeel");
    catch (Exception ex)
    }

    While not in the tutorial, I have found several other things necessary to get the look and feel change to be complete. Here is the code I'm using after I set the look and feel. It seems to do a pretty good job of sync'ing everything together.
                SwingUtilities.updateComponentTreeUI(TDba.getFrame());
                TDba.getFrame().pack();
                Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
                Integer w = new Integer((int)(dim.width * .8));
                Integer h = new Integer((int)(dim.height * .8));           
                TDba.getFrame().setSize(w.intValue(), h.intValue());
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • 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.

  • 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();

  • 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...

  • Changing Look and Feel of JFileChooser

    HI,
    How to change the look and of the JFileChooser?
    I am trying to apply the styles from the CSS. My intention is to put the JFileChooser component as applet.
    Solution pls.
    Thanx.

    JFileChooser is in fact a dialog and it cannot be used as an applet. Nor you can apply CSS styles to it.

Maybe you are looking for

  • The AirPlay is not working at Apple TV 3rd gen

    I got this Apple TV at last month, and the AirPlay is working great. And today I try to use AirPlay on my iPhone 5, as usually, and I can't find the AirPlay button in the Control Center. I reboot both of my iPhone and Apple TV but the problem still h

  • Free of cost supply for Rejected item

    Dear All, Please help me in the following scenario : a. A line item ( Imported item )rejected  by quality . b. For that rejected item foreign supplier send us the same material in free of cost . No need to pay for that item. c. I paid the freight and

  • How to import songs AND all the data from iPod to iTunes?

    Hi, I am looking for a tool that can import more than just the music from iPod to iTunes. I have tried several apps to no avail. (many mentioned in another post here: http://discussions.apple.com/thread.jspa?threadID=1576568&tstart=15 ) I "upgraded t

  • Simple external drive question please

    Hi all, quick and probably rather basic question here.... I have a mac mini which we use as a family internet channel, email and the occasional synching of an Iphone and iPod Touch. I am getting memory almost full messages from my mac mini. It is. Ho

  • Types of Update method clarifications!

    Hi  All   I understood and read all the threads regard to update types. But Stll not cleared.Pls clarify me as they are simple one. 1. When datasource is DELTA Capable, can it be changed or also used as FULL UPDATE? how? 2. When we re-initialize, I s