Mapbuilder.jar: cannot initialize Look and Feel: null

When I try to start mapbuilder using java -jar mapbuilder.jar it crashes:
cannot initialize look and feel: null
error: java.lang.NullPointerException
Running under 64 bit Linux in a VNC session.
Anyone else seen this?
JAVA_HOME is set.

Try to use a java32 bit version (minimum jre 1.5 or later) and to give the complete path, I don't know a lot of Linux.
Cheers
Nico
Edited by: gerardnico on Aug 26, 2009 10:26 PM Add jre 1.5 or later

Similar Messages

  • Exception for Metouia look and feel

    hi,
    i m getting this exception when trying to change Metouia look and feel.
    like we have 3DLF.jar for ThreeD look and feel.
    if u have any solution pls suggest as soon.
    ThreeDPrefs.internalFrameTitleFont.getSize() 10
    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    *     at net.sourceforge.mlf.metouia.MetouiaScrollPaneUI.paint(MetouiaScrollPaneUI.java:89)*
    *     at javax.swing.plaf.ComponentUI.update(Unknown Source)*
    *     at javax.swing.JComponent.paintComponent(Unknown Source)*
    *     at javax.swing.JComponent.paint(Unknown Source)*
    *     at javax.swing.JComponent.paintChildren(Unknown Source)*
    *     at javax.swing.JComponent.paint(Unknown Source)*
    *     at javax.swing.JComponent.paintChildren(Unknown Source)*
    *     at javax.swing.JComponent.paint(Unknown Source)*
    *     at javax.swing.JComponent.paintChildren(Unknown Source)*
    *     at javax.swing.JComponent.paint(Unknown Source)*
    *     at javax.swing.JLayeredPane.paint(Unknown Source)*
    *     at javax.swing.JComponent.paintChildren(Unknown Source)*
    *     at javax.swing.JComponent.paint(Unknown Source)*
    *     at javax.swing.JComponent.paintToOffscreen(Unknown Source)*
    *     at javax.swing.BufferStrategyPaintManager.paint(Unknown Source)*
    *     at javax.swing.RepaintManager.paint(Unknown Source)*
    *     at javax.swing.JComponent._paintImmediately(Unknown Source)*
    *     at javax.swing.JComponent.paintImmediately(Unknown Source)*
    *     at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)*
    *     at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)*
    *     at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)*
    *     at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)*
    *     at java.awt.event.InvocationEvent.dispatch(Unknown Source)*
    *     at java.awt.EventQueue.dispatchEvent(Unknown Source)*
    *     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)*
    *     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)*
    *     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)*
    *     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)*
    *     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)*
    *     at java.awt.EventDispatchThread.run(Unknown Source)*

    [Look and Feel|http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/index.html]

  • Problems installing the new 'Look And Feel' done by Francios Degrelle

    I have download the new verison of the new 'Look And Feel' from
    http://sheikyerbouti.developpez.com/forms-pjc-bean/LAF/sources/v133/LAF_133.zip
    1- I defined a new section in formsweb.cfg named summit in the middle tier (AS 10g Rel2):
    [Summit]
    baseHTML=base.htm
    baseHTMLjinitiator=basejpi.htm
    baseHTMLjpi=basejpi.htm
    baseHTMLie=baseie.htm
    HTMLdelimiter=%
    workingDirectory=e:\app\summit
    envFile=default.env
    IE=JInitiator
    escapeparams=true
    form=customers_laf
    debug=no
    otherparams=buffer_records=%buffer% debug_messages=%debug_messages% array=%array% obr=%obr% query_only=%query_only% quiet=%quiet% render=%render% record=%record% tracegroup=%tracegroup% log=%log% term=%term% useSDI=yes
    buffer=no
    debug_messages=no
    array=no
    obr=no
    query_only=no
    quiet=yes
    render=no
    pageTitle=Summit
    serverURL=/forms/lservlet
    codebase=/forms/java
    imageBase=DocumentBase
    width=100%
    height=100%
    separateFrame=false
    splashScreen=no
    lookAndFeel=oracle
    colorScheme=blue
    logo=no
    restrictedURLparams=HTMLbodyAttrs,HTMLbeforeForm,pageTitle,HTMLafterForm,log,allow_debug,allowNewConnections
    serverApp=default
    archive_jini=frmall_jinit.jar
    archive=frmall.jar,laf.jar
    WebUtilArchive=
    jpi_download_page=http://java.sun.com/products/archive/j2se/1.4.2_09/index.html
    jpi_classid=clsid:8AD9C840-044E-11D1-B3E9-00805F499D93
    jpi_codebase=http://java.sun.com/products/plugin/autodl/jinstall-1_4-windows-i586.cab#Version=1,4,0,0
    2- then I put a copy of the file 'forms.css' in the middle tier in the folder :
    apache\apache\htdocs
    so as to be on the path and then modified PM$CSS_FILENAME in all forms to be 'forms.css' instead of 'c:\forms.css' and recompiled.
    3-I put a copy of the file 'laf.jar' in the folder : 'd\Ora_AS\forms\java' in the middle tier and added this path to the classpath environment variable.
    4- I restarted the middle tier and wrote this URL:
    http://test/forms/frmservlet/config=summit
    the customers form opened but with no background images,I added the following to the URL '&form=test_laf_color_scheme.fmx',the form opened with the default color scheme to 'purple',I changed it from a drop down list to orange and all buttons background color degraded to orange.
    My questions:
    1-where are the background images ?
    2- I cannot compile the 'laf.pll' file to 'laf.plx',when I compile I get this error:
    FRm-91507 -internal error
    P.S. I read this thread :
    FRM-91507 when compiling a library with Forms 6i
    and I didn't understand it,where do I change the Forms_Path? in the forms Home release 1 or Forms home release 2?!!!
    3-Is the 'forms.css' file properly located? if not? where do I put it?
    Sorry for the long scenario but I'm really confused?
    Thanks
    Mohammad

    Hello,
    I'm curently out of everything so I cannot answer this one. All I can tell is that images are read from the client machine or jar file. If you want read images from the application server, you need the http:// syntax.
    Francois

  • 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

  • Problem With ButtonUI in an Auxiliary Look and Feel

    This is my first post to one of these forums, so I hope everything works correctly.
    I have been trying to get an axiliary look and feel installed to do some minor tweaking to the default UI. In particular, I need it to work with Windows and/or Metal as the default UI. For the most part I let the installed default look and feel handle things with my code making some colors lighter, darker, etc. I also play with focus issues by adding FocusListeners to some components. I expect my code to work reasonably well no matter what the default look and feel is. It works well with Motif, Metal, and Windows, the only default look and feels I've tested with. What I'm going to post is a stripped down version of what I have been working on. This example makes gross changes to the JButton background and foreground colors in order to illustrate what I've encountered.
    I have three source code files. The first, Problem.java, creates a JFrame and adds five buttons to it. One button installs MyAuxLookAndFeel as an auxiliary look and feel using MyAuxButtonUI for the look and feel of JButtons. The next button removes that look and feel. The next button does nothing except print a line to System.out. The next button installs MyAuxLookAndFeel as an auxiliary look and feel using MyModButtonUI for the look and feel of JButtons. The last button removes that look and feel.
    The problem is, when I install the first auxiliary look and feel, buttons are no longer tabable. Also, they cannot be invoked by pressing the space button when they're in focus. When I remove the first auxiliary look and feel everything reverts to behaving normally. When I add the "Mod" version, button tabability is fine. The only difference is I've added the following code:
    if ( c.isFocusable() ) {
       c.setFocusable(true);
    }That strikes me as an odd piece of code to profoundly change the program behavior. Anyway, after adding and removing the "Mod" look and feel, the tababilty is forever fixed. That is, if I subsequently re-install the first look and feel, tababilty works just fine.
    The problem with using the space bar to select a focused button is more problematic. My class is not supposed to mess with the default look and feel which may or may not use the space bar to press the button with focus. When the commented code in MyModButtonUI is uncommented, things behave correctly. Even the statement
    button.getInputMap().remove( spaceKeyStroke );doesn't mess things up after the auxiliary look and feel is removed. So far I've tested this with JRE 1.4.2_06 under Windows 2000, JRE 1.4.2_10 under Windows XP, and JRE 1.5.0_06 under Windows XP and the behavior is the same.
    All of this leads me to two questions.
    1. Is my approach fundamentally flawed? I've extended TextUI and ScrollBarUI with no problems. This is the only problem I've encountered with ButtonUI. My real workaround for the space bar issue is better than the one I've supplied in the example, but it certainly is not guaranteed to work for any arbitrary default look and feel.
    2. Assuming I have no fundamental problems with my approach, it's possible I've found a real bug. I searched the bug database and couldn't find anything like this. Of course, this is the first time I've tried seasrching the database for a bug so my I'm doing it badly. Has this already been reported as a bug? Is there any reason I shouldn't report it?
    What follows is the source code for my example. It's in three files because the two ButtonUI classes must be public in order to work. Thanks for insight you can provide.
    Bill
    File Problem.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Problem extends JFrame {
       public boolean isAuxInstalled = false;
       public boolean isModInstalled = false;
       public LookAndFeel lookAndFeel = new MyAuxLookAndFeel();
       private static int ctr = 0;
       public static void main( String[] args ) {
          new Problem();
       public Problem() {
          this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setSize(250, 150);
          setTitle("Button Test");
          JButton install = new JButton("Install");
          JButton remove = new JButton("Remove");
          JButton doNothing = new JButton("Do Nothing");
          JButton installMod = new JButton("Install Mod");
          JButton removeMod = new JButton("Remove Mod");
          this.getContentPane().setLayout(new FlowLayout());
          this.getContentPane().add(install);
          this.getContentPane().add(remove);
          this.getContentPane().add(doNothing);
          this.getContentPane().add(installMod);
          this.getContentPane().add(removeMod);
          install.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isAuxInstalled ) {
                   isAuxInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          remove.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isAuxInstalled ) {
                   isAuxInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          doNothing.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                System.out.println( "Do nothing " + (++ctr) );
          installMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( !isModInstalled ) {
                   isModInstalled = true;
                   UIManager.addAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          removeMod.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
                if ( isModInstalled ) {
                   isModInstalled = false;
                   UIManager.removeAuxiliaryLookAndFeel( lookAndFeel );
                   SwingUtilities.updateComponentTreeUI( Problem.this );
          setVisible(true);
       class MyAuxLookAndFeel extends LookAndFeel {
          public String getName() {
             return "Button Test";
          public String getID() {
             return "Not well known";
          public String getDescription() {
             return "Button Test Look and Feel";
          public boolean isSupportedLookAndFeel() {
             return true;
          public boolean isNativeLookAndFeel() {
             return false;
          public UIDefaults getDefaults() {
             UIDefaults table = new MyDefaults();
             Object[] uiDefaults = {
                "ButtonUI", (isModInstalled ? "MyModButtonUI" : "MyAuxButtonUI"),
             table.putDefaults(uiDefaults);
             return table;
       class MyDefaults extends UIDefaults {
          protected void getUIError(String msg) {
    //         System.err.println("(Not) An annoying error message!");
    }File MyAuxButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import javax.swing.plaf.*;
    import javax.swing.plaf.multi.*;
    import javax.accessibility.*;
    public class MyAuxButtonUI extends ButtonUI {
       private Color background;
       private Color foreground;
       private ButtonUI ui = null;
       public static ComponentUI createUI( JComponent c ) {
          return new MyAuxButtonUI();
       public void installUI(JComponent c) {
          MultiButtonUI multiButtonUI = (MultiButtonUI) UIManager.getUI(c);
          this.ui = (ButtonUI) (multiButtonUI.getUIs()[0]);
          super.installUI( c );
          background = c.getBackground();
          foreground = c.getForeground();
          c.setBackground(Color.GREEN);
          c.setForeground(Color.RED);
       public void uninstallUI(JComponent c) {
          super.uninstallUI( c );
          c.setBackground(background);
          c.setForeground(foreground);
          this.ui = null;
       public void paint(Graphics g, JComponent c) {
          this.ui.paint( g, c );
       public void update(Graphics g, JComponent c) {
          this.ui.update( g, c );
       public Dimension getPreferredSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getPreferredSize( c );
          return this.ui.getPreferredSize( c );
       public Dimension getMinimumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMinimumSize( c );
          return this.ui.getMinimumSize( c );
       public Dimension getMaximumSize(JComponent c) {
          if ( this.ui == null ) {
             return super.getMaximumSize( c );
          return this.ui.getMaximumSize( c );
       public boolean contains(JComponent c, int x, int y) {
          if ( this.ui == null ) {
             return super.contains( c, x, y );
          return this.ui.contains( c, x, y );
       public int getAccessibleChildrenCount(JComponent c) {
          if ( this.ui == null ) {
             return super.getAccessibleChildrenCount( c );
          return this.ui.getAccessibleChildrenCount( c );
       public Accessible getAccessibleChild(JComponent c, int ii) {
          if ( this.ui == null ) {
             return super.getAccessibleChild( c, ii );
          return this.ui.getAccessibleChild( c, ii );
    }File MyModButtonUI.java:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.plaf.*;
    public class MyModButtonUI extends MyAuxButtonUI
       static KeyStroke spaceKeyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_SPACE, 0 );
       public static ComponentUI createUI( JComponent c ) {
          return new MyModButtonUI();
       public void installUI(JComponent c) {
          super.installUI(c);
          c.setBackground(Color.CYAN);
          if ( c.isFocusable() ) {
             c.setFocusable(true);
    //      final JButton button = (JButton) c;
    //      button.getInputMap().put( spaceKeyStroke, "buttonexample.pressed" );
    //      button.getActionMap().put( "buttonexample.pressed", new AbstractAction() {
    //         public void actionPerformed(ActionEvent e) {
    //            button.doClick();
    //   public void uninstallUI(JComponent c) {
    //      super.uninstallUI(c);
    //      JButton button = (JButton) c;
    //      button.getInputMap().remove( spaceKeyStroke );
    //      button.getActionMap().remove( "buttonexample.pressed" );
    }

    here is the code used to change the current look and feel :
    try {
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
             catch (InstantiationException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (ClassNotFoundException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (UnsupportedLookAndFeelException e)
                  System.out.println("Error occured  "+ e.toString());
             catch (IllegalAccessException e)
                  System.out.println("Error occured in .. " + e.toString());
             Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
             Fenetre fen = new Fenetre();
             fen.setSize(dim.width, dim.height);
             fen.setResizable(false);
                 fen.setLocation(0, 0);
                  fen.setVisible(true);

  • Look and Feel Resources

    Anyone know a good site that explains how to start writing you own Look and Feel? Been searching for a while and I can't seem to find one.

    I'm rather sure you will start a discussion about the pro's and con's here. My position is: It depends.
    A static initializer is called, when the class is loaded, and it is difficult to control, in what order classes are loaded. A static method is called when you do it explicitely. So the static method has the great advantage, that you can control the time and sequence.
    However, a programmer could forget to call a static method. The initializer however is guaranteed to be called. So from this point of view, it is an arguemt for the static initializer.
    Some of your examples are also candidates for lazy initialization: Do it automatically on first use, e.g.
    static Trace trace = null; // some trace object, initialized with null
    public static synchronized Trace getTrace() {
        if (trace == null)
            trace = new Trace();
        return trace;
    }

  • Oracle Forms Look and Feel project for Forms 6i

    Hello everybody,
    Recently I find a web site that introduce Oracle Forms Look and Feel project,
    Oracle Forms Look and Feel project
    http://sheikyerbouti.developpez.com/forms-pjc-bean/LAF/doc/Oracle_Forms_Look_and_Feel_project.htm
    Can I use the PL/SQL library (laf.pll) , Java Beans and PJCs grouped in a jar file (laf.jar) for Oracle Forms 6i?
    thx

    Hi Francois,
    I find one website mention the following,
    "PL/SQL tables reside in the private PL/SQL area of the Oracle Server database instance; they are not available as client-side structures at this time. As a result, you cannot declare and manipulate PL/SQL tables in your Oracle Developer/2000 environment."
    from http://www.unix.org.ua/orelly/oracle/prog2/ch10_01.htm#SQL2-CH-10-SECT-1
    Cheers,
    Gary

  • Transparent TextField with Synth Look and Feel

    I am trying to use synth to implement a textfield with a transparent background, and having some problems with it. I can see my panel and the transparent field fine enough in the beginning, but when the text in the field changes, it writes right over the previous text and becomes a pile of unreadable white marks. I've experimented with varying degrees of transparency, but you can still see the old field underneath slightly. Does anyone have any suggestions? My code is below.
    Thanks.
    synth.xml
    <synth>
    <!-- PANEL -->
    <style id="panelStyle">
        <state>
            <imagePainter method="panelBackground" path="../../../lafImages/papyrus_bkgd.gif" sourceInsets="10 15 10 15"/>
        </state>
    </style>
    <bind style="panelStyle" type="name" key="PAPYRUS_PANEL"/>
    <!-- TEXTFIELD -->
    <style id="textFieldStyle">
        <font name="Kudasai" size="12"/>
        <state>
            <color type="TEXT_FOREGROUND" value="#FFFFFF"/>
            <!-- set the alpha value for transparency in 1st two digits -->
            <color type="BACKGROUND" value="#00000000"/>
        </state>
        <opaque value="false"/>
    </style>
    <bind style="textFieldStyle" type="region" key="TEXTFIELD"/>
    </synth>
    my tester
    class SynthTester {
        private JTextField field;
        public SynthTester(){
            initLookAndFeel();
            JFrame main = new JFrame();
            JPanel panel = new JPanel();
            panel.setName("PAPYRUS_PANEL");
            field = new JTextField(3);
            field.setText("0");
            panel.add(field);
            JButton button = new JButton("+");
            button.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    int val;
                    try {
                        val = Integer.parseInt(field.getText());
                    } catch( Exception ex ) {
                        val = 0;
                    val++;
                    field.setText(Integer.toString(val));
            panel.add(button);
            main.add(panel);
            main.pack();
            main.setVisible(true);
        private void initLookAndFeel() {
            SynthLookAndFeel lookAndFeel = new SynthLookAndFeel(); 
            try {
                InputStream is = getClass().getResourceAsStream("synth.xml");
                if( is == null) {
                    System.err.println("unable to load resource stream");
                } else {
                    lookAndFeel.load(is, getClass());
                    UIManager.setLookAndFeel(lookAndFeel);
            } catch (Exception e) {
                System.err.println("Couldn't get specified look and feel ("+ lookAndFeel+ "), for some reason.");
                System.err.println("Using the default look and feel.");
                e.printStackTrace();
                System.exit(1);
    }

    As its name implies, an imagePainter element creates a SynthPainter that paints from an image. For example:
    <synth>
    <style id="example">
    <state>
    <color value="white" type="BACKGROUND"/>
    </state>
    <imagePainter method="panelBackground" path="background.png"
    sourceInsets="5 6 6 7" paintCenter="false"/>
    <insets top="5" bottom="6" right="7" left="6"/>
    </style>
    <bind style="example" type="region" key="Panel"/>
    </synth>

  • 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

  • Themed look and feel broken in sub-site

    We have several site collections in a farm using SP2013 + SP1 under a common web application that use a custom theme for the look and feel. After upgrading to SP2013 December 2014 CU, one of the site collections' custom theme is broken. Furthermore,
    the same site collection cannot use most of the OOTB themes. I have only successfully gotten the theme "Office" to work correctly. (I have not tested all the OOTB theme choices)
    Immediately after the CU was applied the CSS and JS on this site collection was not working. After changing the theme to "Office" I was able to test out other troubleshooting options. If I select another theme choice, the "try it out"
    page returns with an error "A cobalt error was thrown." This is not a helpful error for me and I could not find much on the internet regarding it. Another error I have received was "file not found", or yet another error "The
    URL
    '_catalogs/theme/Themed/4F147962/likefull.11x11x32-F47391E9.themedpng' is
    invalid.  It may refer to a nonexistent file or folder, or refer to a valid file
    or folder that is not in the current Web." I have not been able to fix the issue.
    I have found that under 'Site Settings' -> 'Web Designer Galleries' -> 'Themes' -> 'Themed' is a library of folders. My thought is that these folders are created dynamically when a new theme is applied. I have several folders, but all are empty
    except one. I am now trying to determine why these folders are empty.
    Any ideas?

    Hi,
    Please try to update the latest CU for SharePoint 2013(April 2015 CU for SharePoint 2013), then check whether the issue still exists or not.
    http://blogs.technet.com/b/stefan_gossner/archive/2015/04/14/april-2015-cu-for-sharepoint-2013-has-been-released.aspx
    In my test environment, the 'Themed' all folders are not empty.
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Stefankrause XP look and feel

    Hi
    I m posting this thread again. Can anyone show the way to get rid of SecretLoader class in Stefankrause look and feel. SerectLoader Code is not available on net , but this is used in Stefankrause XP look and feel.I have tried default icons but does not exactly serve the purpose.
    I've downloded code from
    http://www.stefan-krause.com/java/
    Or if u've info regarding where is icon file for Microsoft Windows XP on Computer that are used in Java, like icons for plus ,minus, or question mark etc.
    Thanx.

    Hi there, I've used this package and u can use DJ - the java decompiler or jad to decomile it. Or event u can use Gel(a Java IDE written in Java) to just double click the class file to view it's source. Gel can be found at http://www.gexperts.com/.
    note the code
    abyte0[l] ^= 0x2a;
    is what the author exactual encode the resource. u can alse use this method to get the original images, in fact, i've done this, hehe. Since abyte ^ 0x2a ^ 0x2a = abyte, this is just a bitwise operation equals.
    // SecretLoader.java
    // Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
    // Jad home page: http://kpdus.tripod.com/jad.html
    // Decompiler options: packimports(3)
    package com.stefankrause.xplookandfeel.skin;
    import java.awt.*;
    import java.io.ByteArrayOutputStream;
    import java.io.InputStream;
    import java.net.URL;
    import javax.swing.JPanel;
    public class SecretLoader
    public SecretLoader()
    static Image loadImage(String s)
    URL url;
    url = (com.stefankrause.xplookandfeel.skin.SecretLoader.class).getResource("/com/stefankrause/xplookandfeel/icons/" + s);
    Object obj = null;
    Image image;
    InputStream inputstream = url.openStream();
    ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
    byte abyte0[];
    if(s.endsWith(".res"))
    inputstream.read();
    inputstream.read();
    for(int i = inputstream.read(buffer); i != -1; i = inputstream.read(buffer))
    bytearrayoutputstream.write(buffer, 0, i);
    abyte0 = bytearrayoutputstream.toByteArray();
    for(int l = 0; l < abyte0.length; l++)
    abyte0[l] ^= 0x2a;
    } else
    for(int j = inputstream.read(buffer); j != -1; j = inputstream.read(buffer))
    bytearrayoutputstream.write(buffer, 0, j);
    abyte0 = bytearrayoutputstream.toByteArray();
    int k = inputstream.read(abyte0);
    image = Toolkit.getDefaultToolkit().createImage(abyte0, 0, abyte0.length);
    MediaTracker mediatracker = new MediaTracker(panel);
    mediatracker.addImage(image, 0);
    try
    mediatracker.waitForID(0);
    catch(InterruptedException interruptedexception) { }
    return image;
    Throwable throwable;
    throwable;
    throw new IllegalArgumentException("File " + s + " could not be loaded.");
    static JPanel panel = new JPanel();
    static byte buffer[] = new byte[4096];
    }

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

  • Motif look and feel

    if i run the following code,it displayes a dialog with missing title text
    import javax.swing.JOptionPane;
    import javax.swing.UIManager;
    public class TestMotif {
         * @param args
         public static void main(String[] args) {
              try
                   //UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                   UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              JOptionPane.showMessageDialog(null, "done", "Confirmation Dialog for testing",
                        JOptionPane.INFORMATION_MESSAGE);
    in motif look and feel(system look and feel for solaris os)the dialog size is dependent on the message text length not on tilte text length.
    whereas in other look and feel the dialog size is dependent on both message and title text length.I raisedn it in sun's bug but didnt get any reply.Can anyone tell how can it be fixed in jre level.
    Edited by: AGS_CONTACT on Jun 30, 2008 11:07 AM

    It's not the answer you want to hear, but it's pretty simple:
    Write your own JDialog subclass that implements the behavior you want. It should be pretty straightforward to write a JOptionPane message dialog clone.

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

  • Emty topic window in Nimbus Look and Feel

    I have Java applications using OHJ. When we swith to Nimbus Look and Feel our topic Windows is blank. Helps work correctli in other look and feels. If I print topic it's is printed correctly, so information is there but it is not visible.

    AndrewThompson64 wrote:
    No, I'd say it is a pity that you did not initially use layouts when creating the code in Netbeans. There is no point blaming the tool. Well, some of this code is almost 10 years old (and i didn't write it), and back then nobody used layouts correctly. Even now java layouts are a pain to use compared with other GUI layouts (FLEX, HTML). Our customer just wants a prettier GUI on top of this legacy java app.
    We looked at incrementally using JavaFX to slowly change out screens, but it doesn't support integration with a regular java application (why?)
    Even with a unsupported workaround i cannot open a modal dialogs from JavaFX. I think they are targeting JavaFX at the wrong market, it is usless as a RIA and will never beat out Flash. They should have targeted it as a Swing replacement. Just my 2 cents.
    >
    That seems a shoddy 'solution'. Even the current code under the current PLAF might fail on another screen size, resolution, default font size or a number of other factors..This is true, unfortunately the code base is very very large (300k lines).

Maybe you are looking for

  • 871 Config issues

    Ok I dont know if its just staring at me ridiculing me but I am feeling like an idiot here... I have an 871 and all I need to do is some basic rules.. Here is the config I am  having the issue with... I need these statics: .227 opened and forwarded t

  • Hooking up to DSL

    FINALLY upgrading from my G3 tower with dialup to a new iMac Duo Core purchased yesterday. My ISP wants to sell me a DSL modem for $99.95. A Westell DMT 36R516. What other options do I have? I did a Google search and found refurbished versions of thi

  • Best method for duplicating a page layout

    As you may have seen form my other detailed queries I am struggling to relpicate layouts to new pages. What is the best method for this?

  • Sending out a mass email....

    This may be a weird question but I'm lost here. I'm trying to send out a mass email and I want my jpg in the BODY of the email and not as an attachment. Sometimes it goes into the body and other times it will send as an attachment. Is there an obviou

  • Installation error -  LiveCycle Enterprise Suite 4 - Designer DEMO

    Hi, I've downloaded the demo version of Adobe LiveCycle Enterprise Suite 4 - Designer and it's asking for a serial? Is this normal, where do I get a serial to run my demo version? Cheers, Veronica