1 package eu.svjatoslav.instantlauncher;
3 import eu.svjatoslav.commons.gui.dialog.ExceptionDialog;
8 import java.io.IOException;
12 private static final String FILE_INDICATOR = "{file}";
14 public static void setComponentSize(JComponent component, Dimension size) {
15 component.setMinimumSize(size);
16 component.setMaximumSize(size);
17 component.setSize(size);
18 component.setPreferredSize(size);
21 public static void runOpeningApplication(String commands, final File file) {
23 String[] commandsArray = commands.split("\\s+");
24 for (int i=0; i< commandsArray.length; i++)
25 commandsArray[i] = commandsArray[i].replaceAll("\\{file\\}", file.getAbsolutePath());
27 Runtime.getRuntime().exec(commandsArray);
28 } catch (final IOException e) {
29 new ExceptionDialog(e);
33 public static void executeCommand(String... c) {
35 Runtime.getRuntime().exec(c);
36 } catch (final IOException e) {
37 new ExceptionDialog(e);