List of utility methods to do JFrame
void | unpackArchive(URL url, File targetDir, JFrame frame, ProgressMonitor progressMonitor) Unpack an archive from a URL if (!targetDir.exists()) { targetDir.mkdirs(); InputStream in = new BufferedInputStream(url.openStream(), 1024); File zip = File.createTempFile("temp", ".zip", targetDir); zip.deleteOnExit(); FileOutputStream fileOutputStream = new FileOutputStream(zip); OutputStream out = new BufferedOutputStream(fileOutputStream); ... |
void | waitFor(JFrame popup) wait For while (popup.isVisible()) { try { Thread.sleep(100); } catch (Exception ex) { ex.printStackTrace(); |
JFrame | wrapPanelInFrame(JFrame frame, JPanel panel, String caption, int width, int height) wrap Panel In Frame frame.setTitle(caption);
frame.setSize(width, height);
frame.add(panel);
frame.pack();
frame.setVisible(true);
return frame;
|
void | write(JFrame frame, String ext, String desc, String text) write File file = findFileSave(frame, ext, desc); if (file == null) { return; write(file, text); |
boolean | writeOrAbort(String path, JFrame frame) Return if yes or not a file should be written. if (fileAlreadyExist(path)) { int n = JOptionPane.showConfirmDialog( frame, path + "\n\n" + "The selected filename already exists. If you\n" + "continue, the contents of the existing file will\n" + "be replaced.\n" + "\n" + "Do you want to continue?", "Replace file", JOptionPane.YES_NO_OPTION); if (n == JOptionPane.YES_OPTION) ... |