Java Look & Feel in Windows

I would like to implement the Java L&F on windows plattforms with those nice notched, blue title bars. I'm using the crossplattform look and feel from the UIManager (jsdk 1.4.1_01). Everything looks smashing (my scrollbars gets notched...mmm...nice) xept for the titlebars. They are as ugly as everything else in Windows. I'm using JFrames.
Note: When I run javaws apps, some of them get the Java L&F but when I run them as pure Java I'm stuck with Windows-titlebars. Grrr...

Sorry Stevo,
That is not necessarily true.
As of Java 1.4:
JFrame has a method called setDefaultLookAndFeelDecorated.
So, before you create any frames if you call:
JFrame.setDefaultLookAndFeelDecorated(true);then all of your frames should have what you want, if the l&f supports it.
The Java Look & Feel does support, so that should give you what you need.
E. West

Similar Messages

  • Setting Themes for Java Look & Feel

    Hi All,
    I am tring to set my customized theme to Java Look & Feel. I am able to set the theme using the following code:
    ASC_WhiteSatin theme = new ASC_WhiteSatin();
    MetalLookAndFeel.setCurrentTheme(theme);
    The above code works fine and changes the color schemes correctly.
    If I set another theme after setting the previous one i.e.let say abc Theme, dialogs and frames are updated properly where as JFileChooser start showing combination of both. Why?
    I am also updating the Look & Feel and calling
    SwingUtilities.updateComponentTreeUI(this);
    SwingUtilities.updateComponentTreeUI(this.getParent());
    ((JFrame)this.getParent()).pack();
    to refresh the themes for my frame. I am using JDK 1.4.1.
    Thanks in advance
    Wahaj

    try the beta-version of 1.4.2

  • How could i use mac look & feel in windows?

    as it's restricted by licenses issues
    and no specific lib available
    anybody knows?
    thx
    max

    Well, actually the Mac look and feel available in Apple's standard JVM is native to the OS and may not work correctly under OSes other than OS X.
    If what you are looking for is a high quality look and feel package, then consider JGoodies Looks(at www.jgoodies.com). Looks is free and open source. There's also a very elegant, but commercial, look and feel called the Alloy Look and Feel (take a look at www.incors.com.)

  • 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

  • JTree Button, Line and Java look and feel ?

    Hi all,
    I have 3 small problem with my JTree ..
    1) The 'expand' button size ...
    I set a different Icon for each node in a getTreeCellRendererComponent method (from a class that extends DefaultTreeCellRenderer )...
    The icon are 32x32 pixels.. .and the RowHeight and the Font have been changed too. .
    How to change the size of the expand button (+/-) near the text node ? Because on my JTree, the expand/collapse buttons are really small compare to the icon & row height.
    2) No line appear between the node ...
    I try to set the line style property with -> putClientProperty("JTree.lineStyle", "Angled"); in the JTree constructor OR in the DefaultTreeCellRenderer constructor .. but it doesn't work :/
    3) How to set a Java look and feel for my JTree (actually, I have a Windows look and feel ..)
    I know .. I have grouped 3 question in the same topic ...
    If anyone can help me on one of these subjects. .. Thanks !
    Regards,
    Didier

    So, the Problem 1) is solved ..
    About the Problem 2)
    I put the code UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel()) in the main method, like
      //Main method
      public static void main(String[] args) {
        try {
          UIManager.setLookAndFeel(new javax.swing.plaf.metal.MetalLookAndFeel());
        catch(Exception e) {
          e.printStackTrace();
        new MainApplication();
      }But it only set a Java L&F on the spliter, and on the toolbar contained in my application... Any idea why the title bar is not changed too ?
    (The title bar stay with a Window$ XP L&F ...)
    About the problem 3)
    When I set the L&F->UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); then the lines appear .. ??!! .. if I set again the previous value UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); .. then the lines desappear ..

  • Jdeveloper doesn't show inspect pop up while look and feel is windows

    Jdeveloper doesn't show inspect pop up while look and feel is windows

    Thanks for looking at the issue Frank. Here are the points:
    1. I debugging a java application using Jdeveloper 11g IDE
    2. I had modified the IDE look and feel to windows.
    3. The debugger stopped at a breakpoint and i tried to inspect the value of an expression.
    3.1. Select that expression using mouse.
    3.2. Right click on the expression
    3.3. click on the inspect option.
    4. I was expecting a pop-up window to appear. But it didn't come.
    5. Later i changed look and feel of IDE to Oracle/fusion(blue) which is the default.
    6. Repeated step 3.
    7. Got a pop up window and was able to inspect the value.
    Hope this info helps.
    -Sandeep.
    Edited by: Sandeep.Sundaram on Oct 17, 2008 2:13 PM

  • OHJ show blank topic window with Nimbus Look & Feel

    Hi,
    I am using Oracle Help for Java. When I switch to Nimbus Look & Feel the topic window is blank - it does not display topic information. When I click button <Print> in topic window the topic is printed correctly. The same help work properly in other Look & Feels.

    The application that demonstrates this problem is jEdit - an open source text editor. I was told that the development of this editor started before JScrollPane was added to the JRE. Currently there's a lot of code, with high complexity, that replaces the JScrollPane for the text component of the editor, and I wouldn't go change it now. But leave that aside - I am particularly interested to know if this behavior is a bug in Nimbus or maybe my understanding of it is incorrect.
    In any case I don't want to hide the casing of the scrollbar, just the scrollbar (thumb) inside the casing. Isn't it strange that without modifying the value or limits, the scrollbar suddenly appears when the view becomes wider? It should be the other way around, the scrollbar should become visible when the view becomes narrower than the contents.

  • Creating an messagebox in forms with look and feel of Windows

    I wanted to create an message box in my form with look and feel of windows.For this i used the package ORA.FFI...but i am getting an error....and i am not bale to clear it...the code is as follows
    Package Specification: -
    PACKAGE messagebox IS
    /*Function message_box calls windows MessageBox function. */
    FUNCTION message_box(plptext IN VARCHAR2,plpcaption IN VARCHAR2)
    RETURN PLS_INTEGER;
    END;
    Package body : -
    PACKAGE BODY messagebox IS
    lh_window ORA_FFI.LIBHANDLETYPE;
    fh_mb ORA_FFI.FUNCHANDLETYPE;
    lh_forms ora_ffi.libHandleType;
    /* Function i_mbx acts as the interface to the Messagebox
    function in windows
    FUNCTION i_mbx(funchandle IN ORA_FFI.FUNCHANDLETYPE,
    plptext IN OUT VARCHAR2,
    plpcaption IN OUT VARCHAR2)
    RETURN PLS_INTEGER;
    PRAGMA interface(C,i_mbx,11265);
    FUNCTION message_box(plptext IN VARCHAR2,
    plpcaption IN VARCHAR2)
    RETURN PLS_INTEGER IS
    ltext VARCHAR2(500) := plptext;
    lcaption VARCHAR2(500) := plpcaption;
    BEGIN
    RETURN(i_mbx(fh_mb,ltext,lcaption));
    END;
    BEGIN
    lh_window := ORA_FFI.LOAD_LIBRARY('d:\','DclMsgBox.dll');
    fh_mb := ORA_FFI.REGISTER_FUNCTION(lh_window,'DclMsgBox',ORA_FFI.C_STD);
    ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_CHAR_PTR);
    ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_CHAR_PTR);
    --ORA_FFI.REGISTER_RETURN(fh_mb,ORA_FFI.C_INT);
    END;
    Now when i call this function in When-New-Form-Instance as
    declare
    p number;
    begin
    p:=messagebox.message_box('hello','test');
    end;
    I had created an dll for message box and placed the .dll and .lib files in the d:\ of my system.
    I get an error message when i run the app. The error is:
    The instruction at "0x005a3b24" referenced memory at "0x00000006".The memory could not be "read".
    Can anybody please tell me where have i gone wrong....

    Colin Martin wrote:
    I agree the leather look is horrible. It's just not a reflection of the cutting edge modern design we have all got to love over the years. If it has to be there at least give us a choice of looks.
    There is a word for this (not that one) - skeuomorph. Wikipedia defines this as 'a derivative object that retains ornamental design cues to a structure that was necessary in the original. Skeuomorphs may be deliberately employed to make the new look comfortably old and familiar'.
    Common examples are found in audio software with pictures of actual knobs that you turn, as here; and the leather-bound tear-off look of calendar and contacts on the iPad is the same principle: the intention is to make it familiar and friendly to people who might otherwise be frightened off by a modern look because they are not used to modern technology. The whole concept and look of the iOS operating system is being brought into use on Macs for the same reason, to encourage non-tech-savvy people not to be frightened of them.
    This is all very well in its way, but in these two particular cases the result is unfortunate, particularly for experienced users, and it really ought to be possible to choose between the looks (as you can with the Mail layouts), even if the skeuomorph is the default.

  • Ok, using Windows Look-feel ... any changes?

    Hi:
    I am presently using the Kunststoft theme. I want to the use the SUN supplied Windows Look-feel, but I cannot change the black background in my desktop application. I use JInternal frames but start with a desktop pane.
    Does anyone know how to specifically change the black background over the "default" black background that the windows UI sets. I tried setBackground(new Color(255,0,0)); .. got red for a moment, then the screen changed to black.
    Any help appreciated. I really like the Windows Look-feel, but a lighter background desktop area is preferred.
    Thanks,
    PiratePete

    After you set the Windows L&F, you must set another property.
    Here is an example:
    //Set the system L&F
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    //Perhaps the system is windows, so you must do this if you want to see
    //the mnemonics without pressint Alt key
    WindowsLookAndFeel.setMnemonicHidden(false);

  • Linux: Look&Feel (Novell openSUSE 10.3, KDE, Java 6)

    I installed Java 6 Update 3 (JDK and JRE) on my openSUSE 10.3 / KDE system. It's running great, however, Java applications don't use the Look&Feel of KDE but the Java default one (even the Java Control Panel).
    Is there a way to change this, so that Java applications uses the Look&Feel of KDE (QT) or GNOME (GTK), depending on which GUI is being used?
    Thanks!

    I installed Java 6 Update 3 (JDK and JRE) on my openSUSE 10.3 / KDE system. It's running great, however, Java applications don't use the Look&Feel of KDE but the Java default one (even the Java Control Panel).
    Is there a way to change this, so that Java applications uses the Look&Feel of KDE (QT) or GNOME (GTK), depending on which GUI is being used?
    Thanks!

  • I'm looking for Java version j2sdk-1_4_2_16-windows-amd64

    Hello everyone.
    I need Java version j2sdk-1_4_2_16-windows-amd64
    On SUN site are only versions j2sdk-1_4_2_13-windows-amd64 and j2sdk-1_4_2_17-windows-amd64.
    Could enyone has this version?
    Thank you.

    hi,
    it was very hard to find  and you have to register at the sun website (should be free).
    https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=j2sdk-1.4.2_16-amd64-JPR@CDS-CDS_Developer
    PS: I don´t know why the link is crossed out. Should work anyway.
    I hope i could help.
    regards
    Tobias

  • Oracle Forms Look & Feel

    I want to change my forms look & fell thats why I performs below mention steps.But when form run the look & feel naver change only visual attribute of emp block becomes purple & when i change color then its not change means always remains purple.
    Steps Performed.
    1) My Forms install on C:\Oracle\Dmhome10g Direcotry.
    2) I am using Oracle JINITIATOR 1.3.1.17
    3) I am using JRE 1.4.2.17.
    4) My Os Platform Is Windows Advance Server 2000.
    5) I put Laf.Jar file in C:\Oracle\Dmhome10g\Forms90\Java.
    6) I open formsweb.cfg file & put archive=frmall.jar,laf.jar
    When I run the form then emp block visual attribute becomes purple & other theme remains defult no other changes performed. And when I change color then no action happened.
    I had 1 question in my mind.
    1) Where I put "DrawLAF.java" file.
    Regards
    Fahed Akhter

    Fahed,
    I'm not sure we are talking about the same thing. I am speaking about the Java console opened when you run your form (the little coffe-cup icon in the quick task bar) that should show something like this:
    Java Plug-in 1.5.0_12
    Utilisation de la version JRE 1.5.0_12 Java HotSpot(TM) Client VM
    Répertoire d'accueil de l'utilisateur = C:\Documents and Settings\Francois
    c: effacer la fenêtre de la console
    f: finaliser les objets de la file d'attente de finalisation
    g: libérer la mémoire
    h: afficher ce message d'aide
    l: vider la liste des chargeurs de classes
    m: imprimer le relevé d'utilisation de la mémoire
    o: déclencher la consignation
    p: recharger la configuration du proxy
    q: masquer la console
    r: recharger la configuration des politiques
    s: vider les propriétés système et déploiement
    t: vider la liste des threads
    v: vider la pile des threads
    x: effacer le cache de chargeurs de classes
    0-5: fixer le niveau de traçage à <n>
    proxyHost=null
    proxyPort=0
    connectMode=HTTP, native.
    La version Forms Applet est : 10.1.2.0
    Francois

  • Look & Feel of custom JOptionPanes

    How do you get the look and feel of custom built JOptionPane's to match that of the parent frame? Although the parent frame in my case is the java look and feel, the JOptionPane is showing up with a windows look and feel. I couldn't find any JOptionPane methods that even allowed one to reset the look and feel. Any suggestions would be appreciated. Thanks!

    You can set JOptionPane L&F parameters with:
    UIManager.put("OptionPane.background", Color.black);
    here is a list of all parameters for OptionPane, i hope helps you:
    OptionPane.errorDialog.titlePane.shadow-->javax.swing.plaf.ColorUIResource[r=204,g=102,b=102]
    OptionPane.warningDialog.titlePane.background-->javax.swing.plaf.ColorUIResource[r=255,g=204,b=153]
    OptionPane.errorDialog.titlePane.background-->javax.swing.plaf.ColorUIResource[r=255,g=153,b=153]
    OptionPane.buttonAreaBorder-->javax.swing.plaf.BorderUIResource$EmptyBorderUIResource@1815859
    OptionPane.warningDialog.titlePane.foreground-->javax.swing.plaf.ColorUIResource[r=102,g=51,b=0]
    OptionPane.questionDialog.border.background-->javax.swing.plaf.ColorUIResource[r=51,g=102,b=51]
    OptionPane.windowBindings-->[Ljava.lang.Object;@50d89c
    OptionPane.questionSound-->sounds/OptionPaneQuestion.wav
    OptionPane.errorSound-->sounds/OptionPaneError.wav
    OptionPane.warningSound-->sounds/OptionPaneWarning.wav
    OptionPane.errorDialog.titlePane.foreground-->javax.swing.plaf.ColorUIResource[r=51,g=0,b=0]
    OptionPane.buttonClickThreshhold-->500
    OptionPane.questionDialog.titlePane.background-->javax.swing.plaf.ColorUIResource[r=153,g=204,b=153]
    OptionPane.errorIcon-->javax.swing.plaf.IconUIResource@15b0afd
    OptionPane.warningDialog.titlePane.shadow-->javax.swing.plaf.ColorUIResource[r=204,g=153,b=102]
    OptionPane.font-->javax.swing.plaf.FontUIResource[family=Dialog,name=Dialog,style=plain,size=12]
    OptionPane.messageForeground-->javax.swing.plaf.ColorUIResource[r=0,g=0,b=0]
    OptionPane.informationSound-->sounds/OptionPaneInformation.wav
    OptionPane.questionDialog.titlePane.foreground-->javax.swing.plaf.ColorUIResource[r=0,g=51,b=0]
    OptionPane.informationIcon-->javax.swing.plaf.IconUIResource@1dfc547
    OptionPane.foreground-->javax.swing.plaf.ColorUIResource[r=0,g=0,b=0]
    OptionPane.border-->javax.swing.plaf.BorderUIResource$EmptyBorderUIResource@10f6d3
    OptionPane.messageAreaBorder-->javax.swing.plaf.BorderUIResource$EmptyBorderUIResource@cfec48
    OptionPane.background-->javax.swing.plaf.ColorUIResource[r=204,g=204,b=204]
    OptionPane.questionIcon-->javax.swing.plaf.IconUIResource@2a15cd
    OptionPane.minimumSize-->javax.swing.plaf.DimensionUIResource[width=262,height=90]
    OptionPane.questionDialog.titlePane.shadow-->javax.swing.plaf.ColorUIResource[r=102,g=153,b=102]
    OptionPane.errorDialog.border.background-->javax.swing.plaf.ColorUIResource[r=153,g=51,b=51]
    OptionPane.warningIcon-->javax.swing.plaf.IconUIResource@12d15a9
    OptionPane.warningDialog.border.background-->javax.swing.plaf.ColorUIResource[r=153,g=102,b=51]

  • Look & Feel, in JComboBox

    How would I allow the user to choose his preferred Look & Feel from a JComboBox, and make him press an 'OK button' to confirm his choice? I've tried some stuff, but I can't get it to work... ANY code would be extremely helpful, and I would be grateful for any suggestions.

    Hi,
    Create a String to hold the names of the different look n feels
    //create String to hold names of the different Look and feels
    String[ ] LAFNames = new String[ ] {"System Default", "Windows", "Java", "Mac OS", "Motif"};
    //String to hold users selection
    String storeLAFChoice;
    //or can use int
    int storeLAFSelection;
    //Actual JComboBox
    JComboBox LAFCB;
    //in your constructor initialise the JCB
      LAFCB = new JComboBox(LAFNames);
      LAFCB.setSelectedIndex(0);
      LAFCB.setMaximumRowCount(5);
      //create your frame/window
    //within your frame/window
    //storeLAFChoice =LAFCB.getSelectedItem().toString();
    //can use above with something like
    // if( storeLAFChoice.equals("Motif") ) { do motif Look n Feel }...
    storeLAFSelection = LAFCB.getSelectedItemIndex();
    switch(storeLAFSelection)
      //if sys def has been chosen
      case 0: try{  UIManager.setLookAndFeel(      
      UIManager.getSystemLookAndFeelClassName() );
      SwingUtilities.updateComponentTreeUI(the name of your main panel /frame here);
      }//ends try
      catch(Exception ex) {    } 
      //if  windows chosen
      case 1:  try{   UIManager.setLookAndFeel
    ("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
    SwingUtilities.updateComponentTreeUI(your main panel here);
    }//ends try
    catch(Exception ex) { //set to system default Look n feel }
      case n ....
      //for java:
      ...("javax.swing.plaf.metal.MetalLookAndFeel");...
      //for Mac OS
      ...("javax.swing.plaf.mac.MacLookAndFeel");...
      //for Motif
      ...("com.sun.java.swing.plaf.motif.MotifLookAndFeel");...
    }//ends switch
    ...I know this is very much a bits and pieces implementation, but good luck,
    Has.

  • Mac Look&Feel

    Can i use Mac Look&Feel in java app under Windows.
    Thanks

    i saw it mentioned on here once. i believe you just have to set your own os in the system preferences to mac. or mac OS or something like that.
    run sys.pref on a mac, get the os, then set that variable to that value in the windows machine. i believe that is all that is stopping you.
    i haven't done it, but i remember reading it on here.

Maybe you are looking for