Tabnine Logo
ComponentUtil.centerComponentInComponent
Code IndexAdd Tabnine to your IDE (free)

How to use
centerComponentInComponent
method
in
org.apache.jorphan.gui.ComponentUtil

Best Java code snippets using org.apache.jorphan.gui.ComponentUtil.centerComponentInComponent (Showing top 5 results out of 315)

origin: org.apache.jmeter/ApacheJMeter_core

/**
 * Show a dialog indicating that JMeter threads are stopping on a particular
 * host.
 *
 * @param host
 *            the host where JMeter threads are stopping
 */
public void showStoppingMessage(String host) {
  if (stoppingMessage != null){
    stoppingMessage.dispose();
  }
  stoppingMessage = new EscapeDialog(this, JMeterUtils.getResString("stopping_test_title"), true); //$NON-NLS-1$
  String label = JMeterUtils.getResString("stopping_test"); //$NON-NLS-1
  if (!StringUtils.isEmpty(host)) {
    label = label + JMeterUtils.getResString("stopping_test_host")+ ": " + host;
  }
  JLabel stopLabel = new JLabel(label); //$NON-NLS-1$$NON-NLS-2$
  stopLabel.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
  stoppingMessage.getContentPane().add(stopLabel);
  stoppingMessage.pack();
  ComponentUtil.centerComponentInComponent(this, stoppingMessage);
  SwingUtilities.invokeLater(() -> {
      if (stoppingMessage != null) {
        stoppingMessage.setVisible(true);
      }
  });
}
origin: org.apache.jmeter/ApacheJMeter_components

/**
 * Display result in popup
 * @param result String 
 */
private static final void showResult(String result) {
  EscapeDialog messageDialog = new EscapeDialog(GuiPackage.getInstance().getMainFrame(),
      JMeterUtils.getResString("export_transactions_title"), true); //$NON-NLS-1$
  Container contentPane = messageDialog.getContentPane();
  contentPane.setLayout(new BorderLayout());
  contentPane.add(new JLabel(
      JMeterUtils.getResString("export_transactions_exported_property"), 
      SwingConstants.CENTER), BorderLayout.NORTH);//$NON-NLS-1$
  JSyntaxTextArea syntaxTextArea = JSyntaxTextArea.getInstance(10, 80, true);
  syntaxTextArea.setText(result);
  syntaxTextArea.setCaretPosition(0);
  contentPane.add(JTextScrollPane.getInstance(syntaxTextArea), BorderLayout.CENTER);
  messageDialog.pack();
  ComponentUtil.centerComponentInComponent(GuiPackage.getInstance().getMainFrame(), messageDialog);
  SwingUtilities.invokeLater(() -> messageDialog.setVisible(true));
}
origin: org.apache.jmeter/ApacheJMeter_core

  @Override
  public void actionPerformed(ActionEvent e) {
    SavePropertyDialog d = new SavePropertyDialog(
        GuiPackage.getInstance().getMainFrame(),
        JMeterUtils.getResString("sample_result_save_configuration"), // $NON-NLS-1$
        true, collector.getSaveConfig());
    d.pack();
    ComponentUtil.centerComponentInComponent(GuiPackage.getInstance().getMainFrame(), d);
    d.setVisible(true);
  }
});
origin: kg.apc/jmeter-plugins-extras

    true, collector.getSaveConfig());
d.pack();
ComponentUtil.centerComponentInComponent(GuiPackage.getInstance()
    .getMainFrame(), d);
d.setVisible(true);
origin: undera/jmeter-plugins

    true, collector.getSaveConfig());
d.pack();
ComponentUtil.centerComponentInComponent(GuiPackage.getInstance()
    .getMainFrame(), d);
d.setVisible(true);
org.apache.jorphan.guiComponentUtilcenterComponentInComponent

Javadoc

Use this static method if you want to center a component over another component.

Popular methods of ComponentUtil

  • centerComponentInWindow
    Use this static method if you want to center and set its position compared to the size of the curren

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now