• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Aligning component from Right to Left

 
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I need to align components in the order of Right to Left alignment.Any suggestions which layout manager will be best suited for this scenario.
 
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

you could try FlowLayout with ComponentOrientation.RIGHT_TO_LEFT layout orientation. Hope this works for you as expected.

Marco
[ May 07, 2008: Message edited by: Marco Ehrentreich ]
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marco Ehrentreich:
Hi,

you could try FlowLayout with ComponentOrientation.RIGHT_TO_LEFT layout orientation. Hope this works for you as expected.



Thanks Marco for your suggestion,

It didn't work out as intended.I will explain my problem in more detail

I already have a JPanel with BorderLayout consider it as MainPanel.Now over my MainPanel i added one more JPanel with FlowLayout consider it as SubPanel.

Now the view is my MainPanel contains SubPanel.

Now i need to insert some Components like JLabel,JButton onto my SubPanel in Right to Left alignment.

But what i am getting is the last component i insert in my SubPanel is only visible in my MainPanel.How to overcome this one?
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
To get better help sooner, post a SSCCE that clearly demonstrates your problem.
 
Marco Ehrentreich
best scout
Posts: 1294
Scala IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you have a problem with the hierarchical structuring of your containers and layout managers. You have to use containers like panels to add more than one component. Then you have to layout these containers with a layout manager. There's definitely something wrong if you can only add ONE component because then a layout manager wouldn't make any sense

Perhaps Sun's Java Tutorial may help you to get it right.

Marco
 
Balasubramanian Chandrasekaran
Ranch Hand
Posts: 215
Firefox Browser VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys,

I resolved it by placing all the components on a single JPanel and it worked well.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic