• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Please help me with this grid bag layout!!

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Shawn Rieger
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
perhaps this line
public class ShowGridBagLayout extends JApplet {

should be
public class ShowGridBagLayout extends JFrame {
 
Shawn Rieger
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh that was it. Can you tell me what the difference is? Becase my book's example uses JApplet, which obviously doesn't work.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
Shawn Rieger
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahhh, Thank you! I got it.
 
Thank you my well lotioned goddess! Here, have my favorite tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic