/** * Displays the Spark error log. */ private void showErrorLog() { final File logDir = new File(Spark.getLogDirectory(), "errors.log"); // Read file and show final String errorLogs = URLFileSystem.getContents(logDir); final JFrame frame = new JFrame(Res.getString("title.client.logs")); frame.setLayout(new BorderLayout()); frame.setIconImage(SparkManager.getApplicationImage().getImage()); final JTextPane pane = new JTextPane(); pane.setBackground(Color.white); pane.setFont(new Font("Dialog", Font.PLAIN, 12)); pane.setEditable(false); pane.setText(errorLogs); frame.add(new JScrollPane(pane), BorderLayout.CENTER); final JButton copyButton = new JButton(Res.getString("button.copy.to.clipboard")); frame.add(copyButton, BorderLayout.SOUTH); copyButton.addActionListener( e -> { SparkManager.setClipboard(errorLogs); copyButton.setEnabled(false); } ); frame.pack(); frame.setSize(600, 400); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); }
centerWindowOnScreen(window); return;
dialog.pack(); dialog.setSize(600, 400); GraphicUtils.centerWindowOnScreen(dialog); dialog.setVisible(true);
GraphicUtils.centerWindowOnScreen(loginDialog);
window.setCaretPosition(0); window.requestFocus(); GraphicUtils.centerWindowOnScreen(frame); frame.setVisible(true); window.setEditable(false);
dialog.setSize(500, 500); GraphicUtils.centerWindowOnScreen(dialog); dialog.setVisible(true);
GraphicUtils.centerWindowOnScreen(dialog); dialog.setVisible(true);
GraphicUtils.centerWindowOnScreen(frame); frame.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent windowEvent) {
GraphicUtils.centerWindowOnScreen(this);
GraphicUtils.centerWindowOnScreen(mainWindow);
GraphicUtils.centerWindowOnScreen(this);