Forums Register Login

Please help me with this grid bag layout!!

+Pie Number of slices to send: Send
I'm trying to get this example to work. I keep getting...

Cannot find symbol variable "container"
Cannot find symbol variable "Both"
Cannot find symbol variable "Center"
Cannot find symbol class "Inserts"

I don't understand what I'm doing wrong.

+Pie Number of slices to send: Send
if this is not an exercise in debugging, you will need to
download a copy of the api docs, and have them handy.

rather than tell you what the fixes are, I'll show you where
you can get the answers.

Cannot find symbol variable "container"
variable created in the program, check the spelling

Cannot find symbol variable "Both"
check the api docs for spelling/capitalization
i.e. go to the docs for the specific class (GridBagConstraints)
and check the member variables

Cannot find symbol variable "Center"
check the api docs for spelling/capitalization

Cannot find symbol class "Inserts"
check the api docs for spelling/capitalization
+Pie Number of slices to send: Send
ok, thanks for that. I always forget Java is so strict when it comes to case. I'm too use to VB lol. So I figured out all my problems in the above post, but have now ran into a new one. I created another class to call the layout but when I run it, nothing happens. No errors, no frame. I'm following this book I have exaclty and still can figure it out. Any ideas?

+Pie Number of slices to send: Send
perhaps this line
public class ShowGridBagLayout extends JApplet {

should be
public class ShowGridBagLayout extends JFrame {
+Pie Number of slices to send: Send
Ahh that was it. Can you tell me what the difference is? Becase my book's example uses JApplet, which obviously doesn't work.
+Pie Number of slices to send: Send
A JApplet runs via a html page in a browser

A JFrame is a stand-alone program
(don't know if this is the best description)
+Pie Number of slices to send: Send
Ahhh, Thank you! I got it.
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1732 times.
Similar Threads
GridBagLayout Question: Irregular Spacing
GridBagLayout... Components always centered vertically?
Some More GridBagLayout Help!
Alignment and Spacing between components
GridBagLayout, & addComp() What are the parameters?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:28:51.