HELP !! XP look and feel ...

how can i make my frame have an XP look and feel ??????
please help me in details , cause i haven't done this look and feel thing before ??? thanks in advance ..

You need to change to the windows LnF which is not the default. The
following code will do it for you. Note that it will only work if your
using Windows XP.
* LookAndFeel.java
public class LookAndFeel {
    public static final String MAC_CLASS = "com.sun.java.swing.plaf.mac.MacLookAndFeel";
    public static final String METAL_CLASS = "javax.swing.plaf.metal.MetalLookAndFeel";
    public static final String MOTIF_CLASS = "com.sun.java.swing.plaf.motif.MotifLookAndFeel";
    public static final String WINDOWS_CLASS = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
    public static final String GTK_CLASS = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
    public static final String KUNSTSTOFF_CLASS = "com.incors.plaf.kunststoff.KunststoffLookAndFeel";
    public static boolean updateLookAndFeel(String currentLookAndFeel, java.awt.Component parent) {
     try {
         javax.swing.UIManager.setLookAndFeel(currentLookAndFeel);
            if(parent != null) {
                javax.swing.SwingUtilities.updateComponentTreeUI(parent);
     } catch(Exception ex) {
         System.out.println(ex);
            return false;
        return true;
}To get it to work do the following:
    LookAndFeel.updateLookAndFeel(LookAndFeel.WINDOWS_CLASS, this);where this represents your JWindow or JFrame.
Hope it helps.
James.

Similar Messages

  • Help on Look-and-Feel of JComboBox

    Can anyone guide me on how to change the look-and-feel and style of a JComboBox? Is it possible? If yes, how?

    I was wondering about that myself... I want to change the look of a combobox, or any other component. I think I should do it with the following code
    public static void setLookAndFeel(String�className)
    but I don't know what className to use. If I am not mistaken it should be the name of the class that implements the Look and Feel, please help!

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

  • Help us improve the look and feel of our community

    The BTCare Community Team needs your help!
    We want to improve the layout of the forum and would like to get your thoughts and feedback.
    Please complete this short questionnaire (it's very short, promise) to share your ideas on how we can improve the look and feel of our community.
    Thanks,
    Stephanie
    Stephanie
    BTCare Community Manager
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post. If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

    BinaryBurnout wrote:
    I am curious how I might go about implementing some of these other L&F's. Every time I try to use them like the following...
    UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel");I keep getting a java.lang.ClassNotFoundException: org.jvnet.substance.skin.SubstanceRavenGraphiteGlassLookAndFeel error. How might I go about fixing this?Make sure the according classes/ jars are on the classpath.
    -Puce

  • Windows look and feel instead, in InternalFrameDemo.java

    Hi all, I am learning swing and I am trying to modify the
    InternalFrameDemo.java source from
    http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html#InternalFrameDemo
    My idea is to add the line
    JFrame.setDefaultLookAndFeelDecorated(true); in the constructor, but it doesn't work
    and I don't understand why.
    Could somebody please help me?
    Kindest regards,
    Lasse
    public InternalFrameDemo() {
    super("InternalFrameDemo");
    //Make the big window be indented 50 pixels from each edge
    //of the screen.
    int inset = 50;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    setBounds(inset, inset,
    screenSize.width - inset*2,
    screenSize.height - inset*2);
    //FDoesn't work
    JFrame.setDefaultLookAndFeelDecorated(true);
    //Set up the GUI.
    desktop = new JDesktopPane(); //a specialized layered pane
    createFrame(); //create first "window"
    setContentPane(desktop);
    setJMenuBar(createMenuBar());
    //Make dragging a little faster but perhaps uglier.
    desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    }

    Uh I think you're mistaken. Whenever in doubt or something doesn't work as expected, check the javadocs. The link to the javadocs can usually be found really easily by typing "java 6 classname". In this case:
    http://docs.oracle.com/javase/6/docs/api/javax/swing/JFrame.html
    If you want to set the Windows look & feel as your thread title suggests, this was not the method you were looking for as the javadocs will tell you. That method controls if a frame is decorated or not (as the name suggests), which it is by default. Setting it to true will not change anything.
    So what then? You type into Google "java swing windows look and feel". Without quotes of course.

  • Problem with java look and feel

    Hi! This is my first time posting here. Do apologize me if I am not familiar with the regulations here. Thanks!
    Currently, I am developing a project using NetBeans IDE. It is using RMI, and some basic UI. I am facing the following error when I tried applying the java look and feel code. Please see below for the code used and the error message.
    try {   UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    } catch (Exception e) { }
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swing.plaf.ColorUIResource cannot be cast to java.util.List
    at javax.swing.plaf.metal.MetalUtils.drawGradient(MetalUtils.java:196)
    at javax.swing.plaf.metal.MetalInternalFrameTitlePane.paintComponent(MetalInternalFrameTitlePane.java:384)
    at javax.swing.JComponent.paint(JComponent.java:1027)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paint(JComponent.java:1036)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:564)
    at javax.swing.JComponent.paintChildren(JComponent.java:864)
    at javax.swing.JComponent.paintToOffscreen(JComponent.java:5129)
    at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
    at javax.swing.RepaintManager.paint(RepaintManager.java:1128)
    at javax.swing.JComponent.paint(JComponent.java:1013)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1797)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:734)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:679)
    at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:659)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Java Result: 1

    Thanks for everyone's help!
    Below is the executable code generated using NetBeans which is enough to generate the error message. Sometimes you can get the error message just by running the program. Sometimes the error will occur when you go into the Menu and click on Item.
    * NewJFrame.java
    * Created on January 8, 2008, 1:11 PM
    package client;
    import javax.swing.UIManager;
    * @author  Yang
    public class NewJFrame extends javax.swing.JFrame {
        /** Creates new form NewJFrame */
        public NewJFrame() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc=" Generated Code ">                         
        private void initComponents() {
            jDesktopPane1 = new javax.swing.JDesktopPane();
            jInternalFrame1 = new javax.swing.JInternalFrame();
            jMenuBar1 = new javax.swing.JMenuBar();
            jMenu1 = new javax.swing.JMenu();
            jMenuItem1 = new javax.swing.JMenuItem();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
            jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
            jInternalFrame1Layout.setHorizontalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 190, Short.MAX_VALUE)
            jInternalFrame1Layout.setVerticalGroup(
                jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 95, Short.MAX_VALUE)
            jInternalFrame1.setBounds(80, 40, 200, 130);
            jDesktopPane1.add(jInternalFrame1, javax.swing.JLayeredPane.DEFAULT_LAYER);
            jMenu1.setText("Menu");
            jMenuItem1.setText("Item");
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
            jMenu1.add(jMenuItem1);
            jMenuBar1.add(jMenu1);
            setJMenuBar(jMenuBar1);
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
                    .addGap(20, 20, 20))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jDesktopPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
            pack();
        }// </editor-fold>                       
        private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
            jInternalFrame1.setVisible(true);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new NewJFrame().setVisible(true);
            try {
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            } catch (Exception e) {
                e.printStackTrace();
        // Variables declaration - do not modify                    
        private javax.swing.JDesktopPane jDesktopPane1;
        private javax.swing.JInternalFrame jInternalFrame1;
        private javax.swing.JMenu jMenu1;
        private javax.swing.JMenuBar jMenuBar1;
        private javax.swing.JMenuItem jMenuItem1;
        // End of variables declaration                  
    }Edited by: Boxie on Jan 7, 2008 11:23 PM

  • How to give BSP Iview look and feel of portal??

    Hi All,
    I've created a BSP application that I use to create an Iview for portal.
    I thought that if i used htmlb tags that the look and feel of portal would be automatic to my app but its not.
    I've tried assigning portal css classes to a html table but there's no effect.
    I've previewed one of the standard ivews and viewed the source and found the path of the css file.  But when i looked for it on the server, while the out folder was there (com.sap.portal.design.portaldesigndata) , there was no css files in this folder.
    So i'm at a loss.  In summary, how do i get my bsp app to have the portal look and feel?????  I would prefer to use the css files so that if any changes are made to the standard, the changes will be reflected in my custom iviews too.
    Any help, would be most welcome,
    Liz.

    Hi Liz,
    on the properties tab for the BSP application try selecting the "Supports Portal Integration" checkbox.
    Cheers
    Graham Robbo

  • Accessing File/Folder icons for current Look and Feel

    Hi,
    I'm looking to get the Icon for files and folders that the current UIManager uses for some work I'm doing. Please could you help.
    I'm getting strange results from the method I'm using, which is to create a temporary file and do: Icon i = FileSystemView.getFileSystemView().getSystemIcon(tempFile);
    I don't like the idea of having to create a temporary file to do this - isn't there another way to do it? - for instance asking "get default file icon"/"get default folder icon".
    I could download a jpg image of the file/folder icons, but this is static - and I want my method to get the icons used for the current look and feel I'm using.
    There must be a simple way to do this right? I mean, java uses a method to get the icons for the current look and feel.. Oh.. Please help!
    - Edd.

    Try these:
    UIManager.getIcon("FileView.directoryIcon");
    UIManager.getIcon("FileView.fileIcon");Leif Samuelsson
    Java Swing Team
    Sun Microsystems, Inc.

  • 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

  • What are the functions of look and feel files?

    Hi,
    If some one can explain me what are individual role in look and feel of the ISA B2C application.
    mainFS.jsp
    main_inner.jsp
    catalogFS.jsp
    accountFS.jsp
    refresherB2C.jsp
    I want to know function of each files. If I change any file then where exactly I can see changes which I made.
    Any help from any one highly appreciated.
    Thanks.
    Ashish

    Hi,
    If you get hold of the ISA Development and Extension guide there is a section highlighting which frames go where in the main application.
    You can also see which .jsp pages are displayed where by adding the following parameter to the root URL of the application when you logon.
    http://<host>:<port>/b2c/b2c/init.do?showmodulename=true
    This will display the name of each jsp page in the frames on screen.
    Also, surely you must have been asked to change certain aspects of the application - not specific files?  You shouldn't just change the files and then "see what happens"...
    Hope this helps,
    Gareth.

  • How Can You Change the Look and Feel of Charts in OBIEE 11g

    How Can You Change the Look and Feel of Charts in OBIEE 11g?
    Edited by: user11973122 on Jul 18, 2012 12:13 AM

    Check these files
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\s_blafp\viewui\chart\dvt-graph-skin.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\msgdb\views\dvtchart\obips.dvtchart.xml
    OFM_HOME\Oracle_BI1\bifoundation\web\display\chartfontmapping.xml
    Pls mark correct or helpful if helps

  • How can I include a JSP, Maximized, and retain look and feel(WSRP)

    I have created a page group and defined a root page with a certain look and feel. There are two portlets on the page. Once the user clicks on a submit button, the portlet performs some action and includes a jsp included in the EAR file. The portlet needs to maximize the UI to display the jsp correctly.
    Once control returns back to the screen, the look and feel is lost and uses Oracle's default style. I have two questions:
    1. From the portlet, how can I retain the look and feel of the page group when referencing "external" jsp (i.e JSPs in the deployed portal EAR file).
    2. How can I "redirect" the user to the home page in a standard way? If there is not a standard way, how do I use the Oracle specific utilities to do it?
    All of my JSPs are developed externally out of the scope of the Oracle Portal.
    Environment - Oracle Portal 10.1.4 on Release 2 using WSRP to contact Oracle Release 3, hosted EAR file (WSRP Producer).
    Thanks in advance.

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • How can I include a portal component look and feel in a java servlet

    Does any body know how can i include a portal component look and feel (tables, buttons, etc) in a java servlet?

    Hi José,
    I don't think that is possible. But you can import the css files that ep uses for its look and feel and try to give your web pages similar look and feel. The tables and other controls used in EP are totally different and are done through complex JavaScript coding instead of simple HTML tags. If you want exact lok and feel then i thin you must go for a Webdynpro based application rather then a J2EE application with JSPs.
    Regards,
    Guru.
    PS: Give points for helpful replies.

  • 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

  • Tweak Javas Look and Feel

    Hello everybody,
    just wondering if you can help me here, I want to tweak the Look and Feel of some of the objects within a program such a menu backgrounds etc. I think that I am the right lines with this but it does not appear to do anything
    I have a class which is called DefaultDEFTheme in this I am declaring the following lines:
    public ColorUIResource getRedBackground()/*Could this be problem because getRedBackground does not exist?*/
    return new ColorUIResource(255, 0, 0);
    Then I have a class that is called DEFLookandFeel and I want to set the colors in the UIDefaults table, so for instance this is the code if I wanted to change the menu background
    protected void initSystemColorDefaults(UIDefaults table)
    Object[] systemColors = {
    "desktop", getDesktopColor(), /* Color of the desktop background */
    "activeCaption", getWindowTitleBackground(), /* Color for captions (title bars) when they are active. */
    "activeCaptionText", getWindowTitleForeground(), /* Text color for text in captions (title bars). */
    "activeCaptionBorder", getPrimaryControlShadow(), /* Border color for caption (title bar) window borders. */
    "inactiveCaption", getWindowTitleInactiveBackground(), /* Color for captions (title bars) when not active. */
    "inactiveCaptionText", getWindowTitleInactiveForeground(), /* Text color for text in inactive captions (title bars). */
    "inactiveCaptionBorder", getControlShadow(), /* Border color for inactive caption (title bar) window borders. */
    "window", getWindowBackground(), /* Default color for the interior of windows */
    "windowBorder", getControl(), /* ??? */
    "windowText", getUserTextColor(), /* ??? */
    "menu", getMenuBackground(), /* Background color for menus, I am right in presuming this does not change? */
    "menuText", getMenuForeground(), /* Text color for menus */
    "text", getWindowBackground(), /* Text background color */
    "textText", getUserTextColor(), /* Text foreground color */
    "textHighlight", getTextHighlightColor(), /* Text background color when selected */
    "textHighlightText", getHighlightedTextColor(), /* Text color when selected */
    "textInactiveText", getInactiveSystemTextColor(), /* Text color when disabled */
    "control", getControl(), /* Default color for controls (buttons, sliders, etc) */
    "controlText", getControlTextColor(), /* Default color for text in controls */
    "controlHighlight", getControlHighlight(), /* Specular highlight (opposite of the shadow) */
    "controlLtHighlight", getControlHighlight(), /* Highlight color for controls */
    "controlShadow", getControlShadow(), /* Shadow color for controls */
    "controlDkShadow", getControlDarkShadow(), /* Dark shadow color for controls */
    "scrollbar", getControl(), /* Scrollbar background (usually the "track") */
    "info", getPrimaryControl(), /* ToolTip Background */
    "infoText", getPrimaryControlInfo() /* ToolTip Text */
    for (int i = 0; i < systemColors.length; i += 2)
    table.put( (String) systemColors, systemColors[i + 1]);
    UIManager.put("Button.select", getButtonSelectColor());
    // Set the color for selected button */
    UIManager.put("Button.background", getButtonBackground());
    /* Set the color for selected button */
    UIManager.put("Menu.background", getRedBackground());
    /* Set the color for the menu to red background*/
    Then further on I set this:
    public static ColorUIResource getRedBackground(){ return getCurrentTheme().getRedBackground(); }
    But i have left in the getMenuBackground above it, I have also tried to take it out but nothing happens.
    I also have a class called DEFTheme and in this I declare the following
    public ColorUIResource getRedBackground()
    return new ColorUIResource(255, 0, 0 );
    Yet after changing all of this nothing ever happens. Am I going about this the completley wrong way ie should I change the colors in the DEFTheme and thats it?
    Please please help, this is becoming a real problem and I cannot find any relevant resources!!
    Thanks so much in advance,
    Z.

    Yes, its a crosspost, but this is the correct forum since this a Swing related question. Your crosspost comment belongs in the other forum.
    Check out this article:
    http://www.javareference.com/jrexamples/viewexample.jsp?id=66

Maybe you are looking for