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

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

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

JFrame.applyComponentOrientation介绍

暂无

代码示例

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

/**
 * Adds the panel to frame.
 *
 * @param frame
 *            the frame
 * @param panel
 *            the panel
 * @param title
 *            the title
 * @throws HeadlessException
 *             the headless exception
 */
public static void addPanelToFrame(final JFrame frame, final JPanel panel, final String title) throws HeadlessException {
  frame.add(panel);
  frame.setTitle(title);
  frame.applyComponentOrientation(getDefaultComponentOrientation());
}

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

private void applyFrameSize(final JFrame frame, int win_x, int win_y) {
    GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
    Rectangle r = env.getMaximumWindowBounds();
    for(GraphicsDevice device : env.getScreenDevices()) {
      if(!device.equals(env.getDefaultScreenDevice())) {
        Rectangle bounds = device.getDefaultConfiguration().getBounds();
        r.add(bounds);
      }
    }
    frame.applyComponentOrientation(ComponentOrientation.getOrientation(Locale.getDefault()));
    frame.setPreferredSize(new Dimension(Math.min(r.width, frame.getBounds().width), Math.min(r.height, frame.getBounds().height)));
//        frame.setLocation(Math.max(r.x, frame.getBounds().x), Math.max(r.y, frame.getBounds().y));
    frame.setLocation(Math.max(r.x, win_x), Math.max(r.y, win_y));
  }

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

@Override protected void prePack()
{
  frame().applyComponentOrientation(_orientation);
}

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

@Override protected void prePack()
  {
    frame().applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
  }
}

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

Action createCOToggle(final JFrame frame) {
  Action toggleComponentOrientation = new AbstractAction("toggle orientation") {

    @Override
    public void actionPerformed(ActionEvent e) {
      ComponentOrientation current = frame.getComponentOrientation();
      if (current.isLeftToRight()) {
        frame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
      } else {
        frame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
      }
      frame.getRootPane().revalidate();
      frame.invalidate();
      frame.validate();
      frame.repaint();
    }

  };
  return toggleComponentOrientation;
}

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

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

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

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

相关文章

JFrame类方法