List of usage examples for javax.swing JDialog getWidth
public int getWidth()
From source file:plugins.tprovoost.Microscopy.MicroManagerForIcy.MMMainFrame.java
/** * Create an error dialog concerning DLL issues with Micro-Manager. * /*from w w w.jav a 2 s . co m*/ * @return Returns the dialog. */ private JDialog createDLLErrorDialog() { MainFrame mainFrame = Icy.getMainInterface().getMainFrame(); // Dialog frame to be returned final JDialog dialog = new JDialog(mainFrame, "Loading Error", true); // main panel of the dialog JPanel panel_main = new JPanel(); panel_main.setLayout(new BorderLayout()); JLabel lbl_html = new JLabel("<html>" + "<h2>Unable to load library</h2>" + "<br/><b>What happened ?</b>" + "<p>The library is a file used by Manager to interact with the devices. Each device needs a specific file in order <br/>" + "to work properly with the system. If only one file is missing, this error occurs.</p>" + "<b>To avoid getting this problem again, please acknowledge the following steps: </b>" + "<ol><li>Do you have Micro-Manager 1.4 installed ? If not, please install it via the button below.</li>" + "<li>Check the application directory of Icy. You should find a file named: " + "<ul><li>on Windows: MMCoreJ_wrap</li><li>on Mac: libMMCoreJ_wrap</li></ul>" + "<li>Plus : you should have a file for each of your devices starting with the name:" + "<ul><li>on Windows: mmgr_dal_</li><li>on Mac: libmmgr_dal_</li></ul>" + "<li>If you don't have these files, please copy (not move) them from the Manager application directory<br/>" + "to your Icy application directory.</li></ol></html>"); panel_main.add(lbl_html, BorderLayout.CENTER); panel_main.setBorder(BorderFactory.createEmptyBorder(10, 20, 10, 20)); JPanel panel_buttons = new JPanel(); panel_buttons.setLayout(new BoxLayout(panel_buttons, BoxLayout.X_AXIS)); panel_buttons.add(Box.createHorizontalGlue()); JButton btn_link = new JButton(); btn_link.setText("Download Micro-Manager 1.4.14"); btn_link.setBackground(Color.WHITE); btn_link.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { NetworkUtil .openBrowser("http://valelab.ucsf.edu/~MM/MMwiki/index.php/Micro-Manager_Version_Archive"); } }); panel_buttons.add(btn_link); JButton btn_ok = new JButton("OK"); btn_ok.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dialog.setVisible(false); } }); panel_buttons.add(btn_ok); panel_main.add(panel_buttons, BorderLayout.SOUTH); dialog.add(panel_main); dialog.pack(); dialog.setLocation((int) mainFrame.getSize().getWidth() / 2 - dialog.getWidth() / 2, (int) mainFrame.getSize().getHeight() / 2 - dialog.getHeight() / 2); return dialog; }