MetalLookAndFeel

Hi all,
I'm quite new with GUI development and I would ask to you a question about look and feel.
I know that the default look and feel for a java application using swing is javax.swing.plaf.metal.MetalLookAndFeel, ok.
I'm creating a very simple application and each time I add a component, I try to execute this simple gui to see if all went ok.
I don't know why, but now the lookandfeel Metal has disappeared, how is it possible?
I tried also to create a new java project, creating only a frame with a menubar, and it has the metal lookandfeel, insted in my simple applciation that lookandfeel has disappeared!
But I'm sure that in the beginning there was that metal lookandfeel, have you some ideas?
Thank you very much for the answers!
Bye
Raffaele

Sorry but I'm not so beginner to change the LAF without understanding what I'm doing....
I also tried to force the LAF to metal but nothing has happened:
         try {
             UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
         } catch (InstantiationException e) {
              e.printStackTrace();
         } catch (ClassNotFoundException e) {
              e.printStackTrace();
         } catch (UnsupportedLookAndFeelException e) {
              e.printStackTrace();
         } catch (IllegalAccessException e) {
              e.printStackTrace();
         }In your opinion why that code should not install that LAF that I correctly specified?
And why instead the com.sun.java.swing.plaf.windows.WindowsLookAndFeel runs correctly?
Thank you

