Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Swing / AWT / SWT
Search Coderanch
Advance search
Google search
Register / Login
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
Forum:
Swing / AWT / SWT
How to arrange button on jtoolbar from right to left instead of left to right
raminaa niilian
Ranch Hand
Posts: 551
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi
Thank you for reading my post.
I tried to use
setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
on a toolbar to force it to arrange buttons from right to left , but it still use left to right
can some one please help me about this ?
how i can force it to show buttons from right to left?
Thanks
Jeff Albertson
Ranch Hand
Posts: 1780
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
import java.awt.*; import javax.swing.*; public class Test { public static void main(String[] args) { EventQueue.invokeLater(new Runnable(){ public void run() { gui(); } }); } static void gui() { JToolBar tb = new JToolBar(); tb.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); for(int i=0; i<8; ++i) tb.add(new JButton("#" + i)); JFrame f = new JFrame("Test"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.getContentPane().add(tb, BorderLayout.NORTH); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); } }
There is no emoticon for what I am feeling!
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Multithread remote method invocation problem
swing buttons
in flow lay out how can i force to add component on next line?
layouts
formatting page/placement of buttons
More...