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



Harry Mantheakis wrote:
>
> 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);
> > }
> > }

Yep, interesting. I'll add that info to the bug report I filed, but I
believe it's still a bug. I don't believe user code should be able to
create an environment that will cause a bus error.

----------
Bob
Dixon, Ca.


References: 
 >Re: More SIGBUS when dragging JFrames (From: Harry Mantheakis <email@hidden>)



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.