• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Laying out a JPanel

 
Nathe Chan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Java greenhorns!

I'm stuck again with a JAVA laying out problem.

Currently, I have trouble with laying out the GridLayout and FlowLayout. The teacher has instructed me to lay it out this way. But, my code is the wrong way.

So, I have tried it out, but ended up with the wrong solution.

Here is the image for the wrong solution.

http://img.photobucket.com/albums/v85/nategenerations/ForEmployeeUseOnlyINCORRECT.jpg

I want MY JPanel to look like this.

http://img.photobucket.com/albums/v85/nategenerations/ForEmployeeUseOnlyCORRECT.jpg

My incorrect code is here.



Can you please correct it for me please? Or, just give me an overall picture of how to fix the problem?

That would be nice of you.

Thanks,

-Nathe
 
Ryan Beckett
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I fixed it to the best of my ability (I'm pretty bored and I wanted to use GridLayout).



 
Nathe Chan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ryan!

You just saved my BUTT tonight. . .
 
Campbell Ritchie
Sheriff
Pie
Posts: 48938
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ryan Beckett wrote:I fixed it to the best of my ability (I'm pretty bored and I wanted to use GridLayout).
Please don't. We believe that people learn better if they are given hints as to how something works, rather than simply giving an answer. That case was quite straightforward, but it would have been better to show an example with something similar in.

In some cases (eg assessed work) plagiarism software would find the solution here, and the candidate would risk a 0 overall mark for using other people's work.

This thread would sit better on the Swing forum: moving.
 
Nathe Chan
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree. I had my code there and he was fixing it. And, he pinpointed what I did wrong. Originally, it was my work, so that would not be considred plaigiarism. Using other's would.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic