How I can arrange the menu items in the system tray rtl?
TrayIcon trayIcon; SystemTray tray; Image getIcon() { return Toolkit.getDefaultToolkit().getImage(getClass().getClassLoader().getResource("pic/kabe.jpg")); } public void HideToSystemTray() { // //System.out.println("creating instance"); try { // //System.out.println("setting look and feel"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { //System.out.println("Unable to set LookAndFeel"); } if (SystemTray.isSupported()) { //System.out.println("system tray supported"); tray = SystemTray.getSystemTray(); // Image image = Toolkit.getDefaultToolkit().getImage("pic/kabe.jpg"); MenuItem defaultItem = new MenuItem(); // defaultItem.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); // defaultItem.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT); defaultItem.setFont(new java.awt.Font("B Nazanin", 1, 14)); PopupMenu popup = new PopupMenu(); // defaultItem.setComponentOrientation( ComponentOrientation.RIGHT_TO_LEFT ); // popup.setHorizontalAlignment(SwingConstants.RIGHT); defaultItem = new MenuItem("نمايش فرم"); defaultItem.setFont(new java.awt.Font("B Nazanin", 1, 14)); popup.add(defaultItem); defaultItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(true); setExtendedState(JFrame.NORMAL); } }); popup.addSeparator(); defaultItem = new MenuItem("درباره ما"); defaultItem.setFont(new java.awt.Font("B Nazanin", 1, 14)); popup.add(defaultItem); defaultItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Info info = new Info(); info.setVisible(true); } }); popup.addSeparator(); ActionListener exitListener = new ActionListener() { public void actionPerformed(ActionEvent e) { //System.out.println("Exiting...."); System.exit(0); } }; defaultItem = new MenuItem("خروج"); defaultItem.setFont(new java.awt.Font("B Nazanin", 1, 14)); popup.add(defaultItem); defaultItem.addActionListener(exitListener); popup.add(defaultItem); trayIcon = new TrayIcon(getIcon(), "azan", popup); // trayIcon=new TrayIcon(image, "SystemTray Demo", popup); trayIcon.setImageAutoSize(true); trayIcon.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(true); setExtendedState(JFrame.NORMAL); } }); } else { //System.out.println("system tray not supported"); } // setIconImage(Toolkit.getDefaultToolkit().getImage("pic/kabe.jpg")); setVisible(true); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // trayIcon.displayMessage("Hello, World", "notification demo", MessageType.NONE); }