Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridBagLayout Compile problems

 
capp luckett
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI:
I am having trouble getting my app to compile due to the
GridBagLayout.
The error I am getting is "Form.java:118: cannot resolve symbol
symbol : method add (javax.swing.JCheckBox,int,int,int,int)
location: class java.awt.Container
getContentPane().add(ckHourly, 0, 1, 1, bFill);"
In fact, I am getting a error everywhere I am doing a getContentPane().add.
Any clues would be appreciated.
The code, rather lengthy, is:


[This message has been edited by Cindy Glass (edited October 29, 2001).]
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compare your add method with the API they don't match. You need to investigate GridBagLayout a little more. It looks like you are trying to set your grid within the add.
 
capp luckett
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
I have been looking at the 1.3 API but still confused.
I am trying to add my labels, textfields and buttons in the
grid.
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link the the sun tutorial on GridBagLayout.
This link is to the explanation of using the layout.
Notice that in the explanation that the constraints are set then the component is added to the container.

In the above example a button is added to grid location 0, 0. There are other ways to position them as well but the grid location will get you started.
 
capp luckett
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it.Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic