1 18 package com.Ostermiller.util; 19 20 import java.io.*; 21 import java.text.MessageFormat ; 22 import java.net.URL ; 23 import java.net.URLDecoder ; 24 import java.net.URLClassLoader ; 25 import javax.swing.*; 26 import java.awt.*; 27 import java.awt.event.*; 28 import java.util.Properties ; 29 import java.util.Vector ; 30 import java.util.ResourceBundle ; 31 import java.util.Locale ; 32 import java.io.StringReader ; 33 import java.lang.reflect.*; 34 35 43 public class Browser { 44 45 50 protected static BrowserDialog dialog; 51 52 57 protected static ResourceBundle labels = ResourceBundle.getBundle("com.Ostermiller.util.Browser", Locale.getDefault()); 58 59 67 public static void setLocale(Locale locale){ 68 labels = ResourceBundle.getBundle("com.Ostermiller.util.Browser", locale); 69 } 70 71 83 public static String [] exec = null; 84 85 95 public static void init(){ 96 exec = defaultCommands(); 97 } 98 99 104 public static String [] defaultCommands(){ 105 String [] exec = null; 106 if ( System.getProperty("os.name").startsWith("Windows")){ 107 exec = new String []{ 108 "rundll32 url.dll,FileProtocolHandler {0}", 109 }; 110 } else if (System.getProperty("os.name").startsWith("Mac")){ 111 Vector <String > browsers = new Vector <String >(); 112 try { 113 Process p = Runtime.getRuntime().exec("which open"); 114 if (p.waitFor() == 0){ 115 browsers.add("open {0}"); 116 } 117 } catch (IOException e){ 118 } catch (InterruptedException e){ 119 } 120 if (browsers.size() == 0){ 121 exec = null; 122 } else { 123 exec = (String [])browsers.toArray(new String [0]); 124 } 125 } else { 126 Vector <String > browsers = new Vector <String >(); 127 try { 128 Process p = Runtime.getRuntime().exec("which firebird"); 129 if (p.waitFor() == 0){ 130 browsers.add("firebird -remote openURL({0})"); 131 browsers.add("firebird {0}"); 132 } 133 } catch (IOException e){ 134 } catch (InterruptedException e){ 135 }try { 136 Process p = Runtime.getRuntime().exec("which mozilla"); 137 if (p.waitFor() == 0){ 138 browsers.add("mozilla -remote openURL({0})"); 139 browsers.add("mozilla {0}"); 140 } 141 } catch (IOException e){ 142 } catch (InterruptedException e){ 143 } 144 try { 145 Process p = Runtime.getRuntime().exec("which opera"); 146 if (p.waitFor() == 0){ 147 browsers.add("opera -remote openURL({0})"); 148 browsers.add("opera {0}"); 149 } 150 } catch (IOException e){ 151 } catch (InterruptedException e){ 152 } 153 try { 154 Process p = Runtime.getRuntime().exec("which galeon"); 155 if (p.waitFor() == 0){ 156 browsers.add("galeon {0}"); 157 } 158 } catch (IOException e){ 159 } catch (InterruptedException e){ 160 } 161 try { 162 Process p = Runtime.getRuntime().exec("which konqueror"); 163 if (p.waitFor() == 0){ 164 browsers.add("konqueror {0}"); 165 } 166 } catch (IOException e){ 167 } catch (InterruptedException e){ 168 } 169 try { 170 Process p = Runtime.getRuntime().exec("which netscape"); 171 if (p.waitFor() == 0){ 172 browsers.add("netscape -remote openURL({0})"); 173 browsers.add("netscape {0}"); 174 } 175 } catch (IOException e){ 176 } catch (InterruptedException e){ 177 } 178 try { 179 Process p = Runtime.getRuntime().exec("which xterm"); 180 if (p.waitFor() == 0){ 181 p = Runtime.getRuntime().exec("which lynx"); 182 if (p.waitFor() == 0){ 183 browsers.add("xterm -e lynx {0}"); 184 } 185 } 186 } catch (IOException e){ 187 } catch (InterruptedException e){ 188 } 189 if (browsers.size() == 0){ 190 exec = null; 191 } else { 192 exec = (String [])browsers.toArray(new String [0]); 193 } 194 } 195 return exec; 196 } 197 198 211 public static void save(Properties props){ 212 boolean saveBrowser = false; 213 if (Browser.exec != null && Browser.exec.length > 0){ 214 String [] exec = Browser.defaultCommands(); 215 if (exec != null && exec.length == Browser.exec.length){ 216 for (int i=0; i<exec.length; i++){ 217 if (!exec[i].equals(Browser.exec[i])){ 218 saveBrowser = true; 219 } 220 } 221 } else { 222 saveBrowser = true; 223 } 224 } 225 if (saveBrowser){ 226 StringBuffer sb = new StringBuffer (); 227 for (int i=0; Browser.exec != null && i < Browser.exec.length; i++){ 228 sb.append(Browser.exec[i]).append('\n'); 229 } 230 props.put("com.Ostermiller.util.Browser.open", sb.toString()); 231 } else { 232 props.remove("com.Ostermiller.util.Browser.open"); 233 } 234 } 235 236 247 public static void load(Properties props){ 248 if (props.containsKey("com.Ostermiller.util.Browser.open")){ 249 java.util.StringTokenizer tok = new java.util.StringTokenizer (props.getProperty("com.Ostermiller.util.Browser.open"), "\r\n", false); 250 int count = tok.countTokens(); 251 String [] exec = new String [count]; 252 for (int i=0; i < count; i++){ 253 exec[i] = tok.nextToken(); 254 } 255 Browser.exec = exec; 256 } else { 257 Browser.init(); 258 } 259 } 260 261 276 public static void displayURL(String url) throws IOException { 277 if (exec == null || exec.length == 0){ 278 if (System.getProperty("os.name").startsWith("Mac")){ 279 boolean success = false; 280 try { 281 Class nSWorkspace; 282 if (new File("/System/Library/Java/com/apple/cocoa/application/NSWorkspace.class").exists()){ 283 ClassLoader classLoader = new URLClassLoader (new URL []{new File("/System/Library/Java").toURL()}); 285 nSWorkspace = Class.forName("com.apple.cocoa.application.NSWorkspace", true, classLoader); 286 } else { 287 nSWorkspace = Class.forName("com.apple.cocoa.application.NSWorkspace"); 288 } 289 Method sharedWorkspace = nSWorkspace.getMethod("sharedWorkspace", new Class [] {}); 290 Object workspace = sharedWorkspace.invoke(null, new Object [] {}); 291 Method openURL = nSWorkspace.getMethod("openURL", new Class [] {Class.forName("java.net.URL")}); 292 success = ((Boolean )openURL.invoke(workspace, new Object [] {new java.net.URL (url)})).booleanValue(); 293 } catch (Exception x) {} 295 if (!success){ 296 try { 297 Class mrjFileUtils = Class.forName("com.apple.mrj.MRJFileUtils"); 298 Method openURL = mrjFileUtils.getMethod("openURL", new Class [] {Class.forName("java.lang.String")}); 299 openURL.invoke(null, new Object [] {url}); 300 } catch (Exception x){ 302 System.err.println(x.getMessage()); 303 throw new IOException(labels.getString("failed")); 304 } 305 } 306 } else { 307 throw new IOException(labels.getString("nocommand")); 308 } 309 } else { 310 new URL (url); 317 StringBuffer sb = new StringBuffer (url.length()); 322 for (int i=0; i<url.length(); i++){ 323 char c = url.charAt(i); 324 if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') 325 || c == '.' || c == ':' || c == '&' || c == '@' || c == '/' || c == '?' 326 || c == '%' || c =='+' || c == '=' || c == '#' || c == '-' || c == '\\'){ 327 sb.append(c); 333 } else { 334 c = (char)(c & 0xFF); if (c < 0x10){ 336 sb.append("%0" + Integer.toHexString(c)); 337 } else { 338 sb.append("%" + Integer.toHexString(c)); 339 } 340 } 341 } 342 String [] messageArray = new String [1]; 343 messageArray[0] = sb.toString(); 344 String command = null; 345 boolean found = false; 346 try { 348 for (int i=0; i<exec.length && !found; i++){ 349 try { 350 command = MessageFormat.format(exec[i], (Object [])messageArray); 352 Vector <String > argsVector = new Vector <String >(); 354 BrowserCommandLexer lex = new BrowserCommandLexer(new StringReader (command)); 355 String t; 356 while ((t = lex.getNextToken()) != null) { 357 argsVector.add(t); 358 } 359 String [] args = new String [argsVector.size()]; 360 args = (String [])argsVector.toArray(args); 361 boolean useShortCut = false; 369 if (args[0].equals("rundll32") && args[1].equals("url.dll,FileProtocolHandler")){ 370 if (args[2].startsWith("file:/")){ 371 if (args[2].charAt(6) != '/'){ 372 args[2] = "file://" + args[2].substring(6); 373 } 374 if (args[2].charAt(7) != '/'){ 375 args[2] = "file:///" + args[2].substring(7); 376 } 377 useShortCut = true; 378 } else if (args[2].toLowerCase().endsWith("html") || args[2].toLowerCase().endsWith("htm")){ 379 useShortCut = true; 380 } 381 } 382 if (useShortCut){ 383 File shortcut = File.createTempFile("OpenInBrowser", ".url"); 384 shortcut = shortcut.getCanonicalFile(); 385 shortcut.deleteOnExit(); 386 PrintWriter out = new PrintWriter(new FileWriter(shortcut)); 387 out.println("[InternetShortcut]"); 388 out.println("URL=" + args[2]); 389 out.close(); 390 args[2] = shortcut.getCanonicalPath(); 391 } 392 Process p = Runtime.getRuntime().exec(args); 394 395 for (int j=0; j<2; j++){ 401 try{ 402 Thread.currentThread().sleep(1000); 403 } catch (InterruptedException inte){ 404 } 405 } 406 if (p.exitValue() == 0){ 407 found = true; 412 } 413 } catch (IOException x){ 414 System.err.println(labels.getString("warning") + " " + x.getMessage()); 416 } 417 } 418 if (!found){ 419 throw new IOException(labels.getString("failed")); 421 } 422 } catch (IllegalThreadStateException e){ 423 } 426 } 427 } 428 429 444 public static void displayURLs(String [] urls) throws IOException { 445 if (urls == null || urls.length == 0){ 446 return; 447 } 448 if (urls.length == 1){ 449 displayURL(urls[0]); 450 return; 451 } 452 File shortcut = File.createTempFile("DisplayURLs", ".html"); 453 shortcut = shortcut.getCanonicalFile(); 454 shortcut.deleteOnExit(); 455 PrintWriter out = new PrintWriter(new FileWriter(shortcut)); 456 out.println("<html>"); 457 out.println("<head>"); 458 out.println("<title>" + labels.getString("html.openurls") + "</title>"); 459 out.println("<script language=\"javascript\" type=\"text/javascript\">"); 460 out.println("function displayURLs(){"); 461 for (int i=1; i<urls.length; i++){ 462 out.println("window.open(\"" + urls[i] + "\", \"_blank\", \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes\");"); 463 } 464 out.println("location.href=\"" + urls[0] + "\";"); 465 out.println("}"); 466 out.println("</script>"); 467 out.println("</head>"); 468 out.println("<body onload=\"javascript:displayURLs()\">"); 469 out.println("<noscript>"); 470 for (int i=0; i<urls.length; i++){ 471 out.println("<a target=\"_blank\" HREF=\"" + urls[i] + "\">" + urls[i] + "</a><br>"); 472 } 473 out.println("</noscript>"); 474 out.println("</body>"); 475 out.println("</html>"); 476 out.close(); 477 displayURL(shortcut.toURL().toString()); 478 } 479 480 498 public static void displayURLinNew(String url) throws IOException { 499 displayURLsinNew (new String [] {url}); 500 } 501 502 521 public static void displayURLsinNew(String [] urls) throws IOException { 522 if (urls == null || urls.length == 0){ 523 return; 524 } 525 File shortcut = File.createTempFile("DisplayURLs", ".html"); 526 shortcut.deleteOnExit(); 527 shortcut = shortcut.getCanonicalFile(); 528 PrintWriter out = new PrintWriter(new FileWriter(shortcut)); 529 out.println("<html>"); 530 out.println("<head>"); 531 out.println("<title>" + labels.getString("html.openurls") + "</title>"); 532 out.println("<script language=\"javascript\" type=\"text/javascript\">"); 533 out.println("function displayURLs(){"); 534 out.println("var hlength = 0;"); 535 out.println("try {"); 536 out.println("hlength = history.length;"); 537 out.println("} catch (e) {}"); 538 out.println("if (hlength>0) {"); 539 out.println("window.open(\"" + urls[0] + "\", \"_blank\", \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes\");"); 540 out.println("}"); 541 for (int i=1; i<urls.length; i++){ 542 out.println("window.open(\"" + urls[i] + "\", \"_blank\", \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes\");"); 543 } 544 out.println("if (hlength==0) {"); 545 out.println("location.href=\"" + urls[0] + "\";"); 546 out.println("} else {"); 547 out.println("history.back()"); 548 out.println("}"); 549 out.println("}"); 550 out.println("</script>"); 551 out.println("</head>"); 552 out.println("<body onload=\"javascript:displayURLs()\">"); 553 out.println("<noscript>"); 554 for (int i=0; i<urls.length; i++){ 555 out.println("<a target=\"_blank\" HREF=\"" + urls[i] + "\">" + urls[i] + "</a><br>"); 556 } 557 out.println("</noscript>"); 558 out.println("</body>"); 559 out.println("</html>"); 560 out.close(); 561 displayURL(shortcut.toURL().toString()); 562 } 563 564 579 public static void displayURL(String url, String namedWindow) throws IOException { 580 displayURLs (new String [] {url}, new String [] {namedWindow}); 581 } 582 583 601 public static void displayURLs(String [] urls, String [] namedWindows) throws IOException { 602 if (urls == null || urls.length == 0){ 603 return; 604 } 605 File shortcut = File.createTempFile("DisplayURLs", ".html"); 606 shortcut.deleteOnExit(); 607 shortcut = shortcut.getCanonicalFile(); 608 PrintWriter out = new PrintWriter(new FileWriter(shortcut)); 609 out.println("<html>"); 610 out.println("<head>"); 611 out.println("<title>" + labels.getString("html.openurls") + "</title>"); 612 out.println("<base target=\"" + ((namedWindows==null||namedWindows.length==0||namedWindows[0]==null)?"_blank":namedWindows[0]) + "\">"); 613 out.println("<script language=\"javascript\" type=\"text/javascript\">"); 614 for (int i=1; i<urls.length; i++){ 615 out.println("window.open(\"" + urls[i] + "\", \"" + ((namedWindows==null||namedWindows.length<=i||namedWindows[i]==null)?"_blank":namedWindows[i]) + "\", \"toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes\");"); 616 } 617 out.println("location.href=\"" + urls[0] + "\";"); 618 out.println("</script>"); 619 out.println("</head>"); 620 out.println("<body onload=\"javascript:displayURLs()\">"); 621 out.println("<noscript>"); 622 for (int i=0; i<urls.length; i++){ 623 out.println("<a target=\"" + ((namedWindows==null||namedWindows.length==0||namedWindows[0]==null)?"_blank":namedWindows[0]) + "\" HREF=\"" + urls[i] + "\">" + urls[i] + "</a><br>"); 624 } 625 out.println("</noscript>"); 626 out.println("</body>"); 627 out.println("</html>"); 628 out.close(); 629 displayURL(shortcut.toURL().toString()); 630 } 631 632 647 public static void displayURLs(String [] urls, String namedWindow) throws IOException { 648 displayURLs(urls, new String [] {namedWindow}); 649 } 650 651 656 public static void main(String [] args){ 657 try { 658 Browser.init(); 659 if (Browser.dialogConfiguration(null)){ 660 if (args.length == 0){ 661 Browser.displayURLs(new String []{ 662 "http://www.google.com/", 663 "http://dmoz.org/", 664 "http://ostermiller.org", 665 }, "fun"); 666 } else if (args.length == 1){ 667 Browser.displayURL(args[0], "fun"); 668 } else { 669 Browser.displayURLs(args, "fun"); 670 } 671 } 672 try { 673 Thread.sleep(10000); 674 } catch (InterruptedException x){ 675 } 676 } catch (IOException e){ 677 System.err.println(e.getMessage()); 678 } 679 System.exit(0); 680 } 681 682 690 public static boolean dialogConfiguration(Frame owner){ 691 dialogConfiguration(owner, null); 692 return Browser.dialog.changed(); 693 } 694 695 717 public static boolean dialogConfiguration(Frame owner, Properties props){ 718 if (Browser.dialog == null){ 719 Browser.dialog = new BrowserDialog(owner); 720 } 721 if (props != null){ 722 Browser.dialog.setProps(props); 723 } 724 Browser.dialog.show(); 725 return Browser.dialog.changed(); 726 } 727 728 733 private static JTextArea description; 734 735 740 private static JTextArea commandLinesArea; 741 742 747 private static JButton resetButton; 748 749 754 private static JButton browseButton; 755 756 761 private static JLabel commandLinesLabel; 762 763 768 private static JFileChooser fileChooser; 769 770 773 private static JPanel dialogPanel = null; 774 private static Window dialogParent = null; 775 776 791 public static JPanel getDialogPanel(Window parent){ 792 dialogParent = parent; 793 if (dialogPanel == null){ 794 commandLinesArea = new JTextArea("", 8, 40); 795 JScrollPane scrollpane = new JScrollPane(commandLinesArea); 796 resetButton = new JButton(labels.getString("dialog.reset")); 797 browseButton = new JButton(labels.getString("dialog.browse")); 798 commandLinesLabel = new JLabel(labels.getString("dialog.commandLines")); 799 description = new JTextArea(labels.getString("dialog.description")); 800 description.setEditable(false); 801 description.setOpaque( false ); 802 803 ActionListener actionListener = new ActionListener() { 804 public void actionPerformed(ActionEvent e){ 805 Object source = e.getSource(); 806 if (source == resetButton){ 807 setCommands(Browser.defaultCommands()); 808 } else if (source == browseButton){ 809 if (fileChooser == null){ 810 fileChooser = new JFileChooser(); 811 } 812 if (fileChooser.showOpenDialog(dialogParent) == JFileChooser.APPROVE_OPTION){ 813 String app = fileChooser.getSelectedFile().getPath(); 814 StringBuffer sb = new StringBuffer (2 * app.length()); 815 for (int i=0; i<app.length(); i++){ 816 char c = app.charAt(i); 817 if (c == '\"' || c == '\\') { 819 sb.append('\\'); 820 } 821 sb.append(c); 822 } 823 app = sb.toString(); 824 if (app.indexOf(" ") != -1){ 825 app = '"' + app + '"'; 826 } 827 String commands = commandLinesArea.getText(); 828 if (commands.length() != 0 && !commands.endsWith("\n") && !commands.endsWith("\r")){ 829 commands += "\n"; 830 } 831 commandLinesArea.setText(commands + app + " {0}"); 832 } 833 } 834 } 835 }; 836 837 GridBagLayout gridbag = new GridBagLayout(); 838 GridBagConstraints c = new GridBagConstraints(); 839 c.insets.top = 5; 840 c.insets.bottom = 5; 841 dialogPanel = new JPanel(gridbag); 842 dialogPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 5, 20)); 843 JLabel label; 844 845 846 c.gridwidth = GridBagConstraints.REMAINDER; 847 c.anchor = GridBagConstraints.WEST; 848 gridbag.setConstraints(description, c); 849 dialogPanel.add(description); 850 851 c.gridy = 1; 852 c.gridwidth = GridBagConstraints.RELATIVE; 853 gridbag.setConstraints(commandLinesLabel, c); 854 dialogPanel.add(commandLinesLabel); 855 JPanel buttonPanel = new JPanel(); 856 c.anchor = GridBagConstraints.EAST; 857 browseButton.addActionListener(actionListener); 858 buttonPanel.add(browseButton); 859 resetButton.addActionListener(actionListener); 860 buttonPanel.add(resetButton); 861 gridbag.setConstraints(buttonPanel, c); 862 dialogPanel.add(buttonPanel); 863 864 c.gridy = 2; 865 c.gridwidth = GridBagConstraints.REMAINDER; 866 c.anchor = GridBagConstraints.WEST; 867 gridbag.setConstraints(scrollpane, c); 868 dialogPanel.add(scrollpane); 869 } 870 return dialogPanel; 871 } 872 873 874 879 private static class BrowserDialog extends JDialog { 880 881 886 private JButton okButton; 887 888 893 private JButton cancelButton; 894 895 900 private JLabel commandLinesLabel; 901 902 907 private boolean pressed_OK = false; 908 909 910 924 private void setProps(Properties props){ 925 if (props.containsKey("com.Ostermiller.util.BrowserDialog.title")){ 926 setTitle(props.getProperty("com.Ostermiller.util.BrowserDialog.title")); 927 } 928 if (props.containsKey("com.Ostermiller.util.BrowserDialog.description")){ 929 description.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.description")); 930 } 931 if (props.containsKey("com.Ostermiller.util.BrowserDialog.label")){ 932 commandLinesLabel.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.label")); 933 } 934 if (props.containsKey("com.Ostermiller.util.BrowserDialog.defaults")){ 935 resetButton.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.defaults")); 936 } 937 if (props.containsKey("com.Ostermiller.util.BrowserDialog.browse")){ 938 browseButton.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.browse")); 939 } 940 if (props.containsKey("com.Ostermiller.util.BrowserDialog.ok")){ 941 okButton.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.ok")); 942 } 943 if (props.containsKey("com.Ostermiller.util.BrowserDialog.cancel")){ 944 cancelButton.setText(props.getProperty("com.Ostermiller.util.BrowserDialog.cancel")); 945 } 946 pack(); 947 } 948 949 960 public boolean changed() { 961 return pressed_OK; 962 } 963 964 972 public BrowserDialog(Frame parent) { 973 super(parent, labels.getString("dialog.title"), true); 974 setLocationRelativeTo(parent); 975 } 977 978 983 protected void dialogInit(){ 984 985 super.dialogInit(); 986 987 getContentPane().setLayout(new BorderLayout()); 988 989 getContentPane().add(getDialogPanel(this), BorderLayout.CENTER); 990 991 JPanel panel = new JPanel(new FlowLayout()); 992 okButton = new JButton(labels.getString("dialog.ok")); 993 okButton.addActionListener(new ActionListener() { 994 public void actionPerformed(ActionEvent e){ 995 pressed_OK = true; 996 BrowserDialog.this.setVisible(false); 997 } 998 }); 999 panel.add(okButton); 1000 cancelButton = new JButton(labels.getString("dialog.cancel")); 1001 cancelButton.addActionListener(new ActionListener() { 1002 public void actionPerformed(ActionEvent e){ 1003 pressed_OK = false; 1004 BrowserDialog.this.setVisible(false); 1005 } 1006 }); 1007 panel.add(cancelButton); 1008 1009 getContentPane().add(panel, BorderLayout.SOUTH); 1010 1011 pack(); 1012 } 1013 1014 1020 public void show(){ 1021 setVisible(true); 1022 } 1023 1024 public void setVisible(boolean visible){ 1025 if (visible){ 1026 initPanel(); 1027 super.setVisible(true); 1028 if (pressed_OK){ 1029 userOKedPanelChanges(); 1030 } 1031 } else { 1032 super.setVisible(false); 1033 } 1034 } 1035 1036 1037 } 1038 1039 private static void setCommands(String [] newExec){ 1040 StringBuffer sb = new StringBuffer (); 1041 for (int i=0; newExec != null && i < newExec.length; i++){ 1042 sb.append(newExec[i]).append('\n'); 1043 } 1044 commandLinesArea.setText(sb.toString()); 1045 } 1046 1047 1060 public static void initPanel(){ 1061 setCommands(exec); 1062 } 1063 1064 1077 public static void userOKedPanelChanges(){ 1078 java.util.StringTokenizer tok = new java.util.StringTokenizer (commandLinesArea.getText(), "\r\n", false); 1079 int count = tok.countTokens(); 1080 String [] exec = new String [count]; 1081 for (int i=0; i < count; i++){ 1082 exec[i] = tok.nextToken(); 1083 } 1084 Browser.exec = exec; 1085 } 1086} 1087 | Popular Tags |