Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me with this grid bag layout!!

 
Shawn Rieger
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • 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.

 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Ahhh, Thank you! I got it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic