This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

arranging components in jpanel in a vertical manner...?

 
mike lim
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I'm just starting in java... or coming back to using it again... I'm not that good so I was wondering after reading on my old java book, how to arrange components such as labels and buttons in a panel in a vertical position, much like a webpage link panel on the left side where the user chooses which page he wants to go to... the default layout of a jpanel is a flowlayout I think and all the components I add to it just automatically arranges itself horizontally which is really far from what I want to do... Hope any help would be ok... it would be easier if it was html where I just add a <br> in order to skip a line and then just add each separate link... is there some sort of absolute positioning for components in a panel or contentpane where I can use to store jlabels/jbuttons so I can arrange the components in a way that can be more user friendly... thanks again...
 
mike lim
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
without third party gui editing software please... thanks... only hard code...
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
take your pick from this lot

http://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html

> is there some sort of absolute positioning for components in a panel

you set the layout to null, but then you are totally responsible for handling it all.
you might think absolute positioning is the easiest, but it will only create headaches
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic