ICU-5933 icu4j demo launcher
X-SVN-Rev: 22685
This commit is contained in:
parent
b9384ca1ea
commit
b39cfd087a
@ -646,6 +646,8 @@
|
||||
<fileset dir="${build.dir}" includes="com/ibm/icu/dev/demo/**" />
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${corp}" />
|
||||
<attribute name="Main-Class" value="com.ibm.icu.dev.demo.Launcher" />
|
||||
<attribute name="Class-Path" value="icu4j.jar" />
|
||||
<section name="common">
|
||||
<attribute name="Specification-Title" value="${manifest.specification.title}" />
|
||||
<attribute name="Specification-Version" value="${icu4j.spec.version.string}" />
|
||||
|
@ -95,9 +95,15 @@ public class Launcher extends DemoApplet {
|
||||
add(BorderLayout.CENTER,topPanel);
|
||||
statusLabel = new Label("");
|
||||
statusLabel.setAlignment(Label.LEFT);
|
||||
String javaVersion = "";
|
||||
try {
|
||||
javaVersion = "* Java: "+System.getProperty("java.version");
|
||||
} catch (Throwable t) {
|
||||
javaVersion = "";
|
||||
}
|
||||
add(BorderLayout.NORTH, new Label(
|
||||
"ICU Demos \u2022 ICU version "+VersionInfo.ICU_VERSION +
|
||||
" \u2022 http://icu-project.org"));
|
||||
"ICU Demos * ICU version "+VersionInfo.ICU_VERSION +
|
||||
" * http://icu-project.org "+javaVersion));
|
||||
add(BorderLayout.SOUTH,statusLabel);
|
||||
// set up an initial status.
|
||||
showStatus(buttonList.length+" demos ready. ");
|
||||
|
@ -14,6 +14,7 @@ import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.AccessControlException;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
@ -45,7 +46,12 @@ public class DetectingViewer extends JFrame implements ActionListener
|
||||
super();
|
||||
DemoApplet.demoFrameOpened();
|
||||
|
||||
fileChooser = new JFileChooser();
|
||||
try {
|
||||
fileChooser = new JFileChooser();
|
||||
} catch (AccessControlException ace) {
|
||||
System.err.println("no file chooser - access control exception. Continuing without file browsing. "+ace.toString());
|
||||
fileChooser = null; //
|
||||
}
|
||||
|
||||
// setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setSize(800, 800);
|
||||
@ -373,6 +379,9 @@ public class DetectingViewer extends JFrame implements ActionListener
|
||||
mi.setAccelerator((KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK)));
|
||||
mi.addActionListener(this);
|
||||
menu.add(mi);
|
||||
if(fileChooser == null) {
|
||||
mi.setEnabled(false); // no file chooser.
|
||||
}
|
||||
|
||||
mi = new JMenuItem("Open URL...");
|
||||
mi.setAccelerator((KeyStroke.getKeyStroke(KeyEvent.VK_U, ActionEvent.CTRL_MASK)));
|
||||
|
Loading…
Reference in New Issue
Block a user