Similar Messages

  • Change MetalLookAndFeel JLabel Color?

    I am wanting to use the MetalLookAndFeel in my application, but want the color for all my JLabels to be Black instead of the purpleish color I understand how to create your own custom color themes but cannot find out how to change the JLabel color does anybody know what needs to be in myCustom theme that will change that color to black?

    Not sure if this is exactly what you are after but...
    JLabels are usually transparent to start with and show the underlying component's background colour. If you want to change the background, you have to set the color and then use setOpaque(true).

  • Changing color of MetalLookAndFeel menuText

    Is it possible to change the color of menuText without subclassing MetalLookAndFeel?
    E.g., just by calling UIManager.put("menuText", new Color(...))?
    Is there a list with all defaults, something like this page: http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/_nimbusDefaults.html#primary
    Thanks!

    The best way to see what UI defaults there are (and they vary with the L&F in use) is to use Rob Camick's utility here.
    For Metal it looks like "Menu.foreground" and "Menu.selectionForeground".

  • Need help to draw recangle on video

    Hi guys ,
    Below I have pasted my code . In this code I have defined frame and in that frame stored video run. The other class has defined rectangle in cnvas . My problem is that I want rectangle to be drawn on video player and I havnt been successful.
    So its my reequest to please help me out.
    Thanks a ton in advance........
    public class Map extends JFrame
    * MAIN PROGRAM / STATIC METHODS
    public static void main(String args[])
    Map mdi = new Map();
    static void Fatal(String s)
    MessageBox mb = new MessageBox("JMF Error", s);
    * VARIABLES
    JMFrame jmframe = null;
    JDesktopPane desktop;
    FileDialog fd = null;
    CheckboxMenuItem cbAutoLoop = null;
    Player player = null;
    Player newPlayer = null;
    //JPanel glass = null;
    SelectionArea drawingPanel;
    String filename;
    // code//
    //ArrayList<Rectangle> rectangles = new ArrayList<Rectangle>();
    // boolean stop=false;
    * METHODS
    public Map()
    super("Java Media Player");
    drawingPanel = new SelectionArea(this);
    // Add the desktop pane
    setLayout( new BorderLayout() );
    desktop = new JDesktopPane();
    desktop.setDoubleBuffered(true);
    add("Center", desktop);
    setMenuBar(createMenuBar());
    setSize(640, 480);
    setVisible(true);
    //add(drawingPanel);
    //drawingPanel.setVisible(true);
    try
    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
    catch (Exception e)
    System.err.println("Could not initialize java.awt Metal lnf");
    addWindowListener( new WindowAdapter()
    public void windowClosing(WindowEvent we)
    System.exit(0);
    Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
    private MenuBar createMenuBar()
    ActionListener al = new ActionListener()
    public void actionPerformed(ActionEvent ae)
    String command = ae.getActionCommand();
    if (command.equals("Open"))
    if (fd == null)
    fd = new FileDialog(Map.this, "Open File",
    FileDialog.LOAD);
    fd.setDirectory("/movies");
    fd.show();
    if (fd.getFile() != null)
    String filename = fd.getDirectory() + fd.getFile();
    openFile("file:" + filename);
    else if (command.equals("Exit"))
    dispose();
    System.exit(0);
    MenuItem item;
    MenuBar mb = new MenuBar();
    // File Menu
    Menu mnFile = new Menu("File");
    mnFile.add(item = new MenuItem("Open"));
    item.addActionListener(al);
    mnFile.add(item = new MenuItem("Exit"));
    item.addActionListener(al);
    // Options Menu
    Menu mnOptions = new Menu("Options");
    cbAutoLoop = new CheckboxMenuItem("Auto replay");
    cbAutoLoop.setState(true);
    mnOptions.add(cbAutoLoop);
    mb.add(mnFile);
    mb.add(mnOptions);
    return mb;
    * Open a media file.
    public void openFile(String filename)
    String mediaFile = filename;
    Player player = null;
    // URL for our media file
    URL url = null;
    try
    // Create an url from the file name and the url to the
    // document containing this applet.
    if ((url = new URL(mediaFile)) == null)
    Fatal("Can't build URL for " + mediaFile);
    return;
    // Create an instance of a player for this media
    try
    player = Manager.createPlayer(url);
    catch (NoPlayerException e)
    Fatal("Error: " + e);
    catch (MalformedURLException e)
    Fatal("Error:" + e);
    catch (IOException e)
    Fatal("Error:" + e);
    if (player != null)
    this.filename = filename;
    JMFrame jmframe = new JMFrame(player, filename);
    desktop.add(jmframe);
    if (player.getVisualComponent() != null)
    getContentPane().add(player.getVisualComponent());
    player.start();
    jmframe.add(drawingPanel);
    drawingPanel.setVisible(true);
    /*validate();
    public void paint(Graphics g)
    drawingPanel.repaint();
    public void update(Graphics g)
    paint(g);
    drawingPanel.repaint();
    class SelectionArea extends Canvas implements ActionListener, MouseListener, MouseMotionListener
    Rectangle currentRect;
    Map controller;
    //for double buffering
    Image image;
    Graphics offscreen;
    public SelectionArea(Map controller)
    super();
    this.controller = controller;
    addMouseListener(this);
    addMouseMotionListener(this);
    public void actionPerformed(ActionEvent ae)
    repaintoffscreen();
    public void repaintoffscreen()
    image = createImage(this.getWidth(), this.getHeight());
    offscreen = image.getGraphics();
    Dimension d = size();
    if(currentRect != null)
    //Rectangle box = new Rectangle();
    //box.getDrawable(currentRect, d);
    Rectangle box = getDrawableRect(currentRect, d);
    //Draw the box outline.
    offscreen.drawRect(box.x, box.y, box.width - 1, box.height - 1);
    repaint();
    public void mouseEntered(MouseEvent me) {}
    public void mouseExited(MouseEvent me){ }
    public void mouseClicked(MouseEvent me){}
    public void mouseMoved(MouseEvent me){}
    public void mousePressed(MouseEvent me)
    currentRect = new Rectangle(me.getX(), me.getY(), 0, 0);
    repaintoffscreen();
    public void mouseDragged(MouseEvent me)
    System.out.println("here in dragged()");
    currentRect.setSize(me.getX() - currentRect.x, me.getY() - currentRect.y);
    repaintoffscreen();
    repaint();
    public void mouseReleased(MouseEvent me)
    currentRect.setSize(me.getX() - currentRect.x, me.getY() - currentRect.y);
    repaintoffscreen();
    repaint();
    public void update(Graphics g)
    paint(g);
    public void paint(Graphics g)
    g.drawImage(image, 0, 0, this);
    Rectangle getDrawableRect(Rectangle originalRect, Dimension drawingArea)
    int x = originalRect.x;
    int y = originalRect.y;
    int width = originalRect.width;
    int height = originalRect.height;
    //Make sure rectangle width and height are positive.
    if (width < 0)
    width = 0 - width;
    x = x - width + 1;
    if (x < 0)
    width += x;
    x = 0;
    if (height < 0)
    height = 0 - height;
    y = y - height + 1;
    if (y < 0)
    height += y;
    y = 0;
    //The rectangle shouldn't extend past the drawing area.
    if ((x + width) > drawingArea.width)
    width = drawingArea.width - x;
    if ((y + height) > drawingArea.height)
    height = drawingArea.height - y;
    return new Rectangle(x, y, width, height);
    }

    Chances of someone reading a gazillion lines of unformatted code: < 1%
    Paste your code (from the source), highlight it and click the CODE button to retain formatting and make it readable.

  • Same size of a JPanel & a JDesktopPane

    HI, can someone please tell how to set the same size of JPanel and of JDesktopPane that are in the same JFrame?, I've tried setting the size of the JPanel but when I run it the JPanel is reduced. Here is the code:
    import java.awt.*;
    import javax.swing.*;
    public class Ventana extends JFrame{
        JDesktopPane desktop;
        public Ventana (String title){
            super(title);
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            int maxX = screenSize.width - 400;
            int maxY = screenSize.height - 400;
            setPreferredSize(new Dimension(maxX, maxY));
            JPanel desktopPane = new JPanel();
            desktopPane.setLayout(new BoxLayout(desktopPane, BoxLayout.Y_AXIS));
            JPanel panelBotones = new JPanel();
            panelBotones.setSize(maxX, maxY/2);
            JButton aceptar = new JButton("Aceptar");
            panelBotones.add(aceptar, BorderLayout.PAGE_END);
            desktopPane.add(panelBotones);
            JSeparator sep = new JSeparator();
            desktopPane.add(sep);
            desktop = new JDesktopPane();
            desktop.setSize(maxX, maxY/2);
            JInternalFrame jif = new JInternalFrame("JIF", true, true, true, true);
            jif.setSize(new Dimension(maxX-9, maxY-10));
            desktop.add(jif);
            jif.setVisible(true);
            desktopPane.add(desktop);
            setContentPane(desktopPane);
            desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
            pack();
        public static void createAndShowGUI(){
            try{
                 // Set System L&F
                 JFrame.setDefaultLookAndFeelDecorated(true);
                 JDialog.setDefaultLookAndFeelDecorated(true);
                 System.setProperty("sun.awt.noerasebackground", "true");
                //UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            catch (ClassNotFoundException e) {
               // handle exception
            catch (Exception e) {
                try{
                    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
                }catch(Exception f) {
            Ventana miVentana = new Ventana("Ventanita");
            miVentana.setLocationRelativeTo(null);
            miVentana.setVisible(true);
        public static void main(String [] args){
            java.awt.EventQueue.invokeLater(new Runnable(){
                public void run(){
                    createAndShowGUI();
    }

    Never use setSize() when using a layout manager. Use setPreferredSize (and sometimes setMinimumSize and setMaximumSize).
    If you want components to be the same size then just use a GridLayout. Of course a GridLayout will just ignore the preferred size and allocate all the space available between the two components.
    Edited by: camickr on Jun 27, 2009 11:58 PM

  • Swing and jmf

    can u please have a look to the attached file
    i know that this involves the jmf API but I have the feeling that has to do more with swing, thats whay I post my question here
    this simple application is based on the MDI.java example of the jmf web
    pages
    I also added a slider and want to set the playback rate for the player from
    there if possible
    that is I want everytime that I move the slider and the value is biggerthan
    50 the rate to be reduced according to a simple calculation that converts
    the slider value to a value between 0 an1 for the rate...
    so all i want to do is pass the slider value to the player everytime that
    the slider changes value and this is bigger than 50
    the attached file can do that only when the player starts playing the
    file,,,,
    after the player has started and the rate is set I cant change it even if
    the slider moves
    when I tried to do that from within the stateChanged method of the slider I
    was getting a Nullpointer exception because of the EventDispatching thread,
    so I thought to take this piece of code out of there (create the setnewrate
    method in the jmframe instead),,,,but then of course doesnt work like I
    would want,,,,,
    do I have to register the class that implements the frame for the player as
    a ChangeListener on the slider to achieve that, is something like that
    possible....
    I know that swing is not supposed to be thread safe, so maybe this is what
    the problem is after all...any suggestions to that direction?
    Can u please have a look??
    I am a beginner so any help would really be very much appreciated
    thanx :)
    maria
    .....and the attached file
    I think the problem is with the stateChanged method for the Jslider...
    I am getting a null pointerexception because of the eventdispatching thread
    pls ignore any silly mistakes I am a completely newbie in java
    myAppfr2.java
    import javax.media.*;
    import com.sun.media.ui.*;
    import javax.media.protocol.*;
    import javax.media.protocol.DataSource;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    import java.util.Vector;
    import javax.swing.border.Border.*;
    import java.util.Hashtable;
    public class myAppfr2 extends Frame {
    * VARIABLES
    JMFrame jmframe = null;
    JDesktopPane desktop;
    FileDialog fd = null;
    CheckboxMenuItem cbAutoLoop = null;
    Player player ;
    //Player newPlayer = null;
    String filename;
    boolean stopped;
    public my_slider test_slider;//put it here so I can use it by name by all code
    float rate;
    * MAIN PROGRAM / STATIC METHODS
    public static void main(String args[]) {
    //if (args.length > 0)
         //rate=Float.parseFloat(args[0]);
    myAppfr2 mdi = new myAppfr2();
    static void Fatal(String s) {
    MessageBox mb = new MessageBox("JMF Error", s);
    * METHODS
    public myAppfr2() {
    super("VHE Demo");
    // Add the desktop pane
    setLayout( new BorderLayout() );
    desktop = new JDesktopPane();
    desktop.setDoubleBuffered(true);
         desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);//makes dragging faster
    add("Center", desktop);
    setMenuBar(createMenuBar());
    setSize(640, 480);
    setVisible(true);
         test_slider = new my_slider("networkutil");
         createnetworkutil();
         try {
         UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel") ;
    } catch (Exception e) {
    System.err.println("Could not initialize personal look and feel");
    addWindowListener( new WindowAdapter() {
    public void windowClosing(WindowEvent we) {
    System.exit(0);
    Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, new Boolean(true));
    private MenuBar createMenuBar() {
    ActionListener al = new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    String command = ae.getActionCommand();
    if (command.equals("Open")) {
    if (fd == null) {
    fd = new FileDialog(myAppfr2.this, "Open File",
    FileDialog.LOAD);
    fd.setDirectory("~/movies");
    fd.show();
    if (fd.getFile() != null) {
    String filename = fd.getDirectory() + fd.getFile();
    openFile("file:" + filename);
    } else if (command.equals("Exit")) {
    dispose();
    System.exit(0);
    MenuItem item;
    MenuBar mb = new MenuBar();
    // File Menu
    Menu mnFile = new Menu("File");
    mnFile.add(item = new MenuItem("Open"));
    item.addActionListener(al);
    mnFile.add(item = new MenuItem("Exit"));
    item.addActionListener(al);
    // Options Menu
    Menu mnOptions = new Menu("Options");
    cbAutoLoop = new CheckboxMenuItem("Auto replay");
    cbAutoLoop.setState(true);
    mnOptions.add(cbAutoLoop);
    mb.add(mnFile);
    mb.add(mnOptions);
    return mb;
    //create slider and add it to desktop
    public void createnetworkutil(){
    test_slider.pack();
    desktop.add(test_slider);
    test_slider.setVisible(true);
    * Open a media file.
    private void openFile(String filename) {
    String mediaFile = filename;
    Player player = null;
    // URL for our media file
    URL url = null;
    try {
    // Create an url from the file name and the url to the
    // document containing this applet.
    if ((url = new URL(mediaFile)) == null) {
    Fatal("Can't build URL for " + mediaFile);
    return;
    // Create an instance of a player for this media
    try {
    player = Manager.createPlayer(url);
    } catch (NoPlayerException e) {
    Fatal("Error: " + e);
    } catch (MalformedURLException e) {
    Fatal("Error:" + e);
    } catch (IOException e) {
    Fatal("Error:" + e);
    if (player != null) {
    this.filename = filename;
    JMFrame jmframe = new JMFrame(player, filename);
    desktop.add(jmframe);
    class JMFrame extends JInternalFrame implements ControllerListener {
    public Player mplayer;
    Component visual = null;
    Component control = null;
    int videoWidth = 0;
    int videoHeight = 0;
    int controlHeight = 30;
    int insetWidth = 10;
    int insetHeight = 30;
    // boolean firstTime = true;
    public JMFrame(Player player, String title) {
    super(title, true, true, true, true);
    getContentPane().setLayout( new BorderLayout() );
    //setSize(320, 10);
    setLocation(200, 25);
    setVisible(true);
    mplayer = player;
    mplayer.addControllerListener((ControllerListener) this);
    mplayer.realize();
    addInternalFrameListener( new InternalFrameAdapter() {
    public void internalFrameClosing(InternalFrameEvent ife) {
    mplayer.close();
    public void controllerUpdate(ControllerEvent ce) {
    // System.out.println("controllerUpdate");
    //SwingUtilities.isEventDispatchThread();
    if (ce instanceof RealizeCompleteEvent) {
    mplayer.prefetch();
    } else if (ce instanceof PrefetchCompleteEvent) {
    if (visual != null)
    return;
         //setnewrate();
         //rate=mplayer.getRate();
         System.out.println( mplayer.getRate());
    if ((visual = mplayer.getVisualComponent()) != null) {
    Dimension size = visual.getPreferredSize();
    videoWidth = size.width;
    videoHeight = size.height;
    getContentPane().add("Center", visual);
    } else
    videoWidth = 320;
    /*if ((control = mplayer.getControlPanelComponent()) != null) {
    controlHeight = control.getPreferredSize().height;
    getContentPane().add("South", control);
    setSize(videoWidth + insetWidth,
    videoHeight + controlHeight + insetHeight);
    validate();
    mplayer.start();
    } else if (ce instanceof StartEvent){
         if (test_slider.netutil==0) {
         mplayer.stop();
         } else if (ce instanceof EndOfMediaEvent && cbAutoLoop.getState()) {
    mplayer.setMediaTime(new Time(0));
              boolean stopped=true;
              mplayer.prefetch();
              mplayer.start();
              stopped=false;
    class my_slider extends JInternalFrame implements ChangeListener{
    //Set up parameters.
    int netini=50;
    public int netutil=netini;
    public my_slider(String windowTitle) {
    super(windowTitle, false, false, false, false);
    getContentPane().setLayout(new BorderLayout());
    setLocation(25,25);// for the internal frame that contains the slider
    setVisible(true); //..same
    //Create the slider(the component included in "my_slider" internal frame
         JSlider mslider = new JSlider(JSlider.VERTICAL,
    0, 100, netini);
    mslider.addChangeListener((ChangeListener) this);
    mslider.setMajorTickSpacing(10);
    mslider.setPaintTicks(true);
    //Create the label table.
    Hashtable labelTable = new Hashtable();
    labelTable.put(new Integer( 0 ),
    new JLabel("0%") );
    labelTable.put(new Integer( 25 ),
    new JLabel("25%") );
    labelTable.put(new Integer( 50 ),
    new JLabel("50%") );
    labelTable.put(new Integer(75),
    new JLabel("75%") );
         labelTable.put(new Integer( 100),
    new JLabel("100%") );     
    mslider.setLabelTable(labelTable);
    mslider.setPaintLabels(true);
    mslider.setBorder(
    BorderFactory.createEmptyBorder(0,0,0,10));
         //Put everything in the content pane.
    getContentPane().add(mslider, BorderLayout.CENTER);
    public void stateChanged(ChangeEvent e) { //System.out.println("stateChanged");
    // SwingUtilities.isEventDispatchThread();
    if (e instanceof ChangeEvent){
    JSlider source = (JSlider)e.getSource();
    if (!source.getValueIsAdjusting()) {
    netutil= (int)source.getValue();
         System.out.println(netutil);
              if (jmframe.mplayer!=null) {
         jmframe.mplayer.setRate((float)(netutil/(netutil+(0.3*netutil))));
              if (jmframe.mplayer.getTargetState() <Player.Started)
         jmframe.mplayer.prefetch();
    i am stuck so any help would be really very much appreciated

    did you ever resolve this.
    I may be having similar problems
    I have an JMF application running under webstart. It runs ok in Java 1.3
    Now I am trying to get ti to run under Java 1.4. The attached error is rather useless,
    but by guess at what is happening is that the JMF control has some .awt. stuff included
    but that Java 1.4 emulates .awt. in swing. But something was not set and the default does not
    work.
    This error messages does not appear in the 1.3 run
    Any suggestions would be greatly appriatated.
    1.4 result:
    mg version 2.1.1a
    player created com.sun.media.content.unknown.Handler@3a1834
    ctr com.sun.media.PlaybackEngine$BitRateA@4a9a7d
    ctr com.sun.media.BasicJMD[panel0,0,0,512x200,invalid,layout=java.awt.BorderLayout]
    duration? javax.media.Time@6b5666 sec = 9.223372036854776E9
    time unknown javax.media.Time@754699
    will realize the player
    realize
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.
    Handler@3a1834,previous=Unrealized,current=Realizing,
    target=Realized]
    start smxBADS
    bass start
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(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.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(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.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    realize done
    panel found java.awt.Panel[panel1,0,0,0x0,invalid] java.awt.Panel[panel2,4,216,292x30,layout=java.awt.FlowLayout]
    press a button
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    at javax.swing.plaf.metal.MetalLookAndFeel.getControlInfo(Unknown Source)
    at javax.swing.plaf.metal.MetalScrollButton.paint(Unknown Source)
    at javax.swing.JComponent.paintChildren(Unknown Source)
    at javax.swing.JComponent.paint(Unknown Source)
    at javax.swing.JComponent.paintWithBuffer(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.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Exception occurred during event dispatching:
    java.lang.NullPointerException
    1.3 result
    mg version 2.1.1a
    player created com.sun.media.content.unknown.Handler@354749
    ctr com.sun.media.PlaybackEngine$BitRateA@5b484d
    ctr com.sun.media.BasicJMD[panel3,0,0,512x200,invalid,layout=java.awt.BorderLayout]
    duration? javax.media.Time@46d228 sec = 9.223372036854776E9
    time unknown javax.media.Time@f7386
    will realize the player
    realize
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.
    Handler@354749,previous=Unrealized,current=Realizing,
    target=Realized]
    start smxBADS
    bass start
    javax.media.DurationUpdateEvent[source=com.sun.media.content.unknown.Handler@354749,duration=javax.media.Time@55c0f9
    javax.media.Time@55c0f9
    javax.media.RealizeCompleteEvent[source=com.sun.media.content.unknown.Handler@354749,previous=Realizing,current=Realized,target=Realized]
    realized complete
    prefetch
    realize done
    controlComp com.sun.media.ui.DefaultControlPanel[,0,0,74x21,invalid,layout=java.awt.BorderLayout]
    add controlComp 21 java.awt.Panel[panel4,10,-12,258x47,invalid]
    javax.media.TransitionEvent[source=com.sun.media.content.unknown.Handler@354749,previous=Realized,current=Prefetching,target=Prefetched]
    start smxBADS
    bass start
    running ok from here on

  • List updates accumulating loops,index 0 selected

    Hi, I have tried several day solve this.
    ListCellRenderer and ListSelectionListener with list of four male names.
    If you select JUST THE FIRST NAME in the list and press "Change gender" button, the System.print.out shows unnecessarily repeating loops when updating list (=slow down).
    How to avoid extra loops when first name is selected?
    Thanks!
    TestCase.java
    import java.awt.*;
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    public class TestCase {
         boolean packFrame = false;
      public TestCase() {
         TestCaseFrame frame = new TestCaseFrame();
        if (packFrame) {
          frame.pack();
        else {
          frame.validate();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        Dimension frameSize = frame.getSize();
        if (frameSize.height > screenSize.height) {
          frameSize.height = screenSize.height*9/10;
        if (frameSize.width > screenSize.width) {
          frameSize.width = screenSize.width*9/10;
        frame.setLocation(10,10);
        frame.setVisible(true);
      public static void main(String[] args) {
        try {
          UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
        catch(Exception e) {
          e.printStackTrace();
        new TestCase();
    TestCaseFrame.java
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    public class TestCaseFrame extends JFrame {
      MyCellRenderer myCellRenderer = new MyCellRenderer();
      BorderLayout borderLayout = new BorderLayout();
      Container contentPane;         
      JPanel panel = new JPanel();
      DefaultListModel defaultListModel = new DefaultListModel();
      JList list = new JList(defaultListModel); 
      JScrollPane scrollPane = new JScrollPane(list);
      ListSelectionModel listSelectionModel;
      JLabel label = new JLabel("<html>Select THE FIRST name and press button! <br>Check System.out.print");
      JButton button_changeGender = new JButton("Change gender");  
      boolean genderNow_male = true;
      String[] names = new String[4];
      public TestCaseFrame() {
           enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
          this.pack();
        catch(Exception e) {
          e.printStackTrace();
      private void jbInit() throws Exception  {
        contentPane = (Container) this.getContentPane();  
        contentPane.setLayout(borderLayout);
        this.setDefaultCloseOperation(3);
        panel.add(label, null);  
        panel.add(scrollPane, null);  
        panel.add(button_changeGender , null);
        button_changeGender.addActionListener(new button_changeGender_actionAdapter(this));
        button_changeGender.setVisible(true);
        button_changeGender.setEnabled(true);
        contentPane.add(panel);
        // default values, gender is now male
        names[0] = "Bill";
         names[1] = "James";
         names[2] = "Martin";
         names[3] = "Peter";
            for (int counter = 0 ; counter < names.length; counter++) {
             defaultListModel.addElement(names[counter]);
        listSelectionModel = list.getSelectionModel(); 
        listSelectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);  
        listSelectionModel.addListSelectionListener(
                new SharedListSelectionHandler(this));   
        list.setSelectedIndex(0);
        list.setVisibleRowCount(7);
        list.setCellRenderer(myCellRenderer);
      void ChangeGender() {    // changes the gender of names in the list if the button was pressed
           System.out.println("\nEntering method ChangeGender");
             defaultListModel.removeAllElements();
                if  (genderNow_male) {
                     genderNow_male = false;
                     names[0] = "Doris";
                     names[1] = "Helen";
                     names[2] = "Nicole";
                     names[3] = "Susan";
                } else {
                     genderNow_male = true;
                     names[0] = "Bill";
                     names[1] = "James";
                     names[2] = "Martin";
                     names[3] = "Peter";
                 for (int counter = 0 ; counter < names.length; counter++) {
                      System.out.println("ChengeGender method (name, index): " + names[counter] + ", " + counter);
                           defaultListModel.addElement(names[counter]);
            list.ensureIndexIsVisible(0);           
            System.out.println("Quitting method ChangeGender\n");          
      void button_changeGender_actionPerformed(ActionEvent e) {
                ChangeGender();
    class button_changeGender_actionAdapter implements java.awt.event.ActionListener {
         TestCaseFrame adaptee;   
         button_changeGender_actionAdapter(TestCaseFrame adaptee) {  // LL1010 oli DelNodesGameFrame adaptee
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.button_changeGender_actionPerformed(e);
    class MyCellRenderer extends Container implements ListCellRenderer {      // oli JPanelin tilalla JLabel
         private static final Color HIGHLIGHT_COLOR = new Color(0, 0, 128);
         private JTextArea textarea;  
         private JPanel cell_panel = new JPanel();
         public MyCellRenderer() {
               textarea = new JTextArea("abcTesting_");
               textarea.setOpaque(true);                      
           public Component getListCellRendererComponent(final JList list,
                    final Object value, final int index, final boolean isSelected,
                    final boolean cellHasFocus) {
                String entry = (String) value;            
                System.out.print("Cell renderer (name, index): " + entry + ", " + index);
                textarea.setText(entry);
                textarea.setColumns(20);
                if(isSelected){
                     System.out.print("   - is selected");
                     textarea.setBackground(list.getSelectionBackground());
                     textarea.setForeground(list.getSelectionForeground());
                } else{
                     System.out.print("   - not selected");
                     textarea.setBackground(list.getBackground());
                     textarea.setForeground(list.getForeground());
                System.out.print("\n");
                setEnabled(list.isEnabled());
                setFont(list.getFont());
                cell_panel.removeAll();
                cell_panel.setOpaque(true);
                cell_panel.setLayout( new FlowLayout(FlowLayout.LEFT));
                cell_panel.add(textarea);  // BorderLayout.WEST,   label_linkTitle
                return cell_panel;           
    class SharedListSelectionHandler implements ListSelectionListener {
         TestCaseFrame adaptee;
         SharedListSelectionHandler(TestCaseFrame adaptee) { 
                  this.adaptee = adaptee;
         public void valueChanged(ListSelectionEvent e) {                 
         ListSelectionModel lsm = (ListSelectionModel)e.getSource();  
         if( !(lsm.isSelectionEmpty()) && !e.getValueIsAdjusting() ) {
                   System.out.print("\nCurrently selected list indexes: ");
                        for (int i = lsm.getMinSelectionIndex(); i <= lsm.getMaxSelectionIndex(); i++) { 
                             if (lsm.isSelectedIndex(i)) {
                                  System.out.print(i + " ");                                                  
                   System.out.print("\n");
    }

    I think you are spending too much time worrying about how Swing does things and not enough time on reducing the complexity of your renderer. You seem to have far too much going on in the body of the renderer.
    Maybe something like
    class MyCellRenderer implements ListCellRenderer
    {      // oli JPanelin tilalla JLabel
        private static final Color HIGHLIGHT_COLOR = new Color(0, 0, 128);
        private JTextArea textarea;
        private JPanel cell_panel = new JPanel();
        public MyCellRenderer()
            textarea = new JTextArea("abcTesting_");
            textarea.setColumns(20);
            textarea.setOpaque(true);
            cell_panel.removeAll();
            cell_panel.setOpaque(true);
            cell_panel.setLayout(new FlowLayout(FlowLayout.LEFT));
            cell_panel.add(textarea);  // BorderLayout.WEST,   label_linkTitle
        public Component getListCellRendererComponent(final JList list,
                final Object value, final int index, final boolean isSelected,
                final boolean cellHasFocus)
            String entry = (String) value;
            textarea.setText(entry);
            if (isSelected)
                textarea.setBackground(list.getSelectionBackground());
                textarea.setForeground(list.getSelectionForeground());
            } else
                textarea.setBackground(list.getBackground());
                textarea.setForeground(list.getForeground());
            textarea.setEnabled(list.isEnabled());
            textarea.setFont(list.getFont());
            return cell_panel;
    }Edited by: sabre150 on May 23, 2009 11:54 AM

  • Problem in JSF with Swing in a web application

    hi
    i am using jsf for my online projects.my problem is that when i use Swing concept ,the server is closed automatically when i click the swing dialog option 'OK', how can i protect server being closed automatically when user click the the options of Swing dialog box.it is so tedious because my application is going to integrate
    with online server?
    my swing java file is
    * FileExistsDialog.java
    package com.obs.ftw.util.alert;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.Rectangle2D;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.plaf.metal.MetalLookAndFeel;
    * FileExistsDialog: A JOptionPane-like dialog that displays the message
    * that a file exists.
    public class FileExistsDialog extends JDialog {
    * The component that gets the focus when the window is first opened
    private Component initialFocusOwner = null;
    * Command string for replace action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_REPLACE = "OK"/*NOI18N*/;
    * Command string for a cancel action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_CANCEL = "CANCEL"/*NOI18N*/;
    // Components we need to access after initialization
    private JButton replaceButton = null;
    private JButton cancelButton = null;
    public FileExistsDialog(){
         System.out.println("INSIDE THE FILE EXIST DIALOG");
         JFrame frame = new JFrame() {
         public Dimension getPreferredSize() {
         return new Dimension(200,100);
         frame.setTitle("Debugging frame");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.pack();
         frame.setVisible(false);
    FileExistsDialog dialog = new FileExistsDialog(frame, true);
         dialog.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
         System.exit(0);
         public void windowClosed(WindowEvent event) {
         System.exit(0);
         dialog.pack();
         dialog.setVisible(true);
    * Creates a new FileExistsDialog
    * @param parent parent frame
    * @param modal modal flag
    public FileExistsDialog(Frame parent,boolean modal) {
    super(parent, modal);
         //initResources();
         System.out.println("INSIDE THE FILE EXIST DIALOG CONSTRUCTOR");
    initComponents();
    pack();
    * Determines the locale, loads resources
    /* public void initResources() {
         Locale locale = Locale.getDefault();
    resources = ResourceBundle.getBundle(
              "samples.resources.bundles.FileExistsDialogResources", locale);
    imagePath = resources.getString("images.path");
    }*/ // initResources()
    * Sets all of the buttons to be the same size. This is done
    * dynamically after the buttons are created, so that the layout
    * automatically adjusts to the locale-specific strings.
    private void equalizeButtonSizes() {
         System.out.println("INSIDE THE equalizeButtonSizes()");
    String[] labels = new String[] {
    replaceButton.getText(),
         cancelButton.getText()
         // Get the largest width and height
         Dimension maxSize= new Dimension(0,0);
         Rectangle2D textBounds = null;
         Dimension textSize = null;
    FontMetrics metrics =
              replaceButton.getFontMetrics(replaceButton.getFont());
         Graphics g = getGraphics();
         for (int i = 0; i < labels.length; ++i) {
         textBounds = metrics.getStringBounds(labels, g);
         maxSize.width =
         Math.max(maxSize.width, (int)textBounds.getWidth());
         maxSize.height =
         Math.max(maxSize.height, (int)textBounds.getHeight());
    Insets insets =
         replaceButton.getBorder().getBorderInsets(replaceButton);
    maxSize.width += insets.left + insets.right;
    maxSize.height += insets.top + insets.bottom;
    // reset preferred and maximum size since BoxLayout takes both
         // into account
    replaceButton.setPreferredSize((Dimension)maxSize.clone());
    cancelButton.setPreferredSize((Dimension)maxSize.clone());
    replaceButton.setMaximumSize((Dimension)maxSize.clone());
    cancelButton.setMaximumSize((Dimension)maxSize.clone());
    } // equalizeButtonSizes()
    * This method is called from within the constructor to
    * initialize the dialog.
    private void initComponents() {
         System.out.println("INSIDE THE initComponents()");
         // Configure the window, itself
    Container contents = getContentPane();
    contents.setLayout(new GridBagLayout ());
    GridBagConstraints constraints = null;
    setTitle("Waring");
         // accessibility - all applets, frames, and dialogs should
         // have descriptions
         this.getAccessibleContext().setAccessibleDescription("Descriptions");
         addWindowListener(new WindowAdapter() {
         public void windowOpened(WindowEvent event) {
              // For some reason the window opens with no focus owner,
              // so we need to force the issue
         if (initialFocusOwner != null) {
              initialFocusOwner.requestFocus();
              // Only do this the 1st time the window is opened
              initialFocusOwner = null;
         public void windowClosing(WindowEvent event) {
         System.out.println("INSIDE THE windowClosing");     
         // Treat it like a cancel
              windowAction(CMD_CANCEL);
         // image
    JLabel imageLabel = new JLabel();
    imageLabel.setIcon(
    new ImageIcon("/images/degraded_large.gif"));
    // accessibility - set name so that low vision users get a description
    imageLabel.getAccessibleContext().setAccessibleName("OK");
    constraints = new GridBagConstraints ();
    constraints.gridheight = 2;
    constraints.insets = new Insets(12, 33, 0, 0);
    constraints.anchor = GridBagConstraints.NORTHEAST;
    contents.add(imageLabel, constraints);
    // header
    JLabel headerLabel = new JLabel ();
    headerLabel.setText("SAMPLE");
    headerLabel.setForeground(
         new Color(MetalLookAndFeel.getBlack().getRGB()));
    constraints = new GridBagConstraints ();
    constraints.insets = new Insets(12, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(headerLabel, constraints);
         // Actual text of the message
         JTextArea contentTextArea = new JTextArea();
    contentTextArea.setEditable(false);
    contentTextArea.setText("SAMPLE");
    contentTextArea.setBackground(
              new Color(MetalLookAndFeel.getControl().getRGB()));
    // accessibility -- every component that can have the
         // keyboard focus must have a name. This text area has no
         // label, so the name must be set explicitly (if it had a
         // label, the name would be pulled from the label).
    contentTextArea.getAccessibleContext().setAccessibleName(
              "CONTENTNAME");
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.insets = new Insets(0, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(contentTextArea, constraints);
         // Buttons
         JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout (new BoxLayout(buttonPanel, 0));
         replaceButton = new JButton();
         replaceButton.setActionCommand(CMD_REPLACE);
    replaceButton.setText("OK");
    replaceButton.setToolTipText("TO OK");
         replaceButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(replaceButton);
    // spacing
    buttonPanel.add(Box.createRigidArea(new Dimension(5,0)));
         cancelButton = new JButton();
         cancelButton.setActionCommand(CMD_CANCEL);
    cancelButton.setText("CANCEL");
    cancelButton.setNextFocusableComponent(replaceButton);
         cancelButton.setToolTipText("TO CANCEL");
         cancelButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(cancelButton);
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.insets = new Insets(12, 12, 11, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(buttonPanel, constraints);
         // Equalize the sizes of all the buttons
         equalizeButtonSizes();
         // For some reason, the dialog appears with no input focus.
         // We added a window listener above to force the issue
         initialFocusOwner = replaceButton;
    } // initComponents()
    * The user has selected an option. Here we close and dispose the dialog.
    * If actionCommand is an ActionEvent, getCommandString() is called,
    * otherwise toString() is used to get the action command.
    * @param actionCommand may be null
    private void windowAction(Object actionCommand) {
         System.out.println("INSIDE THE WINDOW ACTION");
         String cmd = null;
    if (actionCommand != null) {
         if (actionCommand instanceof ActionEvent) {
         cmd = ((ActionEvent)actionCommand).getActionCommand();
         } else {
         cmd = actionCommand.toString();
         if (cmd == null) {
         // do nothing
         } else if (cmd.equals(CMD_REPLACE)) {
         System.out.println("your replace code here...");
         } else if (cmd.equals(CMD_CANCEL)) {
         System.out.println("your cancel code here...");
         setVisible(false);
         dispose();
    } // windowAction()
    * This main() is provided for debugging purposes, to display a
    * sample dialog.
    // main()
    } // class FileExistsDialog
    and calling java function is
    public String fileDialog(){
         return "Success";
    public void processFile(ActionEvent event){
         System.out.println("INSIDE THE FILE DIALOG");
         FileExistsDialog file     = new FileExistsDialog();
         System.out.println("SUCCESS");
    called from
         <h:commandButton action="#{userLogin.fileDialog}" actionListener="#{userLogin.processFile}"></h:commandButton>
    pls help me as soon
    advance thanks
    rgds
    oasisdeserts

    Swing is GUI library for use in desktop applications.
    JSF is a web application framework which runs on an application server and is accessed by clients via web browsers.
    To fully understand what you have done, try accessing your application from a different machine than the server.
    To answer your question, don't invoke System.exit() if you would like the process to continue. But that is the least of your problems.

  • How to set "Borland L&F" in  my Application

    I can set Metal L&F like this:
    try{
    UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel");
    }catch(Exception e){e.printStackTrace();};
    JBuilder 9 includes "Borland L&F" wat parameter have i to provide to
    UIManager.setLookAndFeel(???????????);

    Do a search in the Borland jar files to find the BorlandLookAndFeel class, then use that. You can examine jar files using the jar tool or a zip program such as WinZip.

  • Imageicon in a JComboBox

    hi, i do a program to create "business case table", but i've a problem in the 2nd part of the table, because in my 2nd table i have a JComboBox with image, when i click the combobox the images are show, but when select some figure the cell don�t keep the image, only keep the text.
    Anyone can help me???
    Here is my principal class that create the principal screen and tables:
    /*                      Poseidon                                 */
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.border.*;
    import javax.swing.table.*;
    * Summary description for Poseidon
    *2052102
    public class Poseidon extends JFrame
         // Variables declaration
         private JTabbedPane jTabbedPane1;
         private JPanel contentPane, paineltabela, painelgrafo, painelvariavel, paineltarefa;
         private JTable tabelavariavel,tabelatarefa, tabelateste;
         private JScrollPane scrollvariavel, scrolltarefa;
         private int totallinhas, alt, al, linhastarefa,cont, linhas, tamanholinhas,
                        controlalinhas, index, contastring;
         private String variavel;
         private JComboBox combobox;
         JMenuItem sair, abrir, guardar, miadtarefa, miadvariavel;
         JTable [] tabelasvar = new JTable[30];
         JFrame w;
         // End of variables declaration
         public Poseidon()
              super("Poseidon");
              initializeComponent();
              this.setVisible(true);
          * 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 Windows Form Designer. Otherwise, retrieving design might not work properly.
          * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
          * to retrieve your design properly in future, before revising this method.
         private void initializeComponent()
              JMenuBar barra = new JMenuBar();
              setJMenuBar(barra);
              TratBarra trat = new TratBarra();
              tabelavariavel = new JTable();
              tabelatarefa = new JTable();
              tabelavariavel.getTableHeader().setReorderingAllowed(false);
              tabelavariavel.setModel(new DefaultTableModel());
              tabelavariavel.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
              tabelavariavel.setBackground(Color.cyan);
              tabelatarefa.getTableHeader().setReorderingAllowed(false);
              tabelatarefa.setModel(new DefaultTableModel());
              tabelatarefa.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
              tabelatarefa.setBackground(Color.white);
              CaixaCombinacao combobox = new CaixaCombinacao();
              DefaultCellEditor editor = new DefaultCellEditor(combobox);
              tabelatarefa.setDefaultEditor(Object.class, editor);
              painelvariavel = new JPanel();
              painelvariavel.setLayout(new GridLayout(1, 0));
              painelvariavel.setBorder(new TitledBorder("Variaveis"));
              painelvariavel.setBounds(15, 35, 490, 650);
              painelvariavel.setVisible(false);
              this.add(painelvariavel);
              scrollvariavel = new JScrollPane();
              scrollvariavel.setViewportView(tabelavariavel);
              painelvariavel.add(scrollvariavel);
              paineltarefa = new JPanel();
              paineltarefa.setLayout(new GridLayout(1,0));
              paineltarefa.setBorder(new TitledBorder("Tarefas"));
              paineltarefa.setBounds(506, 35, 490,650);
              paineltarefa.setVisible(false);
              this.add(paineltarefa);
              scrolltarefa = new JScrollPane();
              scrolltarefa.setViewportView(tabelatarefa);
              paineltarefa.add(scrolltarefa);
              tamanholinhas = 1;
              linhas=1;
              cont=0;
              JMenu arquivo = new JMenu("Arquivo");
              JMenu mtabela = new JMenu("Tabela");
              arquivo.setMnemonic(KeyEvent.VK_A);
              mtabela.setMnemonic(KeyEvent.VK_T);
              miadvariavel = new JMenuItem("Adicionar Variavel");
              miadtarefa = new JMenuItem("Adicionar Tarefa");
              abrir = new JMenuItem("Abrir");
              guardar = new JMenuItem("Guardar");
              sair = new JMenuItem("Sair");
              sair.addActionListener(trat);
              miadvariavel.addActionListener(trat);
              miadtarefa.addActionListener(trat);
              mtabela.add(miadvariavel);
              miadvariavel.setMnemonic(KeyEvent.VK_V);
              mtabela.add(miadtarefa);
              miadtarefa.setMnemonic(KeyEvent.VK_F);
              arquivo.add(abrir);
              abrir.setMnemonic(KeyEvent.VK_B);
              arquivo.add(guardar);
              guardar.setMnemonic(KeyEvent.VK_G);
              arquivo.addSeparator();
              arquivo.add(sair);
              sair.setMnemonic(KeyEvent.VK_S);
              barra.add(arquivo);
              barra.add(mtabela);
              jTabbedPane1 = new JTabbedPane();
              contentPane = (JPanel)this.getContentPane();
              paineltabela = new JPanel();
              painelgrafo = new JPanel();
              // jTabbedPane1
              jTabbedPane1.addTab("Tabela", paineltabela);
              jTabbedPane1.addTab("Grafo", painelgrafo);
              jTabbedPane1.addChangeListener(new ChangeListener() {
                   public void stateChanged(ChangeEvent e)
                        painelvariavel.setVisible(false);
              // contentPane
              contentPane.setLayout(null);
              addComponent(contentPane, jTabbedPane1, 11,10,990,690);
              // paineltabela
              paineltabela.setLayout(null);
              // painelgrafo
              painelgrafo.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
              // Poseidon
              this.setTitle("UMa Poseidon");
              this.setLocation(new Point(2, 1));
              this.setSize(new Dimension(558, 441));
              this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              this.setExtendedState(MAXIMIZED_BOTH);
         /** Add Component Without a Layout Manager (Absolute Positioning) */
         private void addComponent(Container container,Component c,int x,int y,int width,int height)
              c.setBounds(x,y,width,height);
              container.add(c);
         // TODO: Add any appropriate code in the following Event Handling Methods
         private void jTabbedPane1_stateChanged(ChangeEvent e)
              System.out.println("\njTabbedPane1_stateChanged(ChangeEvent e) called.");
              // TODO: Add any handling code here
         // TODO: Add any method code to meet your needs in the following area
         private class TratBarra implements ActionListener{
              public void actionPerformed(ActionEvent e){
                   if(e.getSource() == sair){
                        int op = JOptionPane.showConfirmDialog(null, "Deseja mesmo fechar o aplicativo?","Sair", JOptionPane.YES_NO_OPTION);
                        if(op == JOptionPane.YES_OPTION){
                             System.exit(0);
                   if(e.getSource() == miadvariavel){
                        final JFrame w = new JFrame();
                        new AdVariavel(w);
                   if(e.getSource() == miadtarefa){
                        final JFrame w = new JFrame();
                        new AdTarefa(w);
    //============================= Testing ================================//
    //=                                                                    =//
    //= The following main method is just for testing this class you built.=//
    //= After testing,you may simply delete it.                            =//
    //======================================================================//
         public static void main(String[] args)
              Spash sp = new Spash(3000);
              sp.mostraTela();
              JFrame.setDefaultLookAndFeelDecorated(true);
              JDialog.setDefaultLookAndFeelDecorated(true);
              try
                   UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
              catch (Exception ex)
                   System.out.println("Failed loading L&F: ");
                   System.out.println(ex);
              new Poseidon();
    //= End of Testing =
    private class AdVariavel extends JDialog
         // Variables declaration
         private JLabel jLabel1;
         private JTextField jTextField1;
         private JButton varOK;
         private JButton varCancel;
         private JPanel contentPane;
         private JTextField jTextField2;
         private JList listadominio;
         private JScrollPane jScrollPane1;
         private JButton varAdiciona;
         private JButton varRemove;
         private JPanel jPanel1;
         private DefaultListModel modelo1;
         // End of variables declaration
         public AdVariavel(Frame w)
              super(w);
              initializeComponent();
              // TODO: Add any constructor code after initializeComponent call
              this.setVisible(true);
          * 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 Windows Form Designer. Otherwise, retrieving design might not work properly.
          * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
          * to retrieve your design properly in future, before revising this method.
         private void initializeComponent()
              modelo1 = new DefaultListModel();
              jLabel1 = new JLabel();
              jTextField1 = new JTextField();
              varOK = new JButton();
              varCancel = new JButton();
              contentPane = (JPanel)this.getContentPane();
              jTextField2 = new JTextField();
              listadominio = new JList(modelo1);
              jScrollPane1 = new JScrollPane();
              varAdiciona = new JButton();
              varRemove = new JButton();
              jPanel1 = new JPanel();
              // jLabel1
              jLabel1.setText("Nome da vari�vel:");
              // jTextField1
              jTextField1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField1_actionPerformed(e);
              // varOK
              varOK.setText("OK");
              varOK.setMnemonic(KeyEvent.VK_O);
              varOK.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        varOK_actionPerformed(e);
              // varCancel
              varCancel.setText("Cancelar");
              varCancel.setMnemonic(KeyEvent.VK_C);
              varCancel.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        varCancel_actionPerformed(e);
              // contentPane
              contentPane.setLayout(null);
              addComponent(contentPane, jLabel1, 12,12,105,18);
              addComponent(contentPane, jTextField1, 118,10,137,22);
              addComponent(contentPane, varOK, 170,227,83,28);
              addComponent(contentPane, varCancel, 257,227,85,28);
              addComponent(contentPane, jPanel1, 12,42,332,180);
              // jTextField2
              jTextField2.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField2_actionPerformed(e);
              // listadominio
              listadominio.addListSelectionListener(new ListSelectionListener() {
                   public void valueChanged(ListSelectionEvent e)
                        listadominio_valueChanged(e);
              // jScrollPane1
              jScrollPane1.setViewportView(listadominio);
              // varAdiciona
              varAdiciona.setText("Adicionar");
              varAdiciona.setMnemonic(KeyEvent.VK_A);
              varAdiciona.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        varAdiciona_actionPerformed(e);
              // varRemove
              varRemove.setText("Remover");
              varRemove.setMnemonic(KeyEvent.VK_R);
              varRemove.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        varRemove_actionPerformed(e);
              // jPanel1
              jPanel1.setLayout(null);
              jPanel1.setBorder(new TitledBorder("Dominio:"));
              addComponent(jPanel1, jTextField2, 17,22,130,22);
              addComponent(jPanel1, jScrollPane1, 165,21,154,144);
              addComponent(jPanel1, varAdiciona, 56,50,89,28);
              addComponent(jPanel1, varRemove, 57,84,88,28);
              // AdTarefas
              this.setTitle("Adicionar Variavel");
              this.setLocation(new Point(1, 0));
              this.setSize(new Dimension(367, 296));
              this.setLocationRelativeTo(null);
              this.setResizable(false);
         /** Add Component Without a Layout Manager (Absolute Positioning) */
         private void addComponent(Container container,Component c,int x,int y,int width,int height)
              c.setBounds(x,y,width,height);
              container.add(c);
         // TODO: Add any appropriate code in the following Event Handling Methods
         private void jTextField1_actionPerformed(ActionEvent e)
              System.out.println("\njTextField1_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void varOK_actionPerformed(ActionEvent e)
              System.out.println("\nvarOK_actionPerformed(ActionEvent e) called.");
              if (jTextField1 == null){
                   return;
              if (jTextField1.getText().length()<1){
                   JOptionPane.showMessageDialog(null,"N�o introduziu nenhuma variavel","AVISO", 1 );
                   jTextField1.requestFocus();
                   return;
              else {
                   if (modelo1.getSize() == 0){
                        JOptionPane.showMessageDialog(null,"N�o introduziu nenhum dominio","AVISO", 1 );
                        return;
                   else{
                        painelvariavel.add(scrollvariavel);
                        index = 0;
                        variavel = jTextField1.getText();
                        contastring = variavel.length();
                        System.out.println(contastring);
                        DefaultTableModel dtm = (DefaultTableModel)tabelavariavel.getModel();
                        tabelavariavel.getTableHeader().setBackground(Color.yellow);
                        dtm.addColumn(variavel, new Object[]{});
                        al = modelo1.getSize();
                        totallinhas = al;
                        for(int i = 0;i < modelo1.getSize();i++){
                             listadominio.setSelectedIndex(index) ;
                             Object dominio = listadominio.getSelectedValue();
                             dtm.addRow(new Object[]{dominio});
                             index ++;
                        tabelasvar[cont] = tabelavariavel;
                        cont++;
                        System.out.println(cont);
                        for(int i=0;i<cont;i++){
                             tabelateste = tabelasvar;
                             linhas = tabelateste.getRowCount();
                             if (linhas >= tamanholinhas){
                                  tamanholinhas = linhas;
                        for (int i=0;i<cont;i++){
                             tabelateste = tabelasvar[i];
                             System.out.println(linhas);
                             linhas = tabelateste.getRowCount();
                             tabelateste.setRowHeight((tamanholinhas/linhas)*20);
                             tabelasvar[i] = tabelateste;
                             System.out.println(tabelateste);
                   tabelavariavel = new JTable();
              scrollvariavel = new JScrollPane();
              painelvariavel.add(tabelavariavel);
              tabelavariavel.setBackground(Color.cyan);
         tabelavariavel.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
                   scrollvariavel.setViewportView(tabelavariavel);
                   painelvariavel.setVisible(true);
         tabelavariavel.getTableHeader().setReorderingAllowed(false);
         this.setVisible(false);
         miadtarefa.setEnabled(true);
         miadvariavel.setEnabled(true);
         DefaultTableModel dtm = (DefaultTableModel)tabelatarefa.getModel();
                   tabelatarefa.getTableHeader().setBackground(Color.yellow);
                   controlalinhas = tamanholinhas - linhastarefa;
                   for(int i = 0;i < controlalinhas;i++){
                             dtm.addRow(new Object[]{});
                             linhastarefa++;
                   tabelatarefa.setRowHeight((tamanholinhas/linhas)*20);
              // TODO: Add any handling code here
         private void varCancel_actionPerformed(ActionEvent e)
              System.out.println("\nvarCancel_actionPerformed(ActionEvent e) called.");
              this.setVisible(false);
         private void jTextField2_actionPerformed(ActionEvent e)
              System.out.println("\njTextField2_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void listadominio_valueChanged(ListSelectionEvent e)
              System.out.println("\nlistadominio_valueChanged(ListSelectionEvent e) called.");
              if(!e.getValueIsAdjusting())
                   Object o = listadominio.getSelectedValue();
                   System.out.println(">>" + ((o==null)? "null" : o.toString()) + " is selected.");
                   // TODO: Add any handling code here for the particular object being selected
         private void varAdiciona_actionPerformed(ActionEvent e)
              System.out.println("\nvarAdiciona_actionPerformed(ActionEvent e) called.");
              if(jTextField2.getText().length()>=1){
                   modelo1.addElement(jTextField2.getText());
                   jTextField2.setText("");
                   jTextField2.requestFocus();
         private void varRemove_actionPerformed(ActionEvent e)
              System.out.println("\nvarRemove_actionPerformed(ActionEvent e) called.");
              int index = listadominio.getSelectedIndex();
              modelo1.remove(index);
         // TODO: Add any method code to meet your needs in the following area
    private class AdTarefa extends JDialog
         // Variables declaration
         private JLabel jLabel1;
         private JTextField jTextField1;
         private JButton tarOK;
         private JButton tarCancel;
         private JPanel contentPane;
         private JPanel jPanel1;
         // End of variables declaration
         public AdTarefa(Frame w)
              super(w);
              initializeComponent();
              // TODO: Add any constructor code after initializeComponent call
              this.setVisible(true);
         * 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 Windows Form Designer. Otherwise, retrieving design might not work properly.
         * Tip: If you must revise this method, please backup this GUI file for JFrameBuilder
         * to retrieve your design properly in future, before revising this method.
         private void initializeComponent()
              jLabel1 = new JLabel();
              jTextField1 = new JTextField();
              tarOK = new JButton();
              tarCancel = new JButton();
              contentPane = (JPanel)this.getContentPane();
              // jLabel1
              jLabel1.setText("Nome da tarefa:");
              // jTextField1
              jTextField1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        jTextField1_actionPerformed(e);
              // tarOK
              tarOK.setText("OK");
              tarOK.setMnemonic(KeyEvent.VK_O);
              tarOK.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        tarOK_actionPerformed(e);
              // tarCancel
              tarCancel.setText("Cancelar");
              tarCancel.setMnemonic(KeyEvent.VK_C);
              tarCancel.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e)
                        tarCancel_actionPerformed(e);
              // contentPane
              contentPane.setLayout(null);
              addComponent(contentPane, jLabel1, 12,12,105,18);
              addComponent(contentPane, jTextField1, 118,10,120,22);
              addComponent(contentPane, tarOK, 10,50,83,28);
              addComponent(contentPane, tarCancel, 153,50,85,28);
              // AdTarefas
              this.setTitle("Adicionar Tarefa");
              this.setLocation(new Point(1, 0));
              this.setSize(new Dimension(250, 120));
              this.setLocationRelativeTo(null);
              this.setResizable(false);
         /** Add Component Without a Layout Manager (Absolute Positioning) */
         private void addComponent(Container container,Component c,int x,int y,int width,int height)
              c.setBounds(x,y,width,height);
              container.add(c);
         // TODO: Add any appropriate code in the following Event Handling Methods
         private void jTextField1_actionPerformed(ActionEvent e)
              System.out.println("\njTextField1_actionPerformed(ActionEvent e) called.");
              // TODO: Add any handling code here
         private void tarOK_actionPerformed(ActionEvent e)
              System.out.println("\ntarOK_actionPerformed(ActionEvent e) called.");
              if (jTextField1 == null){
                   return;
              if (jTextField1.getText().length()<1){
                   JOptionPane.showMessageDialog(null,"N�o introduziu nenhuma tarefa","AVISO", 1 );
                   jTextField1.requestFocus();
                   return;
              else{
                   String variavel = jTextField1.getText();
                   DefaultTableModel dtm = (DefaultTableModel)tabelatarefa.getModel();
                   dtm.addColumn(variavel,new Object[]{});
                   controlalinhas = tamanholinhas - linhastarefa;
                   for(int i = 0;i < controlalinhas;i++){
                             dtm.addRow(new Object[]{});
                             linhastarefa++;
                   for(int i=0; i < tabelatarefa.getColumnCount(); i++){
                        tabelatarefa.getColumnModel().getColumn(i).setPreferredWidth(100);
                   tabelatarefa.getColumnModel().getColumn(i).setResizable(false);
                   tabelatarefa.getTableHeader().setBackground(Color.yellow);
                   tabelatarefa.setRowHeight((tamanholinhas/linhas)*20);
                   paineltarefa.setVisible(true);
         tabelatarefa.getTableHeader().setReorderingAllowed(true);
         this.setVisible(false);
         miadtarefa.setEnabled(true);
         miadvariavel.setEnabled(true);
         // TODO: Add any handling code here
         private void tarCancel_actionPerformed(ActionEvent e)
              System.out.println("\ntarCancel_actionPerformed(ActionEvent e) called.");
              this.setVisible(false);
    now the code to create the JComboBox is here:
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class CaixaCombinacao extends JComboBox{
         ImageIcon[] imagens;
        String[] op = {"x", "check"};
    public CaixaCombinacao(){
         imagens = new ImageIcon[op.length];
        Integer[] intArray = new Integer[op.length];
        for (int i = 0; i < op.length; i++) {
             intArray[i] = new Integer(i);
            imagens[i] = createImageIcon("imagens/" + op[i] + ".gif");
            this.addItem(imagens);
    if (imagens[i] != null) {
    imagens[i].setDescription(op[i]);
         JComboBox lista = new JComboBox(intArray);
         ComboBoxRenderer renderer= new ComboBoxRenderer();
         lista.setRenderer(renderer);
    protected static ImageIcon createImageIcon(String path) {
    java.net.URL imgURL = CaixaCombinacao.class.getResource(path);
    if (imgURL != null) {
         return new ImageIcon(imgURL);
    return null;
    class ComboBoxRenderer extends JLabel
    implements ListCellRenderer {
    public ComboBoxRenderer() {
    setOpaque(true);
    setHorizontalAlignment(CENTER);
    setVerticalAlignment(CENTER);
    public Component getListCellRendererComponent(
    JList list,
    Object value,
    int index,
    boolean isSelected,
    boolean cellHasFocus) {
                   int selectedIndex = ((Integer)value).intValue();
                   if (isSelected) {
    setBackground(list.getSelectionBackground());
    setForeground(list.getSelectionForeground());
    } else {
    setBackground(list.getBackground());
    setForeground(list.getForeground());
                   ImageIcon icon = imagens[selectedIndex];
                   String opc = op[selectedIndex];
    setIcon(icon);
    return this;

    I'm sure 90% of the code posted here has nothing to do with displaying images in a JTable.
    Here is an example that shows how to display an icon in a table:
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class TableIcon extends JFrame
         public TableIcon()
              String[] columnNames = {"Picture", "Description"};
              Object[][] data =
                   {new ImageIcon("copy16.gif"), "Copy"},
                   {new ImageIcon("add16.gif"), "Add"},
              DefaultTableModel model = new DefaultTableModel(data, columnNames);
              JTable table = new JTable( model )
                   //  Returning the Class of each column will allow different
                   //  renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane( table );
              getContentPane().add( scrollPane );
         public static void main(String[] args)
              TableIcon frame = new TableIcon();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
    }If this doesn't help then post a similiar demo program that shows the problems you are having, not your entire application.

  • Runtime Error that Seems to be Related to Dialog Boxes

    Although I am currently taking a college course in Java and my code is based on a couple of questions from my Java textbook, I would like to make it perfectly clear that this is NOT homework. This is self-assigned for studying purposes and my professor will probably never see this, let alone grade it. Regardless, I suspect this to be a configuration-related issue as I had no such problems running this program in a Vista machine on campus. Assuming I am right, there shouldn't be any issue with any of this community's policies as I won't need to receive any "answer" code to solve this issue.
    In NetBeans, my program compiles and works fine, but produces a couple of runtime errors. Any idea what could be going on here?
    Here's my code:
    import java.util.Scanner;       // Needed for console input.
    import javax.swing.JOptionPane; // Needed for dialog boxes.
       This program performs the actions requested in questions 2.35 and 2.36 in the textbook.
    * @author Dan
    public class Pages98To99 {
        public static void main(String[]args){
            // Asks the user for what answer he/she wants to see.
            System.out.println("Do you want to see the answer to 2.35 or 2.36?");
            Scanner keyboard = new Scanner(System.in);  // Creates a scanner object.
            double answer = keyboard.nextDouble();
            if (answer == 2.35){
                //2.35
                JOptionPane.showMessageDialog(null, "Greetings Earthling.");
                JOptionPane.showInputDialog("Enter a number.");}
            else if (answer == 2.36){
                //2.36
                String str = JOptionPane.showInputDialog("Please enter your age.");
                                                     // Gets age.
                int age = Integer.parseInt(str);}    /* Converts age from a string to an
                                                        integer.*/
            else
                JOptionPane.showMessageDialog(null, "Go to another program.");
            System.exit(0); // Ends the program
    }Here are the runtime errors produced by NetBeans:
    2010-02-15 21:23:54.659 java[3891] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0xf203, name = 'java.ServiceProvider' See /usr/include/servers/bootstrap_defs.h for the error codes. 2010-02-15 21:23:54.660 java[3891] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)The following is a troubleshooting terminal session using both the newer version of JDK courtesy of SoyLatte ( [http://landonf.bikemonkey.org/static/soylatte/|http://landonf.bikemonkey.org/static/soylatte/] ), which fails to produce a dialog box) as well as the older one supplied by Apple as part of my OS (which like in NetBeans works fine otherwise) as well.
    Last login: Sat Feb 20 00:12:55 on ttyp1
    Welcome to Darwin!
    Dans-MacBook:~ Dan$ cd /Volumes/Lexar/NetBeansProjects/MacBook-Made/test/;echo $PATH;java -version;javac -version;javac Pages98To99.java;java Pages98To99;PATH=/sw/bin:/sw/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin;java -version;javac -version;javac Pages98To99.java;java Pages98To99
    /sw/bin:/sw/sbin:/Applications/soylatte16-i386-1.0.3/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
    java version "1.6.0_03-p3"
    Java(TM) SE Runtime Environment (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00)
    Java HotSpot(TM) Server VM (build 1.6.0_03-p3-landonf_19_aug_2008_14_55-b00, mixed mode)
    javac 1.6.0_03-p3
    Do you want to see the answer to 2.35 or 2.36?
    0
    Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
            at sun.awt.X11.XToolkit.(XToolkit.java:89)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:169)
            at java.awt.Toolkit$2.run(Toolkit.java:836)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:828)
            at sun.swing.SwingUtilities2$AATextInfo.getAATextInfo(SwingUtilities2.java:120)
            at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1556)
            at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:130)
            at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1591)
            at javax.swing.UIManager.setLookAndFeel(UIManager.java:537)
            at javax.swing.UIManager.setLookAndFeel(UIManager.java:577)
            at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1331)
            at javax.swing.UIManager.initialize(UIManager.java:1418)
            at javax.swing.UIManager.maybeInitialize(UIManager.java:1406)
            at javax.swing.UIManager.getDefaults(UIManager.java:656)
            at javax.swing.UIManager.getString(UIManager.java:802)
            at javax.swing.UIManager.getString(UIManager.java:819)
            at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:592)
            at Pages98To99.main(Pages98To99.java:29)
    java version "1.5.0_19"
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_19-b02-306)
    Java HotSpot(TM) Client VM (build 1.5.0_19-138, mixed mode, sharing)
    javac 1.5.0_19
    javac: no source files
    Usage: javac 
    where possible options include:
      -g                         Generate all debugging info
      -g:none                    Generate no debugging info
      -g:{lines,vars,source}     Generate only some debugging info
      -nowarn                    Generate no warnings
      -verbose                   Output messages about what the compiler is doing
      -deprecation               Output source locations where deprecated APIs are used
      -classpath           Specify where to find user class files
      -cp                  Specify where to find user class files
      -sourcepath          Specify where to find input source files
      -bootclasspath       Override location of bootstrap class files
      -extdirs             Override location of installed extensions
      -endorseddirs        Override location of endorsed standards path
      -d              Specify where to place generated class files
      -encoding        Specify character encoding used by source files
      -source           Provide source compatibility with specified release
      -target           Generate class files for specific VM version
      -version                   Version information
      -help                      Print a synopsis of standard options
      -X                         Print a synopsis of nonstandard options
      -J                   Pass  directly to the runtime system
    Do you want to see the answer to 2.35 or 2.36?
    0
    2010-02-20 00:16:09.967 java[4618] CFLog (0): CFMessagePort: bootstrap_register(): failed 1103 (0x44f), port = 0xf103, name = 'java.ServiceProvider'
    See /usr/include/servers/bootstrap_defs.h for the error codes.
    2010-02-20 00:16:09.968 java[4618] CFLog (99): CFMessagePortCreateLocal(): failed to name Mach port (java.ServiceProvider)
    Dans-MacBook:/Volumes/Lexar/NetBeansProjects/MacBook-Made/test Dan$ Edited by: Viewer07 on Mar 6, 2010 12:15 AM

    In terminal I've been using a JDK from Soylatte. I haven't tampered with the JDK that NetBeans uses.
    About NetBeans (from the menubar returns the following):
    Product Version: NetBeans IDE 6.8 (Build 200912041610)
    Java: 1.5.0_19; Java HotSpot(TM) Client VM 1.5.0_19-138
    System: Mac OS X version 10.4.11 running on i386; MacRoman; en_US (nb)
    Userdir: /Users/Dan/.netbeans/6.8

  • How can I set a "Metal" LookAndFeel to a JFrame

    How can I set a "Metal" LookAndFeel to a JFrame?
    I�m using the JDK 5. In my pc, has that theme. I�m using Win2k

    try{
            UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
            } catch (Exception e) {
                System.out.println("Error changing Look and Feel");
            }

  • Cannot install SAP GUI on SUSE 10.3

    Hello SDN,
    I have installed NW04s Evaluation on Linux OpenSuSE 10.3. I can not install Java GUI on the same server.
    Following is the error detail in the dump file. Kindly help us resolve this problem.
    DUMP File
    NULL           -
    0SECTION       TITLE subcomponent dump routine
    NULL           ===============================
    1TISIGINFO     Dump Event "abort" (00020000) received
    1TIDATETIME    Date:                 2007/10/31 at 20:48:36
    1TIFILENAME    Javacore filename:    /usr/client/JavaGUI/javacore.20071031.204836.12332.txt
    NULL           -
    0SECTION       GPINFO subcomponent dump routine
    NULL           ================================
    2XHOSLEVEL     OS Level         : Linux 2.6.22.5-31-default
    2XHCPUS        Processors -
    3XHCPUARCH       Architecture   : amd64
    3XHNUMCPUS       How Many       : 2
    NULL          
    1XHERROR2      Register dump section only produced for SIGSEGV, SIGILL or SIGFPE.
    NULL          
    NULL           -
    0SECTION       ENVINFO subcomponent dump routine
    NULL           =================================
    1CIJAVAVERSION J2RE 1.4.2 IBM J9 2.2 Linux amd64-64 build j9xa64142ifx-20070808
    1CIVMVERSION   VM build 20070807_1500_LHdSMr
    1CIJITVERSION  JIT enabled - r7_level20070315_1745
    1CIRUNNINGAS   Running as a standalone JVM
    1CICMDLINE     java -jar PlatinGUI-Linux-700.jar
    1CIJAVAHOMEDIR Java Home Dir:   /usr/IBMJava2-amd64-142/jre
    1CIJAVADLLDIR  Java DLL Dir:    /usr/IBMJava2-amd64-142/jre/bin
    1CISYSCP       Sys Classpath:   /usr/IBMJava2-amd64-142/jre/lib/jclSC14/classes.zip;/usr/IBMJava2-amd64-142/jre/lib/core.jar;/usr/IBMJava2-amd64-142/jre/lib/charsets.jar;/usr/IBMJava2-amd64-142/jre/lib/graphics.jar;/usr/IBMJava2-amd64-142/jre/lib/security.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmpkcs.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmorb.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmorbapi.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjcefw.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjssefips.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjgssprovider.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjsseprovider.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjaaslm.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmjaasactivelm.jar;/usr/IBMJava2-amd64-142/jre/lib/ibmcertpathprovider.jar;/usr/IBMJava2-amd64-142/jre/lib/server.jar;/usr/IBMJava2-amd64-142/jre/lib/xml.jar;
    1CIUSERARGS    UserArgs:
    2CIUSERARG               -Xjcl:jclscar_22
    2CIUSERARG               -Dcom.ibm.oti.vm.bootstrap.library.path=/usr/IBMJava2-amd64-142/jre/bin
    2CIUSERARG               -Dsun.boot.library.path=/usr/IBMJava2-amd64-142/jre/bin
    2CIUSERARG               -Djava.library.path=/usr/IBMJava2-amd64-142/jre/bin:/usr/IBMJava2-amd64-142/jre/bin:/usr/IBMJava2-amd64-142/jre/bin/j9vm:/usr/IBMJava2-amd64-142/jre/bin:/usr/lib
    2CIUSERARG               -Djava.home=/usr/IBMJava2-amd64-142/jre
    2CIUSERARG               -Djava.ext.dirs=/usr/IBMJava2-amd64-142/jre/lib/ext
    2CIUSERARG               -Duser.dir=/usr/client/JavaGUI
    2CIUSERARG               j2sej9 0x00002AAC8EB1ED40
    2CIUSERARG               vfprintf 0x00000000400036A0
    2CIUSERARG               -Dinvokedviajava
    2CIUSERARG               -Djava.class.path=PlatinGUI-Linux-700.jar
    2CIUSERARG               vfprintf
    2CIUSERARG               -Xdump
    NULL          
    1CIJVMMI       JVM Monitoring Interface (JVMMI)
    NULL           -
    2CIJVMMIOFF    [not available]
    NULL          
    NULL           -
    0SECTION       MEMINFO subcomponent dump routine
    NULL           =================================
    1STHEAPFREE    Bytes of Heap Space Free: 1a86b0
    1STHEAPALLOC   Bytes of Heap Space Allocated: 400000
    NULL          
    1STSEGTYPE     Memory
    NULL           segment          start            alloc            end               type     bytes
    1STSEGMENT     000000004011E970 00002AAAACF6E0F0 00002AAAACF6E8A0 00002AAAACF7E0F0  01000040 10000
    1STSEGMENT     000000004011E398 00002AAAACF4E0D0 00002AAAACF5E094 00002AAAACF5E0D0  01000040 10000
    1STSEGMENT     000000004011E860 00002AAAACF1E0A0 00002AAAACF2DFAC 00002AAAACF2E0A0  01000040 10000
    1STSEGMENT     000000004011E200 00002AAAACFB6010 00002AAAACFB92B8 00002AAAACFC6010  01000040 10000
    1STSEGMENT     000000004011E420 00002AAAAB08F920 00002AAAAB097464 00002AAAAB09F920  01000040 10000
    1STSEGMENT     000000004011E068 0000000040146200 00000000401561E4 0000000040156200  01000040 10000
    NULL          
    1STSEGTYPE     Object Memory
    NULL           segment          start            alloc            end               type     bytes
    1STSEGMENT     000000004011F0D8 00002AAC90A57000 00002AAC90E57000 00002AAC90E57000  00000009 400000
    NULL          
    1STSEGTYPE     Class Memory
    NULL           segment          start            alloc            end               type     bytes
    1STSEGMENT     00002AAAAAC9BA10 00002AAAACFDE040 00002AAAACFE42B8 00002AAAACFE6040  00010040 8004
    1STSEGMENT     00002AAAAAC9B988 00002AAAACF86110 1STSEGMENT     0000000040120148 00002AAAAABFDE10 00002AAAAAC1DC18 00002AAAAAC1DE10  00020040 20000
    NULL          
    1STSEGTYPE     JIT Code Cache
    NULL           segment          start            alloc            end               type     bytes
    1STSEGMENT     00000000401441D8 00002AACB1CC8000 00002AACB1CD3EA8 00002AACB24C8000  00000068 800000
    NULL          
    1STSEGTYPE     JIT Data Cache
    NULL           segment          start            alloc            end               type     bytes
    1STSEGMENT     0000000040145248 00002AACB14C8000 00002AACB14CCDE0 00002AACB1CC8000  00000068 800000
    NULL          
    NULL           -
    0SECTION       LOCKS subcomponent dump routine
    NULL           ===============================
    NULL          
    1LKPOOLINFO    Monitor pool info:
    2LKPOOLTOTAL     Current total number of monitors: 0
    NULL          
    1LKMONPOOLDUMP Monitor Pool Dump (flat & inflated object-monitors):
    NULL          
    1LKREGMONDUMP  JVM System Monitor Dump (registered monitors):
    2LKREGMON          Thread global lock (0x000000004010D630): <unowned>
    2LKREGMON          NLS hash table lock (0x000000004010D698): <unowned>
    2LKREGMON          MM_SublistPool lock (0x000000004010D700): <unowned>
    2LKREGMON          MM_SublistPool lock (0x000000004010D768): <unowned>
    2LKREGMON          MM_SublistPool lock (0x000000004010D7D0): <unowned>
    2LKREGMON          MM_SublistPool lock (0x000000004010D838): <unowned>
    2LKREGMON          MM_SublistPool lock (0x000000004010D8A0): <unowned>
    2LKREGMON          MM_ParallelDispatcher::slaveThread lock (0x000000004010D908): <unowned>
    3LKNOTIFYQ            Waiting to be notified:
    3LKWAITNOTIFY            "Gc Slave Thread" (0x00002AAAAACCB300)
    2LKREGMON          MM_ParallelDispatcher::synchronize lock (0x000000004010D970): <unowned>
    2LKREGMON          MM_WorkPackets::inputList lock (0x000000004010D9D8): <unowned>
    2LKREGMON          MM_GCExtensions::gcStats lock (0x000000004010DA40): <unowned>
    2LKREGMON          VM thread list lock (0x000000004010DAA8): Flat locked by "main" (0x000000004011CE00), entry count 1
    2LKREGMON          VM exclusive access lock (0x000000004010DB10): <unowned>
    2LKREGMON          VM bind native lock (0x000000004010DB78): <unowned>
    2LKREGMON          VM class loader blocks lock (0x000000004010DBE0): <unowned>
    2LKREGMON          VM class table lock (0x000000004010DC48): <unowned>
    2LKREGMON          VM string table lock (0x000000004010DCB0): <unowned>
    2LKREGMON          VM segment lock (0x000000004010DD18): <unowned>
    2LKREGMON          VM JNI frame lock (0x000000004010DD80): <unowned>
    2LKREGMON          VM GC finalize master lock (0x000000004010DDE8): <unowned>
    2LKREGMON          VM GC finalize run finalization lock (0x000000004010DE50): <unowned>
    2LKREGMON          VM memory space list lock (0x000000004010DEB8): <unowned>
    2LKREGMON          VM JXE description lock (0x000000004010DF20): <unowned>
    2LKREGMON          VM sig quit lock (0x000000004010DF88): <unowned>
    2LKREGMON          VM monitor table lock (0x000000004010DFF0): <unowned>
    2LKREGMON          VM volatile long lock (0x000000004010E058): <unowned>
    2LKREGMON          VM mem segment list lock (0x000000004010E0C0): <unowned>
    2LKREGMON          VM mem segment list lock (0x000000004010E128): <unowned>
    2LKREGMON          VM mem segment list lock (0x000000004010E190): <unowned>
    2LKREGMON          FinalizeListManager lock (0x000000004010E1F8): <unowned>
    2LKREGMON          BCVD verifier lock (0x000000004010E260): <unowned>
    2LKREGMON          Thread public flags mutex lock (0x000000004010E2C8): <unowned>
    2LKREGMON          &jitConfig->mutex lock (0x000000004010E330): <unowned>
    2LKREGMON          VM mem segment list lock (0x000000004010E398):
    2LKREGMON          Thread public flags mutex lock (0x000000004010E9B0): <unowned>
    NULL           -
    0SECTION       THREADS subcomponent dump routine
    NULL           =================================
    NULL           
    1XMCURTHDINFO  Current Thread Details
    NULL           -
    3XMTHREADINFO      "main" (TID:0x000000004011CE00, sys_thread_t:0x000000004010F098, state:R, native ID:0xFFFFFFFF8F6786F0) prio=5
    4XESTACKTRACE          at sun/awt/X11GraphicsEnvironment.initDisplay(Native Method)
    4XESTACKTRACE          at sun/awt/X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:175)
    4XESTACKTRACE          at java/lang/Class.initializeImpl(Native Method)
    4XESTACKTRACE          at java/lang/Class.initialize(Class.java:339)
    4XESTACKTRACE          at java/lang/Class.forNameImpl(Native Method)
    4XESTACKTRACE          at java/lang/Class.forName(Class.java:115)
    4XESTACKTRACE          at java/awt/GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:91)
    4XESTACKTRACE          at java/awt/Font.initializeFont(Font.java:333)
    4XESTACKTRACE          at java/awt/Font.<init>(Font.java:368)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:224)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme.getFont(DefaultMetalTheme.java:182)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:158)
    4XESTACKTRACE          at javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1479)
    4XESTACKTRACE          at javax/swing/UIDefaults.getFromHashtable(UIDefaults.java:231)
    4XESTACKTRACE          at javax/swing/UIDefaults.get(UIDefaults.java:161)
    4XESTACKTRACE          at javax/swing/MultiUIDefaults.get(MultiUIDefaults.java:73)
    4XESTACKTRACE          at javax/swing/UIDefaults.getFont(UIDefaults.java:381)
    4XESTACKTRACE          at javax/swing/UIManager.getFont(UIManager.java:524)
    4XESTACKTRACE          at javax/swing/LookAndFeel.installColorsAndFont(LookAndFeel.java:119)
    4XESTACKTRACE          at javax/swing/plaf/basic/BasicLabelUI.installDefaults(BasicLabelUI.java:343)
    4XESTACKTRACE          at javax/swing/plaf/basic/BasicLabelUI.installUI(BasicLabelUI.java:295)
    4XESTACKTRACE          at javax/swing/JComponent.setUI(JComponent.java:484)
    4XESTACKTRACE          at javax/swing/JLabel.setUI(JLabel.java:267)
    4XESTACKTRACE          at javax/swing/JLabel.updateUI(JLabel.java:277)
    4XESTACKTRACE          at javax/swing/JLabel.<init>(JLabel.java:170)
    4XESTACKTRACE          at javax/swing/JLabel.<init>(JLabel.java:200)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.initDialog(GuiInstall.java:361)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.<init>(GuiInstall.java:81)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.main(GuiInstall.java:485)
    NULL          
    1XMTHDINFO     All Thread Details
    NULL           -
    NULL          
    2XMFULLTHDDUMP Full thread dump J9SE VM (J2RE 1.4.2 IBM J9 2.2 Linux amd64-64 build 20070807_1500_LHdSMr, native threads):
    3XMTHREADINFO      "main" (TID:0x000000004011CE00, sys_thread_t:0x000000004010F098, state:R, native ID:0xFFFFFFFF8F6786F0) prio=5
    4XESTACKTRACE          at sun/awt/X11GraphicsEnvironment.initDisplay(Native Method)
    4XESTACKTRACE          at sun/awt/X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:175)
    4XESTACKTRACE          at java/lang/Class.initializeImpl(Native Method)
    4XESTACKTRACE          at java/lang/Class.initialize(Class.java:339)
    4XESTACKTRACE          at java/lang/Class.forNameImpl(Native Method)
    4XESTACKTRACE          at java/lang/Class.forName(Class.java:115)
    4XESTACKTRACE          at java/awt/GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:91)
    4XESTACKTRACE          at java/awt/Font.initializeFont(Font.java:333)
    4XESTACKTRACE          at java/awt/Font.<init>(Font.java:368)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme$FontDelegate.getFont(DefaultMetalTheme.java:224)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme.getFont(DefaultMetalTheme.java:182)
    4XESTACKTRACE          at javax/swing/plaf/metal/DefaultMetalTheme.getControlTextFont(DefaultMetalTheme.java:158)
    4XESTACKTRACE          at javax/swing/plaf/metal/MetalLookAndFeel$FontActiveValue.createValue(MetalLookAndFeel.java:1479)
    4XESTACKTRACE          at javax/swing/UIDefaults.getFromHashtable(UIDefaults.java:231)
    4XESTACKTRACE          at javax/swing/UIDefaults.get(UIDefaults.java:161)
    4XESTACKTRACE          at javax/swing/MultiUIDefaults.get(MultiUIDefaults.java:73)
    4XESTACKTRACE          at javax/swing/UIDefaults.getFont(UIDefaults.java:381)
    4XESTACKTRACE          at javax/swing/UIManager.getFont(UIManager.java:524)
    4XESTACKTRACE          at javax/swing/LookAndFeel.installColorsAndFont(LookAndFeel.java:119)
    4XESTACKTRACE          at javax/swing/plaf/basic/BasicLabelUI.installDefaults(BasicLabelUI.java:343)
    4XESTACKTRACE          at javax/swing/plaf/basic/BasicLabelUI.installUI(BasicLabelUI.java:295)
    4XESTACKTRACE          at javax/swing/JComponent.setUI(JComponent.java:484)
    4XESTACKTRACE          at javax/swing/JLabel.setUI(JLabel.java:267)
    4XESTACKTRACE          at javax/swing/JLabel.updateUI(JLabel.java:277)
    4XESTACKTRACE          at javax/swing/JLabel.<init>(JLabel.java:170)
    4XESTACKTRACE          at javax/swing/JLabel.<init>(JLabel.java:200)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.initDialog(GuiInstall.java:361)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.<init>(GuiInstall.java:81)
    4XESTACKTRACE          at com/sap/platin/base/install/GuiInstall.main(GuiInstall.java:485)
    3XMTHREADINFO      "[system]" (TID:0x00002AAAAAC54800, sys_thread_t:0x000000004010F218, state:CW, native ID:0x0000000040277950) prio=11
    3XMTHREADINFO      "Signal Dispatcher" (TID:0x00002AAAAACCA300, sys_thread_t:0x000000004010F2D8, state:R, native ID:0x000000004004F950) prio=5
    4XESTACKTRACE          at com/ibm/misc/SignalDispatcher.waitForSignal(Native Method)
    4XESTACKTRACE          at com/ibm/misc/SignalDispatcher.run(SignalDispatcher.java:78)
    3XMTHREADINFO      "Gc Slave Thread" (TID:0x00002AAAAACCB300, sys_thread_t:0x000000004010F518, state:CW, native ID:0x0000000040067950) prio=5

    Hi Dave,
    Please see the support matrix for SAPGui for Java.
    https://websmp201.sap-ag.de/~sapidb/011000358700008661652002E
    ...and the following text:
    "There is no 64-bit version of SAP GUI for Java available. SAP GUI for Java can be run on 64-bit hardware provided there is a 32-bit Java runtime environment available for that hardware and operating system. For updates see SAP note 1018530. "
    So in short you need to install a 32 bit JRE.
    Also, you might like to try the newly released 7.10 version.
    Regards,
    Nelis

  • Using tesing, i can't run any swing java application.

    Any swing application, ex. xxe or openproj.
    Using openjdk6, i got those error:
    env:
    [hubert@hubert-dell bin]$ java -version
    java version "1.6.0_0"
    OpenJDK Runtime Environment (IcedTea6 1.5pre-r059f6ba0c7dd) (ArchLinux-1.5_hg20090429-1-x86_64)
    OpenJDK 64-Bit Server VM (build 14.0-b10, mixed mode)
    error:
    [hubert@hubert-dell bin]$ ./xxe
    internal error: cannot create application: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-1.6.0-openjdk/jre/lib/amd64/motif21/libmawt.so
    +---------------------------------------
    | java.lang.ClassLoader.loadLibrary(ClassLoader.java:1666)
    | java.lang.Runtime.load0(Runtime.java:787)
    | java.lang.System.load(System.java:1022)
    | java.lang.ClassLoader$NativeLibrary.load(Native Method)
    | java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
    | java.lang.ClassLoader.loadLibrary(ClassLoader.java:1684)
    | java.lang.Runtime.loadLibrary0(Runtime.java:840)
    | java.lang.System.loadLibrary(System.java:1047)
    | sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
    | sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
    | java.security.AccessController.doPrivileged(Native Method)
    | java.awt.Toolkit.loadLibraries(Toolkit.java:1610)
    | java.awt.Toolkit.<clinit>(Toolkit.java:1632)
    | java.awt.Color.<clinit>(Color.java:279)
    | javax.swing.plaf.metal.MetalTheme.<clinit>(MetalTheme.java:76)
    | javax.swing.plaf.metal.MetalLookAndFeel.getCurrentTheme(MetalLookAndFeel.java:1681)
    | javax.swing.plaf.metal.MetalLookAndFeel.createDefaultTheme(MetalLookAndFeel.java:1576)
    | javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1598)
    | javax.swing.UIManager.setLookAndFeel(UIManager.java:545)
    | javax.swing.UIManager.setLookAndFeel(UIManager.java:585)
    +---------------------------------------
    then i change java-runtime to sun java sdk.
    env:
    [hubert@hubert-dell bin]$ java -version
    java version "1.6.0_13"
    Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
    Java HotSpot(TM) 64-Bit Server VM (build 11.3-b02, mixed mode)
    [hubert@hubert-dell bin]$
    error:
    [hubert@hubert-dell bin]$ ./xxe
    # An unexpected error has been detected by Java Runtime Environment:
    # SIGSEGV (0xb) at pc=0x00007f02743bb438, pid=16636, tid=139648504359248
    # Java VM: Java HotSpot(TM) 64-Bit Server VM (11.3-b02 mixed mode linux-amd64)
    # Problematic frame:
    # C [libc.so.6+0x30438] catgets+0x18
    # An error report file with more information is saved as:
    # /tmp/hs_err_pid16636.log
    # If you would like to submit a bug report, please visit:
    # http://java.sun.com/webapps/bugreport/crash.jsp
    # The crash happened outside the Java Virtual Machine in native code.
    # See problematic frame for where to report the bug.
    ./xxe: line 40: 16636 已放弃 java $mem $opt -DXXE_GUI="$XXE_GUI" -DXXE_ADDON_PATH="$XXE_ADDON_PATH" -DXXE_USER_PREFERENCES="$XXE_USER_PREFERENCES" -classpath "$cp" com.xmlmind.xmleditapp.start.Start "$@"
    [hubert@hubert-dell bin]$
    My archlinux:
    [hubert@hubert-dell ~]$ uname -a
    Linux hubert-dell 2.6.29-ARCH #1 SMP PREEMPT Wed Apr 29 15:36:46 CEST 2009 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux
    [hubert@hubert-dell ~]$ yaourt -Q glibc openjdk6 kernel26
    ==> List all installed packages
    local/glibc 2.9-7
    local/openjdk6 1.5_hg20090429-1
    local/kernel26 2.6.29.2-1
    [hubert@hubert-dell ~]$
    Last edited by hubertstar (2009-04-30 17:15:28)

    ok, this's not a bug.
    I'm install eioffice(Yongzhong office, a chinese office software) and test it, and i have to set AWT_TOOLKIT=MToolkit (Running eio with compiz).
    That's the problem.
    unset AWT_TOOLKIT
    no errors.

  • InDesign CS5.5 Documents Not Working with Drive 4.2

    I am using CS 6 and Adobe Drive 4.2 (4.2.0.110) on Windows 7 with the CMIS adapter against an Alfresco v4.0.0 repository.  When I double-click on an InDesign CS6 file in windows explorer, it opens in InDesign.  I see the "up-to-date' status icon in the lower left in InDesign.  I can edit the document and successfully check it back into Alfresco.  When I try the same test case using a CS 5.5-created document, the "up-to-date" icon does not appear and I can't version the document in Alfresco.
    These two documents reside in the same folder and were created by the same user in Alfresco.  They are both simple documents that only contain text boxes; no external links.
    The AD4ServiceManager_java.log file contains the following and was deleted before trying the CS5.5 test case:
    2013/04/23 11:15:29,471 [ConnectionHandler-Adobe Drive.exe-3732] INFO  GetConnectorInfoHandler - -->In()
    2013/04/23 11:15:29,545 [ConnectionHandler-Adobe Drive.exe-3732] DEBUG IconHelper - Configuring Win volume icon.
    2013/04/23 11:15:29,548 [ConnectionHandler-Adobe Drive.exe-3732] INFO  GetConnectorInfoHandler - -->Out()
    2013/04/23 11:16:24,222 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/irml.dll
    2013/04/23 11:16:24,449 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/adobe_licutil.exe
    2013/04/23 11:16:29,224 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/tes8E12.tmp
    2013/04/23 11:16:29,245 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/tes8E12.tmp
    2013/04/23 11:16:29,265 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/tes8E12.tmp
    2013/04/23 11:16:29,992 [JobHandler-2] ERROR GetAssetById - Caught exception
    com.adobe.drive.data.model.DriveException: com.adobe.drive.data.model.asset.ModelObjectNotFoundException: Cannot find class com.adobe.drive.data.internal.model.Asset with id='70'
        at com.adobe.drive.data.model.asset.DeprecatedAssetFactory.findAssetById(DeprecatedAssetFact ory.java:42)
        at com.adobe.drive.internal.data.manager.DataManager.getCachedAsset(DataManager.java:1786)
        at com.adobe.drive.internal.biz.versioncue.service.call.GetAssetById.executeItem(GetAssetByI d.java:59)
        at com.adobe.drive.internal.biz.versioncue.service.call.GetAssetById.executeItem(GetAssetByI d.java:1)
        at com.adobe.drive.internal.biz.versioncue.service.call.VersionCueCall$1.run(VersionCueCall. java:125)
        at com.adobe.drive.internal.biz.versioncue.service.call.VersionCueCall$1.run(VersionCueCall. java:1)
        at com.adobe.drive.data.internal.persistence.PersistenceRunner.run(PersistenceRunner.java:11 9)
        at com.adobe.drive.internal.biz.versioncue.service.call.VersionCueCall.execute(VersionCueCal l.java:137)
        at com.adobe.drive.internal.biz.versioncue.service.VersionCueService.getAsset(VersionCueServ ice.java:234)
        at com.adobe.drive.ncomm.versioncue.GetAssetById.handle(GetAssetById.java:54)
        at com.adobe.drive.ncomm.versioncue.VersionCueRequestHandler$1.run(VersionCueRequestHandler. java:185)
        at com.adobe.drive.core.internal.jobs.JobHandler$JobWrapper.run(JobHandler.java:270)
        at com.adobe.drive.core.internal.jobs.JobHandler$JobWrapper.run(JobHandler.java:286)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.adobe.drive.data.model.asset.ModelObjectNotFoundException: Cannot find class com.adobe.drive.data.internal.model.Asset with id='70'
        at com.adobe.drive.data.persistence.factories.AssetFactory.findAssetById(AssetFactory.java:2 44)
        at com.adobe.drive.data.model.asset.AssetFactory.findAssetById(AssetFactory.java:69)
        at com.adobe.drive.data.model.asset.DeprecatedAssetFactory.findAssetById(DeprecatedAssetFact ory.java:38)
        ... 15 more
    2013/04/23 11:16:31,820 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/Document fonts
    2013/04/23 11:16:31,839 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/Document fonts.lnk
    2013/04/23 11:16:31,859 [IFSConnection-1] ERROR GetAssetsHandler - asset not found: /User Homes/mjackson/Document fonts.URL
    Thanks,
    Rich

    they are Right it checks to see that the OS name is Windows XP i assume and it finds the windows but NOT the xp so it just assumes it is 98.... just my theroy
    well not any more.!!! take a look and see ....
      private static LookAndFeelInfo[] installedLAFs;
        static {
            ArrayList iLAFs = new ArrayList(4);
            iLAFs.add(new LookAndFeelInfo(
                          "Metal", "javax.swing.plaf.metal.MetalLookAndFeel"));
            iLAFs.add(new LookAndFeelInfo("CDE/Motif",
                      "com.sun.java.swing.plaf.motif.MotifLookAndFeel"));
            // Only include windows on Windows boxs.
         String osName = (String)AccessController.doPrivileged(
                                 new GetPropertyAction("os.name"));
            if (osName != null && osName.indexOf("Windows") != -1) {
                iLAFs.add(new LookAndFeelInfo("Windows",
                            "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"));
                if (Toolkit.getDefaultToolkit().getDesktopProperty(
                        "win.xpstyle.themeActive") != null) {
                    iLAFs.add(new LookAndFeelInfo("Windows Classic",
                     "com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel"));
            else {
                // GTK is not shipped on Windows.
                iLAFs.add(new LookAndFeelInfo("GTK+",
                      "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"));
            installedLAFs = (LookAndFeelInfo[])iLAFs.toArray(
                            new LookAndFeelInfo[iLAFs.size()]);
        }the OS is Windows but the XP theme is NOT on the computer!! so it goes back to cassic. hope this helps you,
    ps that was code from UI Manager 1.5

Maybe you are looking for

  • Printer Sharing Problem

    I just installed NM on 4 comps.  1 XP, 1 Vista, and 2 Windows 7.  Everything works as of now except for the printer attached to Vista will not work on XP comp.  As of now it says it needs to search for .INF file?.....Of course this is the one compute

  • Problem in Oracle CDC Create Subscription option

    Hi All, I am facing a problem setting up CDC in test environment after cloning from DEV. We are using Oracle 11g and OWB 11g2 versions. For setting up CDC through OWB client, when we started start CDC, job throws runtime error saying error mapping fu

  • SCCM 2012 Report Problem

    hi there, we are using sccm 2012 with reports functionality on SQL 2008 R2 since 2 weeks now and everything is working fine, including reports. most of the time i monitor the reports for "Status for a specified task sequence deployment on a specific

  • Group Video Call

    Hello, My company  is exploring upgrading to Business Skype. We would like the ability to host Group Video Chats, the main concern here is, do the other parties need to also have business skype in order to participate in the Group Video Chat. We woul

  • The difficulty of commenting on your service.

      After spending a good 20 minutes trying to leave a comment for someone in this company. I now realize that it is made so difficult because Verizon doesn't care how I feel about the service or pricing or notifications. I've retired out of the govern