hdijkema / seaglass

Automatically exported from code.google.com/p/seaglass
0 stars 0 forks source link

JDesktopPane crashed when added new JInternalFrame #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open application 

What is the expected output? What do you see instead?
- gray window with frozen cursor, then crash

What version of the product are you using? On what operating system?
- Seaglass 1.5 on Mac OS X 10.6.2 Snow Leopard

Please provide any additional information below.

-------------------------------------------------------
Code
-------------------------------------------------------
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.UIManager;

public class SeaglassBugDemo extends JFrame {

    public static void main(String[] args) {
        //set look and feel
        try {

UIManager.setLookAndFeel("com.seaglasslookandfeel.SeaGlassLookAndFeel"); 
            System.out.println(">> Set Seaglass look and feel");
//           
UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
//            System.out.println(">> Set Nimbus look and feel");
        } catch (Exception e) {
            System.err.println(">> Cannot set look and feel");
            e.printStackTrace();
        }

        SeaglassBugDemo demo = new SeaglassBugDemo();
        demo.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });
    }

    public SeaglassBugDemo(){
        super("Seaglass");

        JDesktopPane dPane = new JDesktopPane();
        JInternalFrame frame = new JInternalFrame("test",true,true,true,true);
        frame.setBounds(0, 0, 100, 100);
        frame.setVisible(true);
        dPane.add(frame);
        this.setContentPane(dPane);

        this.setBounds(0,0,800,600);
        this.setResizable(true);
        this.setVisible(true);
    }

}

-------------------------------------------------------
Log from OS X
-------------------------------------------------------

Process:         java [75423]
Path:            /usr/bin/java
Identifier:      com.apple.javajdk16.cmd
Version:         1.0 (1.0)
Code Type:       X86-64 (Native)
Parent Process:  eclipse [67603]

Date/Time:       2010-02-01 19:11:15.546 -0500
OS Version:      Mac OS X 10.6.2 (10C540)
Report Version:  6

Interval Since Last Report:          638292 sec
Crashes Since Last Report:           20
Per-App Interval Since Last Report:  290327 sec
Per-App Crashes Since Last Report:   3
Anonymous UUID:                      2E70DF8D-111F-45E0-BFD4-9FEADC00ACB9

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000020
Crashed Thread:  19  Java: AWT-EventQueue-0

Application Specific Information:

Java information:
 Exception type: Bus Error (0xa) at pc=0x00007fff87c8ab5d

 Java VM: Java HotSpot(TM) 64-Bit Server VM (14.3-b01-101 mixed mode
macosx-amd64)

Current thread (0x00000001019eb000):  JavaThread "AWT-EventQueue-0"
[_thread_in_native, id=667934720, stack(0x0000000127bfe000,0x0000000127cfe000)]
Stack: [0x0000000127bfe000,0x0000000127cfe000]
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  apple.laf.CoreUIControl.paintChangesToCGContext(JJJJDDDDJ)I+0
j  apple.laf.CoreUIControl.paintToCGContext(JDDDD)I+80
j  apple.laf.CoreUIControl.paint(JDDDD)V+9
j  com.apple.laf.AquaPainter$DirectOSXSurfacePainter.drawIntoCGContext(J)V+37
v  ~StubRoutines::call_stub
j 
apple.awt.OSXSurfaceData.performNativeCocoaDrawing(Lapple/awt/OSXSurfaceData$CGC
ontextDrawable;)I+0
j 
apple.awt.OSXSurfaceData.performCocoaDrawing(Lsun/java2d/SunGraphics2D;Lapple/aw
t/OSXSurfaceData$CGContextDrawable;)V+39
j 
com.apple.laf.AquaPainter$DirectOSXSurfacePainter.paint(Lsun/java2d/SunGraphics2
D;Lapple/laf/CoreUIState;Ljava/awt/Component;)V+30
j 
com.apple.laf.AquaPainter.paint(Ljava/awt/Graphics;Ljava/awt/Component;IIII)V+41
j 
com.apple.laf.AquaInternalFrameBorder.drawWindowTitle(Ljava/awt/Graphics;Ljavax/
swing/JInternalFrame;IIII)V+67
j 
com.apple.laf.AquaInternalFrameBorder.paintBorder(Ljavax/swing/JInternalFrame;Lj
ava/awt/Component;Ljava/awt/Graphics;IIII)V+90
j 
com.apple.laf.AquaInternalFrameBorder.paintBorder(Ljava/awt/Component;Ljava/awt/
Graphics;IIII)V+14
j 
javax.swing.border.CompoundBorder.paintBorder(Ljava/awt/Component;Ljava/awt/Grap
hics;IIII)V+126
j  javax.swing.JComponent.paintBorder(Ljava/awt/Graphics;)V+22
j  javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+296
j  javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473
j  javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j  javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
j  javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473
j  javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j  javax.swing.JLayeredPane.paint(Ljava/awt/Graphics;)V+73
j  javax.swing.JComponent.paintChildren(Ljava/awt/Graphics;)V+473
j  javax.swing.JComponent.paint(Ljava/awt/Graphics;)V+322
j 
java.awt.GraphicsCallback$PaintCallback.run(Ljava/awt/Component;Ljava/awt/Graphi
cs;)V+27
j 
sun.awt.SunGraphicsCallback.runOneComponent(Ljava/awt/Component;Ljava/awt/Rectan
gle;Ljava/awt/Graphics;Ljava/awt/Shape;I)V+155
j 
sun.awt.SunGraphicsCallback.runComponents([Ljava/awt/Component;Ljava/awt/Graphic
s;I)V+104
j  java.awt.Container.paint(Ljava/awt/Graphics;)V+98
j 
sun.awt.RepaintArea.paintComponent(Ljava/awt/Component;Ljava/awt/Graphics;)V+6
j  sun.awt.RepaintArea.paint(Ljava/lang/Object;Z)V+368
j  apple.awt.ComponentModel.handleEvent(Ljava/awt/AWTEvent;)V+70
j  apple.awt.CWindow.handleEvent(Ljava/awt/AWTEvent;)V+95
j  java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+853
j  java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42
j  java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19
j  java.awt.Component.dispatchEvent(Ljava/awt/AWTEvent;)V+2
j  java.awt.EventQueue.dispatchEvent(Ljava/awt/AWTEvent;)V+46
j  java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z+204
j 
java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/aw
t/EventFilter;)V+30
j 
java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava
/awt/Component;)V+11
j  java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4
j  java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3
j  java.awt.EventDispatchThread.run()V+9
v  ~StubRoutines::call_stub

