Professional Web Applications Themes

Why would this not work? - Mac Programming

Very simple Java program. Just create a frame and show it. All it prints, however, is "here1" -- it seems to be hanging on the "Frame f = new Frame();" line. Very frustrating. Why would this be happening? (FYI this is on Mac PowerPC G4 running Mac OS X version 10.2.8.) ---- import java.awt.*; public class test { public static void main( String[] args ) { System.out.println( "here1" ); Frame f = new Frame(); System.out.println( "here2" ); f.setSize( new Dimension( 500, 500 ) ); System.out.println( "here3" ); f.setVisible( true ); System.out.println( "here4" ); } }...

  1. #1

    Default Why would this not work?

    Very simple Java program. Just create a frame and show it. All it prints,
    however, is "here1" -- it seems to be hanging on the "Frame f = new Frame();"
    line. Very frustrating. Why would this be happening?

    (FYI this is on Mac PowerPC G4 running Mac OS X version 10.2.8.)
    ----

    import java.awt.*;

    public class test
    {
    public static void main( String[] args )
    {
    System.out.println( "here1" );
    Frame f = new Frame();
    System.out.println( "here2" );
    f.setSize( new Dimension( 500, 500 ) );
    System.out.println( "here3" );
    f.setVisible( true );
    System.out.println( "here4" );
    }
    }
    Hegemony Guest

  2. #2

    Default Re: Why would this not work?

    In article <google.com>,
    com (Hegemony Cricket) wrote:
     

    Have you tried running under the debugger? I get all 4 output lines. I
    _also_ get "-[NSJavaVirtualMachine initWithClassPath:] cannot
    instantiate a Java virtual machine" on the new Frame() line, but the
    window does display at what appears to be the correct size.

    --
    Standard output is like your butt. Everyone has one. When using a bathroom,
    they all default to going into a toilet. However, a person can redirect his
    "standard output" to somewhere else, if he so chooses. - Jeremy Nixon
    Gregory Guest

  3. #3

    Default Re: Why would this not work?

    I ran it under WinXP in Eclipse and also got all 4 outputs. It seems
    to work fine and I can't see anything wrong with the code. You can't
    close the window however because that behavior has not been defined
    yet.

    - Andrew
    Andrew Guest

  4. #4

    Default Re: Why would this not work?

    In article <google.com>,
    com (Andrew Regan) wrote:
     

    I think you're missing the point, though. The code you posted works
    here. Ergo I ask if you have run it under the debugger on the platform
    where you're having trouble at your location.

    --
    Standard output is like your butt. Everyone has one. When using a bathroom,
    they all default to going into a toilet. However, a person can redirect his
    "standard output" to somewhere else, if he so chooses. - Jeremy Nixon
    Gregory Guest

  5. #5

    Default Re: Why would this not work?

    you've set a size, however a location wouldn't go astray

    - perry


    Hegemony Cricket wrote: 

    perry Guest

Similar Threads

  1. Links don't work in Shockwave movie but work in p
    By rokarege in forum Macromedia Director Basics
    Replies: 1
    Last Post: May 3rd, 02:02 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139