jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Java Components doing whatever they want Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Java Components doing whatever they want" Watch "Java Components doing whatever they want" New topic
Author

Java Components doing whatever they want

Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Hello,

I have really stuck at this point. I have the code below:

The output is as shown below :

HERE

You can imagine from my code that is not the result I want! So, what I'm doing wrong? Any idea?

Thank you
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2409
If there are separate code blocks for all values of "i" anyway, then there's no point in having the loop at all.

I can't tell what you're trying to accomplish, though; can you describe it in words?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 44476
    
  34
The Components are not doing “what they want”, but what they always do: what you tell them. You said to add the panel four times, and it added the panel four times.
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Yes but, I'm creating new Panel each time and also has different position for each condition(North, South, Page Start, Page End). Also, I have right and left be Page Start and Page End, then why place them North and South ? :S Really weird
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 4087
    
  18

Pan Niko wrote:You can imagine from my code that is not the result I want!


Well, no we can't really. If that's the code that's giving you the output, then how can we expect it to do anything else than what it's doing?

Why don't you tell us what you want?

The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Hello,

Thanks for responses. With code above wanted to add different arrows around a board. That's why I was using North, South, Page End and Start. Figured out how to do it and are simply two things. First, use West and East instead of Page End - Start and second panel's layout to be BoxLayout(), with Y_Axis or X_Axis.

Thank you, again
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Components doing whatever they want
 
It's not a secret anymore!