javax.swing.JFrame.applyComponentOrientation()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(119)

本文整理了Java中javax.swing.JFrame.applyComponentOrientation()方法的一些代码示例,展示了JFrame.applyComponentOrientation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.applyComponentOrientation()方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:applyComponentOrientation

JFrame.applyComponentOrientation介绍

暂无

代码示例

代码示例来源:origin: com.jalalkiswani/jk-desktop

  1. /**
  2. * Adds the panel to frame.
  3. *
  4. * @param frame
  5. * the frame
  6. * @param panel
  7. * the panel
  8. * @param title
  9. * the title
  10. * @throws HeadlessException
  11. * the headless exception
  12. */
  13. public static void addPanelToFrame(final JFrame frame, final JPanel panel, final String title) throws HeadlessException {
  14. frame.add(panel);
  15. frame.setTitle(title);
  16. frame.applyComponentOrientation(getDefaultComponentOrientation());
  17. }

代码示例来源:origin: freeplane/freeplane

  1. private void applyFrameSize(final JFrame frame, int win_x, int win_y) {
  2. GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
  3. Rectangle r = env.getMaximumWindowBounds();
  4. for(GraphicsDevice device : env.getScreenDevices()) {
  5. if(!device.equals(env.getDefaultScreenDevice())) {
  6. Rectangle bounds = device.getDefaultConfiguration().getBounds();
  7. r.add(bounds);
  8. }
  9. }
  10. frame.applyComponentOrientation(ComponentOrientation.getOrientation(Locale.getDefault()));
  11. frame.setPreferredSize(new Dimension(Math.min(r.width, frame.getBounds().width), Math.min(r.height, frame.getBounds().height)));
  12. // frame.setLocation(Math.max(r.x, frame.getBounds().x), Math.max(r.y, frame.getBounds().y));
  13. frame.setLocation(Math.max(r.x, win_x), Math.max(r.y, win_y));
  14. }

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

  1. @Override protected void prePack()
  2. {
  3. frame().applyComponentOrientation(_orientation);
  4. }

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

  1. @Override protected void prePack()
  2. {
  3. frame().applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  4. }
  5. }

代码示例来源:origin: stackoverflow.com

  1. Action createCOToggle(final JFrame frame) {
  2. Action toggleComponentOrientation = new AbstractAction("toggle orientation") {
  3. @Override
  4. public void actionPerformed(ActionEvent e) {
  5. ComponentOrientation current = frame.getComponentOrientation();
  6. if (current.isLeftToRight()) {
  7. frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  8. } else {
  9. frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
  10. }
  11. frame.getRootPane().revalidate();
  12. frame.invalidate();
  13. frame.validate();
  14. frame.repaint();
  15. }
  16. };
  17. return toggleComponentOrientation;
  18. }

代码示例来源:origin: Multibit-Legacy/multibit-hd

  1. /**
  2. * Handles the changes to the locale (resource bundle change, frame locale, component orientation etc)
  3. */
  4. private void handleLocale() {
  5. // Get the current locale
  6. Locale locale = Configurations.currentConfiguration.getLocale();
  7. log.debug("Setting application frame to locale '{}'", locale);
  8. // Ensure the resource bundle is reset
  9. ResourceBundle.clearCache();
  10. // Update the frame to allow for LTR or RTL transition
  11. Panels.getApplicationFrame().setLocale(locale);
  12. // Ensure LTR and RTL language formats are in place
  13. Panels.getApplicationFrame().applyComponentOrientation(ComponentOrientation.getOrientation(locale));
  14. }

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

  1. @Override protected void build(Builder builder)
  2. {
  3. frame().applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  4. //CSOFF: LineLength
  5. builder.fixedPref(label("Total:")).prefAndMore(field("999,999.99")).fixedPref(label("USD"));
  6. //CSON: LineLength
  7. }
  8. }

相关文章

JFrame类方法