Internosis - knowledge management,ecommerce and project consulting
*Home>>>Project Manager

Java components alingment on a panel?


Hi there鈥?br>
I鈥檓 trying to design a little panel with some components attached to it, the only layout manager I can use for this project is the flowLayout. Whenever I try to add a new component it adds it on the side, I need them to appear under the last added component. How can I do this? I tried re-sizing them, alignment none of those things seemed to work.

-------------------------PANEL--------...

-----------
\component1\
-----------
-----------
\component2\
-----------
-----------
\component3\
-----------

-------------------------PANEL--------...

the way FlowLayout works, it lays out your components from left to right until it reaches the end, then it starts over on the next line, etc. Like this:

--| Component 1 | ---- | Component 2| -----------------
--|Component3| -- |Component4| - -|Component5|--
--|Component6|--.....

so what you should do is either make your components be as wide or nearly as wide as the panel, or narrow down the panel, so that only one component per row fits.

when setting sizes in Swing, I use

setSize
setMinimumSize
setMaximumSize
setPreferredSize

all at the same time, try that. Some layouts disregard some of these method calls, but i'm yet to meet someone who'd know this part precisely.

Tags
  Project Control   Project Risk   Project Tools   Project Software   Project Planning   Project Consulting   Project Manager   Project Management   Microsoft Project   Knowledge Solution   Knowledge System   Knowledge Transfer
Related information
  • Tips req. to get release from projects(IT industry)...?

    Too Stressful!

    ...
  • Help me out please please please please please (and as many please that are necessary for u to help someone)?

    I've given you more than enough links on the various types of financing for you to do your homework.

    ...
  • My top managers are always complaining about why I am so slow. How should I react?

    1. You define your own schedule and communicate it to your manager. 2. Comply with the agreed schedule. And remember that Employment is to survive in life. Entrepreneurship is to succeed in...

  • New words part 1?

    I LIKE! will send link to friends!

    ...
  • Some new words....funny ?

    lmao, I loved the salad dodger one

    ...
  • Hey I have a question about music?

    Most alcoholic fathers do not love their sons and some are whip-happy. Don't listen to your father; if people ask for your CD and on shows then that means your music seems to be more liked tha...

  • I run a business projecting 拢250000 turnover this year. Are we below or over the average in the uk?

    LMAO..I dont get out of bed for less than 50 k a day...Ure so passe my friend...

    ...
  • What should i set my reserve to on ebay when seeling my XBOX 360?

    拢50

    ...
  •  

    Categories--Copyright/IP Policy--Contact Webmaster