Content Pane Problems

D

Darum

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
 
S

SadRed

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

getContentPane().setLayout(new GridBagLayout());
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,141
Latest member
BlissKeto
Top