Content Pane Problem

Discussion in 'Java' started by Darum, Jul 18, 2007.

  1. Darum

    Darum Guest

    Greetings!

    I'm facing two related problems in developing a Java Applet.

    My applet class extends JApplet.

    1) The current default layout of the whole window (not individual
    components) seems to be a flowLayout. I'd like to set the layout to a
    gridBagLayout, however the setLayout command does not seem to be
    understood (my compiler is eclipse, JRE 1.5.0 and JDK 5.0), so I
    cannot get the following code to work, no specific error msg
    generated:
    getContentPane.setLayout(new GridBagLayout);

    2) similar problem, cannot setBackground or setForeground of the
    overall pane.

    Please Advise, thanks.

    -Darum
     
    Darum, Jul 18, 2007
    #1
    1. Advertising

  2. Darum wrote:
    ...
    >I'm facing two related problems in developing a Java Applet.


    You are probably not up to solving them.
    Applets are for those that are already
    experienced GUI designers, and GUI
    design requires a good understanding
    of core J2SE, compiling & debugging.
    You seem to possess none of this
    knowledge, and none of those skills.

    (I suggest you) Hire a consultant.

    >...(my compiler is eclipse, JRE 1.5.0 and JDK 5.0), so I
    >cannot get the following code to work, no specific error msg
    >generated:


    Really? That Eclipse/JDK combo. is apparently broken,
    because this snippet of code..

    > getContentPane.setLayout(new GridBagLayout);


    ..is definitely rubbish. My compiler here reports..
    '(' or '[' expected
    ..indicating a particular point on that line.
    That might not be exactly what YourEclipse
    is 'telling you', but it sure does not say
    'no specific error message'.

    That is either not the code being used, in
    which case you are wasting our time, or
    your eclipse is very broken.

    Try posting an SSCCE, and/or exact messages..
    <http://www.physci.org/codes/sscce.html>

    Please read that link carefully before posting
    your 'entire broken code' - because I am sure
    *not* asking for that - just a tiny example.

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via http://www.javakb.com
     
    Andrew Thompson, Jul 18, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick.O.Ige
    Replies:
    0
    Views:
    773
    Patrick.O.Ige
    Aug 31, 2006
  2. Darum

    Content Pane Problems

    Darum, Jul 17, 2007, in forum: Java
    Replies:
    2
    Views:
    351
    SadRed
    Jul 19, 2007
  3. Knute Johnson
    Replies:
    2
    Views:
    438
    Knute Johnson
    Nov 10, 2007
  4. Replies:
    0
    Views:
    402
  5. Andy B
    Replies:
    0
    Views:
    410
    Andy B
    Sep 27, 2008
Loading...

Share This Page