• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Laying out a JPanel

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ryan!

You just saved my BUTT tonight. . .
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic