zoukankan      html  css  js  c++  java
  • java中的BREAK和CONTINUE语句的应用

    package aac;

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;

    /**
     * <p>Title: </p>
     * <p>Description: </p>
     * <p>Copyright: Copyright (c) 2006</p>
     * <p>Company: </p>
     * @author not attributable
     * @version 1.0
     */

    public class Frame1 extends JFrame {
      JPanel contentPane;
      BorderLayout borderLayout1 = new BorderLayout();
      TextArea textArea1 = new TextArea();

      //Construct the frame
      public Frame1() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);
        try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //Component initialization
      private void jbInit() throws Exception  {
        contentPane = (JPanel) this.getContentPane();


        for(int i=0;i<100;i++){
        if(i==46)break;
      if(i%9!=0)continue;
    textArea1.append(i+"\n");
    }
         int i = 0;
         while(true){
         i++;
       if(i==40)break;
     if(i%10!=0)continue;
        textArea1.append(i+"\n");}
        contentPane.setLayout(borderLayout1);
        this.setSize(new Dimension(400, 300));
        this.setTitle("Frame Title");
        contentPane.add(textArea1,  BorderLayout.NORTH);
      }
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
        }
      }
    }

  • 相关阅读:
    Oracle Sql优化之报表和数据仓库运算
    Oracle Sql优化之Rownum的使用
    Oracle Sql优化之范围处理
    c++11编译指令
    python 爬小说
    exvim快捷键
    几个崩溃问题
    网络穿透
    c# 拉取网页
    tars安装记
  • 原文地址:https://www.cnblogs.com/josn1984/p/370115.html
Copyright © 2011-2022 走看看