Java Threads: ( => current thread )
  0x00000001129a2800 JavaThread "DestroyJavaVM" [_thread_blocked,
id=5246976, stack(0x0000000100401000,0x0000000100501000)]
=>0x00000001019eb000 JavaThread "AWT-EventQueue-0" [_thread_in_native,
id=667934720, stack(0x0000000127bfe000,0x0000000127cfe000)]
  0x0000000101a68800 JavaThread "AWT-Shutdown" [_thread_blocked,
id=666873856, stack(0x0000000127afb000,0x0000000127bfb000)]
  0x000000010188e800 JavaThread "Java2D Disposer" daemon [_thread_blocked,
id=662573056, stack(0x00000001276e1000,0x00000001277e1000)]
  0x00000001128b8000 JavaThread "AWT-AppKit" daemon [_thread_in_native,
id=1887423456, stack(0x00007fff5f400000,0x00007fff5fc00000)]
  0x00000001018a0800 JavaThread "Low Memory Detector" daemon
[_thread_blocked, id=339779584, stack(0x000000011430a000,0x000000011440a000)]
  0x000000010189f800 JavaThread "CompilerThread1" daemon [_thread_blocked,
id=338718720, stack(0x0000000114207000,0x0000000114307000)]
  0x000000010189f000 JavaThread "CompilerThread0" daemon [_thread_blocked,
id=337657856, stack(0x0000000114104000,0x0000000114204000)]
  0x000000010189e000 JavaThread "Signal Dispatcher" daemon
[_thread_blocked, id=336596992, stack(0x0000000114001000,0x0000000114101000)]
  0x000000010189d800 JavaThread "Surrogate Locker Thread (CMS)" daemon
[_thread_blocked, id=326111232, stack(0x0000000113601000,0x0000000113701000)]
  0x000000010188b800 JavaThread "Finalizer" daemon [_thread_blocked,
id=322990080, stack(0x0000000113307000,0x0000000113407000)]
  0x000000010188b000 JavaThread "Reference Handler" daemon
[_thread_blocked, id=321929216, stack(0x0000000113204000,0x0000000113304000)]
Other Threads:
  0x0000000101884000 VMThread [stack:
0x0000000113101000,0x0000000113201000] [id=320868352]
  0x00000001018a1000 WatcherThread [stack:
0x000000011440d000,0x000000011450d000] [id=340840448]

VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None

Heap
 par new generation   total 18624K, used 11662K [0x0000000105010000,
0x00000001064d0000, 0x00000001064d0000)
  eden space 16000K,  72% used [0x0000000105010000, 0x0000000105b73900,
0x0000000105fb0000)
  from space 2624K,   0% used [0x0000000105fb0000, 0x0000000105fb0000,
0x0000000106240000)
  to   space 2624K,   0% used [0x0000000106240000, 0x0000000106240000,
0x00000001064d0000)
 concurrent mark-sweep generation total 62656K, used 0K
[0x00000001064d0000, 0x000000010a200000, 0x000000010a410000)
 concurrent-mark-sweep perm gen total 21248K, used 13587K
[0x000000010a410000, 0x000000010b8d0000, 0x000000010f810000)

Virtual Machine Arguments:
JVM Args: -Dfile.encoding=MacRoman 
Java Command: SeaglassBugDemo
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 3840M, Free = 65M

Original issue reported on code.google.com by Krist.Wo...@gmail.com on 2 Feb 2010 at 12:13

GoogleCodeExporter commented 9 years ago
Verified in SeaGlass 0.1.6.

Original comment by kahuxtable on 3 Feb 2010 at 7:10

GoogleCodeExporter commented 9 years ago
Fixed in r.1072.

After discussion on the Sea Glass Google group, including much criticism of use 
of JDesktopPane, it was 
decided to use a slight variant of the non-Mac look on a Mac. We use the Mac 
background colors for the 
JInternalFrame, but otherwise use the non-Mac code.

Use of setContentPane in a JFrame is also discouraged in Sea Glass. Add the 
control to BorderLayout.CENTER 
of the existing content pane instead, e.g. instead of

    this.setContentPane(dPane);

do

    this.add(dPane, BorderLayout.CENTER);

It looks the same.

Original comment by kahuxtable on 4 Feb 2010 at 4:59