• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Aligning components in a Renderer

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have User Details (User Name / Age / Sex / Location). Lets say we need to display all these details in a Table Column.

For e.g.,

Row1 => Karthick 25 Male ABC
Row2 => Arun 26 Male DEF
Row3 => Sharadha 30 Female GHI


In the above column you can see that elements are not ordered properly. All these are displayed in one column named User Details in different row.

What I am trying to achieve is

Row1 => Karthick 25 Male ABC
Row2 => Arun 26 Male DEF
Row3 => Sharadha 30 Female GHI

{HTML does not align properly. Please find attached image}


In a single column, I am trying to Order the details to make sure all the names/ages/sex and location comes properly as shown above.

Any help on this would be appreciated.

I have tried by creating my own renderer and placing four JLabels (one for each above) inside them in Flow Layout and setting Minimum size for all JLabels in them. It did not work.
Post.jpg
[Thumbnail for Post.jpg]
Expected Alignment
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try setting the preferred size, rather than the minimum size. I don't think FlowLayout takes any notice of the minimum size.

(Using a GridLayout would also work, but obviously that would give you columns the same width, and that's probably not what you want).
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what's the problem in using 4 columns?
 
Karthick Dharani Vidhya
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ MathewBrown: I will try that for sure.

@Michael Dunn: We do already show so many columns in that table. Business does not want to increase four or five more columns by splitting them in different columns.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic