How are you today ranchers ?
Well, I'm confused about how does FlowLayout layouts my components in a JPanel. it's as simple as this; I'm using:
//bottomPanel is an instance of JPanel
And I start to add components to it, but they don't start to occupy space from the Right margin, instead... The components start filling the panel from the middle, and then start moving to the right as more components are added.
Is there something additional I can do to get it to look just like I need it ?
For the Sake of Message Length, I avoided posting any additional code, Probably I'm making the wrong assumptions as to where the problem lies, so... Here's the rest of it:
I'm still not posting everything there, but that's all that has to do with GUI-creation. Oh, and by the way, I have reviewed the Layout tutorials, and unless I understood incorrectly that's how I think I'm supposed to do it to get the components to place themselves there (Right Margin). If I'm wrong please tell me, I'm an Just a student, and you are the master.
You questions is about alignment of components to a panel. To create a SSCCE you ignore your existing code and start from scratch:
a) you create a panel
b) you add a couple of components to it
c) you add the panel to your frame
d) you make the frame visible
It should be about 10-15 lines of code in this case. That is NOT too much to post and is extremely easy for us to read.
Did I not suggest "orientation" is wrong and "alignment" is correct. So why did you post old code when I already gave you the answer to your question. Read the API, the word "align" is used multiple times in the API. I will not spoon feed you the answer, you need to learn how to read the API. This is the last time I repeat myself when I give an answer.
I must apologize for the unnecessary code. it is my fault not to pay attention to your instructions. I should be more careful.
I hope you're not completely upset towards me about it. Sometimes I'm just too eager to get help.
I solved the problem with the hint you provided me, and for that I give you thanks...
I'm deeply sorry for all the inconveniences.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop