Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SIGBUS when dragging JFrame



I ran into a SIGBUS last night and distilled it down to a simple test
case. Create a simple JFrame containing a JLabel that has an ImageIcon,
text and a border. Drag the JFrame and kaboom! If the ImageIcon has NO
text the SIGBUS doesn't occur. Has anyone else seen behavior like this?

This is the code that will cause the error.

import java.awt.*;
import javax.swing.*;
import javax.swing.border.*;

public class JFrameTest extends JFrame {
public JLabel mImageLabel;
public Container mContentPane;
public ImageIcon mIcon;

public static void main(String args[]) {
new JFrameTest();
}

public JFrameTest() {
super("JFrame Drag");
mContentPane = getContentPane();
mIcon = new ImageIcon("insertJPEGofchoice.jpg");
mImageLabel = new JLabel(mIcon);
mImageLabel.setBorder(BorderFactory.createEtchedBorder());
mImageLabel.setText("The Text Goes Here");
mContentPane.add(mImageLabel);
pack();
setResizable(false);
setVisible(true);
}
}

If I remove the line 'mImageLabel.setText("The Text Goes Here");'
dragging the JFrame works fine. I also noticed that if I try changing
the layout manager of the ContentPane to a FlowLayout I get some minor
drawing errors. If this is not already a known problem, I'll file a bug
report with my test case.

--
Bob

Mac OS X 10.0.3 on 500MHz Cube, 768MB

So they cloned a sheep - who could tell the difference anyway? - Robin Williams




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.