本文整理汇总了Java中java.lang.System.exit方法的典型用法代码示例。如果您正苦于以下问题:Java System.exit方法的具体用法?Java System.exit怎么用?Java System.exit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.System
的用法示例。
在下文中一共展示了System.exit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import java.lang.System; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent ae)
{
if(ae.getSource()==but1)
System.exit(1);
if(ae.getSource()==but)
{
tf2.setText("");
String str1=((String)tf1.getSelectedItem()).trim();
/*String str1=tstr;
tf1.removeAllItems();
tf1.addItem(str1);*/
checkverb(str1);
String temp1="";
while (!s.empty())
temp1=temp1+(s.pop().toString())+"\n";
tf2.append(temp1);
//int len4=temp1.length();
//String temp2=temp1.substring(0,len4);
//Spchkverb.text2.setText(" "+temp2);
//tf2.append(temp2);
//tf2.append(" "+temp2);
//System.out.println("stack content :" + temp2);
}
}
示例2: usage
import java.lang.System; //导入方法依赖的package包/类
private static void usage(String[] args) {
System.err.println("launcher_protoutil [-x] [-S b] [-k|-f|-i|-s|-w] [filename]");
System.err.println("\t-k\tdecode a key");
System.err.println("\t-f\tdecode a favorite");
System.err.println("\t-i\tdecode a icon");
System.err.println("\t-s\tdecode a screen");
System.err.println("\t-w\tdecode a widget");
System.err.println("\t-S b\tskip b bytes");
System.err.println("\t-x\textract image data to files");
System.err.println("\t-v\tprint key type data, as well as payload");
System.err.println("\t-l\texpect data from logcat, instead of the local transport");
System.err.println("\tfilename\tread from filename, not stdin");
System.exit(1);
}
示例3: main
import java.lang.System; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
System.out.println("The test is applicable only to Mac OS X. Passed");
return;
}
try {
//Move the mouse out, because it could interfere with the test.
Robot r = new Robot();
r.mouseMove(0, 0);
sleep();
SwingUtilities.invokeAndWait(FullScreenAfterSplash::createAndShowGUI);
sleep();
Point fullScreenButtonPos = frame.getLocation();
fullScreenButtonPos.translate(frame.getWidth() - 10, 10);
r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);
//Cant use waitForIdle for full screen transition.
int waitCount = 0;
while (!windowEnteringFullScreen) {
r.mousePress(InputEvent.BUTTON1_MASK);
r.mouseRelease(InputEvent.BUTTON1_MASK);
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
waitCount = 0;
while (!windowEnteredFullScreen) {
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
} finally {
if (frame != null) {
frame.dispose();
}
}
}
示例4: main
import java.lang.System; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
try {
//Move the mouse out, because it could interfere with the test.
Robot r = new Robot();
r.setAutoDelay(50);
r.mouseMove(0, 0);
sleep();
SwingUtilities.invokeAndWait(FullScreenAfterSplash::createAndShowGUI);
sleep();
Point fullScreenButtonPos = frame.getLocation();
if(System.getProperty("os.version").equals("10.9"))
fullScreenButtonPos.translate(frame.getWidth() - 10, frame.getHeight()/2);
else
fullScreenButtonPos.translate(55,frame.getHeight()/2);
r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);
//Cant use waitForIdle for full screen transition.
int waitCount = 0;
while (!windowEnteringFullScreen) {
r.mousePress(InputEvent.BUTTON1_MASK);
r.mouseRelease(InputEvent.BUTTON1_MASK);
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
waitCount = 0;
while (!windowEnteredFullScreen) {
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
} finally {
if (frame != null) {
frame.dispose();
}
}
}
示例5: main
import java.lang.System; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
if (OSInfo.getOSType() != OSInfo.OSType.MACOSX) {
System.out.println("The test is applicable only to Mac OS X. Passed");
return;
}
try {
//Move the mouse out, because it could interfere with the test.
Robot r = new Robot();
r.setAutoDelay(50);
r.mouseMove(0, 0);
sleep();
SwingUtilities.invokeAndWait(FullScreenAfterSplash::createAndShowGUI);
sleep();
Point fullScreenButtonPos = frame.getLocation();
fullScreenButtonPos.translate(frame.getWidth() - 10, 10);
r.mouseMove(fullScreenButtonPos.x, fullScreenButtonPos.y);
//Cant use waitForIdle for full screen transition.
int waitCount = 0;
while (!windowEnteringFullScreen) {
r.mousePress(InputEvent.BUTTON1_MASK);
r.mouseRelease(InputEvent.BUTTON1_MASK);
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
waitCount = 0;
while (!windowEnteredFullScreen) {
Thread.sleep(100);
if (waitCount++ > 10) {
System.err.println("Can't enter full screen mode. Failed.");
System.exit(1);
}
}
} finally {
if (frame != null) {
frame.dispose();
}
}
}