I have simple JFrame window and its title keeps floating to the right (although written in english). Living in the middle east but using english version of Windows 7. what would be the correct way to align the title text properly and the left end of the title bar?
imports...
public class MainWindow extends JFrame {
private JPanel contentPane;
private final String arr[] = {"1","2","3","4","5","6","7","8","9","10"};
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
MainWindow frame = new MainWindow("The Simulator");
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public MainWindow(String title) {
super(title);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 582, 435);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
JButton btnRandom = new JButton("Generate new random DCSP");
contentPane.add(btnRandom);
JButton btnManual = new JButton("Generate new manual DCSP");
contentPane.add(btnManual);
}
}
didn't help using
frame.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
or
frame.applyComponentOrientation(ComponentOrientation.getOrientation(Locale.US));