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.

Similar Messages

  • Setting the Brushed Metal look and feel for macs using Java.

    Hello,
    I am relatively new to Java and I am new to Mac-specific java stuff. Anyways, when I try to set the look and feel of my classes to the "apple.awt.brushMetalLook" look and feel, I am unable to. It works if I have System.setProperty("apple.awt.brushMetalLook", "true"); written before I create any swing component. This would be fine, except that means that it is impossible to extend any swing component, such as JFrame or JApplet. Is there a way around this?
    Thanks!

    This might answer your question:
    http://lists.apple.com/archives/Java-dev/2003/Apr/msg00829.html

  • Is it possible to set more than one look and feel (laf) to a java program?

    Hi
    For example,
    I really like the windows system look/feel for the menubar + JTabbedPane etc...
    But i also like the standard Java'a look/feel for some other components like JButton, JSliders etc..
    if so how?
    Cause at the moment i only set laf right at the start of the program (main bit) before i actually initialise the swing ui components, so that they all have my defined laf set
    thanks

    You can add up to three 'aliases' to your account - these are additional addresses (not accounts) which deliver into the same inbox as the main address.
    You set them up at http://icloud.com - go to the Mail page, click the cogwheel icon at top right, choose 'Preferences', then in the pane which opens go to 'Accounts' and click the '+' button below the list area.
    Note that aliases stick permanently with the account which created them. You cannot move them to another account nor turn them into a full account, and if you delete one you cannot reinstate it.

  • Create or Customize a look and feel

    I'd like to create my own java look and feel and I wonder if a tool that allows to create or customize my laf exists ? What's the better or faster way to do so ?

    LookAndFeel lf = UIManager.getLookAndFeel();
             // Install a different look and feel; specifically, the Windows look and feel
             try {                         //com.sun.java.swing.plaf.windows.WindowsLookAndFeel
                                            //javax.swing.plaf.metal.MetalLookAndFeel
             UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
             } catch (InstantiationException e) {
             } catch (ClassNotFoundException e) {
             } catch (UnsupportedLookAndFeelException e) {
             } catch (IllegalAccessException e) {
             }

  • PushButton with Windows XP Look and Feel

    Hi all,
    I am looking for a way to give my buttons in my Oracle Forms 10gR2 (with Sun JPI 1.5) a Windows XP look and feel. In my formsweb.cfg I can choose between a generic and an oracle look and feel. The generic look and feel claims to have the windows look and feel, but unfortunatly, this is a Windows 3.11 L&F. Because of the overall look and feel of the Oracle L&F we decided on using this L&F but we would like our buttons to look like other buttons in Windows XP. I think this can be done by building a specific java implementation class but I have no experience with this.
    Did anybody already build such an implementation class and willing to share it with me?
    Thanks in advance,
    Harold

    The only way to accomplish this is with a Java Bean or PJC. Refer to the Oracle Forms Demos for some examples of what can be done with Beans and PJCs. Also, refer to the following page:
    http://forms.pjc.bean.over-blog.com/categorie-450786.html
    Forms Demos on OTN:
    http://www.oracle.com/technology/sample_code/products/forms/index.html
    One other suggestion would be to use:
    LookAndFeel=oracle
    colorScheme=blaf
    This will not resemble XP, but does offer a more professional looking application over the standard colors. BLAF was originally created for Oracle Applications, but works in all versions of Forms 6i and newer. BLAF = Browser Look And Feel

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

  • Drawing window borders swing look and feel

    Does anyone know how to change the frame window border from being drawn in the windows look and feel? I want them to be drawn as a swing application. Can anyone help?

    Frames (and JFrames) are top-level containers that are not subject to rendering by the Look-and-Feel manager (they are actually "heavy-weight" native components). However, in 1.4 it is possible to use an undecorated frame (using Frame.setUndecorated(true)) which you could paint to look like a JInternalFrame. However, I think you lose the automatic handling of resizing, moving, iconifying, maximizing, closing, etc.

  • Webutil Open File Dialog look and feel

    Webutil all revisions?, Windows NT 4.0/XP.
    The open/save file dialog boxes in webutil are always the same style (Oracle/Motif?) when either the LookandFeel is set to Generic/Windows or Oracle/Motif.
    Is there anyway to change it to always look like Windows Look and Feel?

    Hello,
    One possible way would be to write your own Java Bean component that call the standard openfile dialog, then set the LAF yourself:
       UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
       ...but, I know, this represents some extra work.
    Francois

  • Swing: Look and Feel

    I've found this page with a nice look and feel:
    https://substance.dev.java.net/docs/skins.html#CremeSkin
    But I can't use it.
    I import this:
    import org.jvnet.substance.skin.SubstanceCremeLookAndFeel;
    And do this:
    UIManager.setLookAndFeel(new SubstanceCremeLookAndFeel());
    But the import-libary are not correct. Hope somebody can help me! I'm using netBeans.

    you can add LAF without changing of code. Start app from command line like this
    @call set_classpath.bat
    @set classpath=../../laf/substance.jar;%classpath%
    @java -Dswing.defaultlaf=org.jvnet.substance.SubstanceLookAndFeel myPkg.myApp
    see quick review of LAF's - http://sss1024.googlepages.com/

  • Where does the JeelyBeans look and feel come from?

    Where does the JellyBeans Swing look & feel come from that is used in
    Workshop UI?
    -Nick

    Nick -- Thanks for the kind words.
    While we don't have plans to make the look and feel available outside of the IDE,
    you may want to check out some of the other look and feel resources within the
    Java community such as
    www.javootoo.com
    or
    http://directory.google.com/Top/Computers/Programming/Languages/Java/Class_Libraries/Graphics/User_Interface_Classes/Look_and_Feels/?tc=1
    We did use JDK 1.4 for Workshop and were very pleased with its performance and
    other aspects.
    - Pete Horadan
    Workshop Dev Mgr.
    "Nick Minutello" <[email protected]> wrote:
    I think it would be excellent if BEA made the JellyBeans look and feel
    freely available - even getting it added to the Sun JDK.
    There is a distinct interest in developing C# clients purely due to the
    fact
    that Swing doesnt perform and doesnt look good. JDK1.4 reportedly has
    numerous performance improvents. What is missing is a good look and feel.
    The Jelly Beans look and feel is quite good (I suspect that it is no
    accident that its flat look is similar to Visual Studion .NET.).
    I think that encouraging developers to remain with Java for GUI clients
    can
    only be good for Java and in turn J2EE as a whole. A pure java environment
    would be much better than a deliberatly mixed environment. Java RMI is
    much
    simpler than SOAP, etc.
    Aside from the ultruistic viewpoint, we would dearly like to use it in
    our
    Swing applications - perhaps we can stave off a turn to C# / .net clients.
    Regards,
    Nick
    "Carl Sjogreen" <[email protected]> wrote in message
    news:[email protected]...
    At this point we don't have plans to license the look and feel of the
    application (the swing components) separately, but I'd love to hearmore
    about what you had in mind.
    -Carl
    "Nick Minutello" <[email protected]>
    wrote
    in message news:[email protected]...
    I am really interested in the answer to this question... please
    =+=+=+=
    Does BEA have any intentions of making the look & feel commercially
    or
    freely
    available? (esp for existing, but potentially growing customers ;-)
    -Nick
    =+=+=+=
    -Nick
    "Ian M. Goldstein" <[email protected]> wrote in message
    news:[email protected]...
    It's homegrown. (There is no pluggable look-and-feel at this time.)
    Ian M. Goldstein
    Developer Relations Engineer
    BEA Systems, Inc.
    "Nick Minutello" <[email protected]>
    wrote
    in message news:[email protected]...
    Where does the JellyBeans Swing look & feel come from that is
    used
    in
    Workshop UI?
    -Nick

  • Ask for Look and Feel examples

    Hi,
    I'm reading "Java Look and Feel Design Guidelines" (http://java.sun.com/products/jlf/ed2/book/index.html). It's very interesting! But I don't have the lib to test its example (samples.accessory.*). If you have one, could you share it to me?
    Thank you very much!
    Best regards,
    Lehoanq

    check this URL
    http://www.javootoo.com/
    very good look & feel stuff
    GoodLuck

  • 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

  • Look and Feel Issues from NWDS 7.0.9 on Windows 7

    Dear Experts,
    I have successfully installed a new NWDS 7.0.9 on my 18' inch laptop:
      Windows 7 (64Bit)
      JDK 1.4.18 (32Bit)
    The NWDS starts without any problems however, i am begining to experience some erratic behavior from the projects i have created.
    For instance, when i attempt to Edit the Application  Properties for a WDJ project, the neccessary fields (and tabs) are not displayed hence i am unable to edit properties like the 'ExpirationTime' or create new one for that matter.
    In some cases,i am unable to embed a View into a Window because the neccessary fields to aid my selection of the view i want to embed are not visible for interaction.
    The same challenge occurs with EAR project; i am unable to edit 'application-j2ee-engine.xml' fields because they are not visible.
    After some troubleshooting,i discovered that the screen resolution may be affecting the 'Look and Feel' of the NWDS itself,
    If i reduced the resolution from 1024*768 to a value much more lower, some of these controls are displayed but with the desktop completely messed up.
    Does anybody have a solution to my problem because this challenge is affecting my productivity?
    Could my issue be as a result of my laptop screen size (i am using an 18'inch laptop)?
    Best regards,
    Bakau Onafuwa
    Oceanic Bank Int'l PLC

    Hi Vishal,
    first go to the download section in SMP.
    Roughly follow this path (translated from german ;-):
    SAP Software Distribution Center -> Download -> Further Download-Infos -> SAP Support Package Stacks -> SP Stack Download
    From list select SP Stack SAP NetWeaver 2004s
    A new window will pop up:
    1. Select your stack
    2. Usage Selection: Application Server Java
    3. Next Step
    4. Under SAP Kernel xx bit select your DB and OS
    5. Next Step
    6. You get a list of all components of you selected items.
    Here you'll find NWDS with a filename like JIDE09P_1-10003480.SAR
    You know the rest, right?
    Regards,
       ok

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

  • Windows XP Look and Feel

    Hi,
    When I use Windows XP style Look & Feel on Windows XP Title Bar and Scroll Bar disappears or the color is set to transparent.
    I set Look and Feel using:
    UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    Even I run SwingSet2 on Windows XP and set the Look & Feel to Windows XP Style the result is the same.
    Is there any recommendation about this?
    Thanks...

    I forgot to say that I am using Java SDK v1.4.2_4

Maybe you are looking for

  • How to create a view object and attach with extended AM

    Hi, I tried to create new vo and attach this vo with the extended AM. But it is throwing error like 'PC.NAME : invalid identifier' (Actually this PC.NAME is exiting one). Now i want to know how to create a view object similar like seeded one but with

  • Apple 16" Color Display with 15" Aluminium Powerbook?

    I have pulled my old Mac 16" Color Display out of the shed, only to discover that my 15" powerbook Al running 10.4.6, once connected via DVI-VGA and VGA-Apple VGA, won't show the necessary 832 x 624 resolution option, so I can't use it. When I connec

  • Reactive Acrobat 8.3.1

    I had to reinstall Windows 8.1 after a Microsoft update misfire.  Now I can't print with Acrobat 8 because I need to activate it.  The activate option on the Help menu is not available.  How to?

  • Is it possible to make a keyboard shortcut for a specific color for fonts?

    I'm a novice InDesign user and these forums have been a great resource, so thank you for your time. I'm doing a very complicated "text art" project and I'd like to be able to change text colors right from the keyboard. In Word, one is able to make a

  • Can you replace the HD in a macbook pro with a SSD?

    I recently got a new macbook pro 17" 2.2ghz i7 with 720gb SATA HD and was wondering if it would be easy enough (considering it is only a SATA) to replace the current SATA with like a 256GB solid-state drive (SSD), or if its only designed to work with