Mailing Lists: Apple Mailing Lists

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

Re: More SIGBUS when dragging JFrames



Bob

I was mucking about with your code and suddenly the SIGBUS error
went away - the JFrame could be dragged about...

Eventually I found that by calling "pack()" AFTER calling
"setResizable(false)" the SIGBUS error is avoided.

In your original code, you were calling "pack()" BEFORE calling
"setResizable(false)".

Mind you, calling "setResizable(false)" still does not prevent zooming the
window - same problem as with Frame, which apparently has now been fixed.

> 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);
> }
> }




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.