List of usage examples for javax.swing JFrame setComponentOrientation
public void setComponentOrientation(ComponentOrientation o)
From source file:Main.java
public static void main(String[] args) { FlowLayout layout = new FlowLayout(FlowLayout.LEADING, horizontalGap, verticalGap); JButton button = new JButton("Discard"); JLabel[] panels = new JLabel[5]; JFrame frame = new JFrame("Poker"); frame.setSize(width, height);/*from w w w .ja v a 2 s.com*/ frame.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); JPanel deckPanel = new JPanel(layout); for (int i = 0; i < 5; i++) { panels[i] = new JLabel("" + i); deckPanel.add(panels[i]); } frame.getContentPane().add(deckPanel); JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); buttonPanel.add(button); frame.getContentPane().add(buttonPanel, BorderLayout.SOUTH); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); }