亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? multiinputbox.java

?? java包
?? JAVA
字號:
package javabook;

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


/**
 * This dialog is for accepting multiple input values. Input values are returned
 * as an array of String objects. You have to convert the String values to appropriate
 * data type in your code.
 *
 *<p> 
 * This class is provided as freeware. You are free to use as provided or modify to
 * your heart's content. But you use it at your own risk. No implied or explicit 
 * warranty is given.
 * 
 *<p>
 * @author C. Thomas Wu a.k.a Dr. Caffeine
 */
public class MultiInputBox extends JavaBookDialog
{


//-----------------------------------------
//
//    Data Members:
//
//-----------------------------------------
    /**
     * Constant to represent no selection for
     * the getSelectedItem method.
     */
    public static final String[]  NO_ITEM      = null;

    /**
     * Default title for this dialog
     */
    private static final String  DEFAULT_TITLE = "MultiInput Box";

    /**
     * The constant to represent the state which the CANCEL button is clicked
     */    
    private final static int CANCEL  = -2;
    
    /**
     * The constant to represent this dialog is not canceled
     */    
    private final static int OK      = 0;  
    
    /**
     * The state of this dialog
     */
    private int status;

    /**
     * The array of TextField objects for accepting user input
     */
    private JTextField   inputLine[];
    
    /**
     * The array of labels for input lines
     */
    private JLabel       prompt[];
    
    /**
     * A JPanel for the content(message) portion of this dialog
     */
    private JPanel       contentPanel;
    
    /**
     * The number of input lines in this dialog
     */
    private int          numOfRows;
    
    /**
     * The flag to indicate whether to clear the input lines
     * or not after the getInputs method is called.
     */
    private boolean      resetInputLine;


//-----------------------------------------
//
//    Constructors:
//
//-----------------------------------------

    /**
     * Constructs a MultiInputBox with the owner frame and
     * size input lines.
     *
     * @param owner the owning Frame object
     * @param size  the number of input lines
     */
    public MultiInputBox(Frame owner, int size)
    {
        super( owner,true );
        setTitle( DEFAULT_TITLE );
        setIcon( QUESTION_ICON );
        
        numOfRows = size;
        
        prompt    = new JLabel[numOfRows];
        inputLine = new JTextField[numOfRows];
        
        for (int i = 0; i < numOfRows; i++) {
            prompt[i]    = new JLabel("");
            inputLine[i] = new JTextField( 15 );
        }
        
        setDialogState( OK );
        setResetOption( false );
        
    }

    /**
     * Constructs a MultiInputBox with the owner frame and
     * labels for input lines.
     *
     * @param owner  the owning Frame object
     * @param labels the array of String for input line labels
     */
    public MultiInputBox(Frame owner, String[] labels)
    {
        this(owner, labels.length);
        setLabels(labels);
    }


//-----------------------------------------------
//    Public Methods:
//
//
//            String[] getInputs       (                      )
//            boolean  isCanceled      (                      )
//
//            void     setLabels       ( String[]             )
//            void     setResetOption  ( boolean              )
//            void     setValue        ( int,   String        )
//
//----------------------------------------------

    /**
     * Returns the input values entered by the user. If the user
     * clicks the close box or the Cancel button, NO_ITEM is
     * returned. In this case, a subsequent call to isCanceled
     * will return true. If the user clicks the Ok button, an
     * array of Sring is returned. For those input lines that
     * contain no input value, the corresponding element in
     * the array is an empty string.
     *
     * @return an array of String values entered by the user
     */
    public String[] getInputs()
    {
        if (contentPanel == null) { //need to create contentPanel
            createContentPanel( );  //only once
        }
                
        int value = showDialog( );
                
        String result[] = getInputLines( value );
        
        if ( resetInputLine ) clearInputLines();
        
        return result;
    }

    /**
     * Returns true if the state of this dialog is CANCEL.
     *
     * @return the state of this dialog; true if CANCEL; false otherwise
     */
    public boolean isCanceled()
    {
        if (status == CANCEL) {
            return true;
        }
        else {
            return false;
        }
    }

    
    /**
     * Assigns the input line labels to the passed array
     *
     * @param label an array of String for input line labels
     */
    public void setLabels(String[] label)
    {
        for (int i = 0; i < label.length; i++) {
            prompt[i].setText(label[i]);
        }
    }
    
    /**
     * Sets the reset flag. Pass true to clear the input 
     * fields after the getInputs method is called. It
     * is useful to set the flag to false, so the input
     * fields are not reset when you enter a number of
     * similar data. Default is true so the input
     * fields are cleared after each appearance of this
     * dialog.
     *
     * @param option pass 'true' to reset the input fields
     */
    public void setResetOption( boolean option )
    {
        resetInputLine = option;
    }

    /**
     * Sets the value to the input line at the index position. This
     * method is useful to set default input values so the user
     * gets an hint on the type of values expected in the input lines.
     * This method does nothing when the index value is invalid.
     *
     * @param index the position of the input line to set the value
     * @param value the value to assign to the input line
     */
    public void setValue(int index, String value)
    {
        if (index >=0 && index < numOfRows) {
            inputLine[index].setText(value);
        }
        //ignore invalid index.
    }


//-----------------------------------------------
//    Private Methods:
//        
//        void         clearInputLines     (       )
//        void         createContentPanel  (       )
//        String[]     getInputLines       (       )
//
//        void         setDialogState      ( int   )
//        int          showDialog          (       )
//
//-----------------------------------------------

    /**
     * Clears the input lines by assigning empty String
     */
    private void clearInputLines()
    {
        for (int i = 0; i < numOfRows; i++) {
            inputLine[i].setText("");
        }
    }
    
    
    /**
     * Creates the content panel. This panel
     * becomes the content portion of this dialog.
     */
    private void createContentPanel( )
    {
        JPanel promptPanel = new JPanel();
        promptPanel.setLayout( new GridLayout( 0, 1 ) );  
              
        JPanel inputPanel = new JPanel();
        inputPanel.setLayout( new GridLayout( 0, 1 ) );
 
        for (int i = 0; i < numOfRows; i++) {
            promptPanel.add( prompt[i]    );
             inputPanel.add( inputLine[i] );
        }  
        
        contentPanel = new JPanel( );
        contentPanel.setLayout( new BoxLayout( contentPanel, 
                                               BoxLayout.X_AXIS ) );
        contentPanel.add( promptPanel );
        contentPanel.add( inputPanel  );
    }
 

    /**
     * Returns the contents of the input lines
     *
     * return an array of String currently in the input lines
     */

    private String[] getInputLines( int value )
    {
         String[] answer = new String[numOfRows];
         
         switch ( value ) {
           
            case JOptionPane.CLOSED_OPTION:
            case JOptionPane.NO_OPTION:
                                            //CANCEL_OPTION never matches with two buttons
                                            //The second button is NO_OPTION
                          
                          setDialogState( CANCEL );
                          answer = NO_ITEM;
                          break;
                          
            case JOptionPane.OK_OPTION:
        
                          for (int i = 0; i < numOfRows; i++) {
                               answer[i] = inputLine[i].getText( );
                          }
                          
                          setDialogState( OK );
                          break;
                          
            default:      answer = NO_ITEM;         //just in case; this case should
                          setDialogState( CANCEL ); //never happen
                          break;                 
        }        

        return answer;
    }
    
    /**
     * Sets the state of this dialog
     *
     * @param state the new state of this dialog
     */
    private void setDialogState( int state )
    {
        status = state;
    }
    
    /**
     * Displays this dialog using showOptionDialog and
     * returns the user action.
     *
     * return the id value of the user action
     */
    private int showDialog( )
    {
        return  JOptionPane.showOptionDialog( getOwner( ),
                                              contentPanel,
                                              getTitle( ),
                                              JOptionPane.DEFAULT_OPTION,
                                              getIcon( ),
                                              null,
                                              new Object[]{"OK", "Cancel"},
                                              null );
    }




}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本高清不卡aⅴ免费网站| 肉色丝袜一区二区| k8久久久一区二区三区| 中文字幕乱码日本亚洲一区二区| 国产99精品在线观看| 国产精品私人自拍| 色偷偷久久人人79超碰人人澡| 亚洲欧洲日韩一区二区三区| 91久久精品午夜一区二区| 99视频在线精品| 一区二区三区波多野结衣在线观看| 欧美亚洲综合网| 另类欧美日韩国产在线| 国产精品无遮挡| 91福利小视频| 久久成人免费电影| 亚洲图片欧美激情| 欧美一区二区三区思思人| 国产老肥熟一区二区三区| 亚洲日穴在线视频| 欧美一级专区免费大片| 福利电影一区二区三区| 亚洲一区二区偷拍精品| 欧美精品一区二区三区高清aⅴ | 性做久久久久久久免费看| 日韩欧美一卡二卡| zzijzzij亚洲日本少妇熟睡| 日韩精品福利网| 国产欧美日韩久久| 欧美又粗又大又爽| 韩国精品在线观看| 一区二区在线观看免费视频播放| 日韩亚洲电影在线| 91久久精品一区二区| 国产在线精品一区二区| 亚洲午夜精品在线| 中文字幕av一区 二区| 欧美群妇大交群的观看方式| 久久精品亚洲乱码伦伦中文| 91国模大尺度私拍在线视频| 狠狠色丁香久久婷婷综合_中| 亚洲精品一二三四区| 久久久久国产精品厨房| 在线成人午夜影院| 91日韩精品一区| 国产成人av电影在线| 日韩av在线发布| 一区二区三区中文免费| 国产精品乱码一区二区三区软件| 精品久久人人做人人爰| 欧美性猛交xxxxxx富婆| 99这里只有精品| 成人一区二区三区中文字幕| 美国毛片一区二区三区| 视频一区免费在线观看| 亚洲综合免费观看高清完整版在线 | 日韩精品成人一区二区三区 | 欧美激情中文不卡| 欧美一卡二卡在线| 欧美人体做爰大胆视频| 色8久久精品久久久久久蜜| 国产+成+人+亚洲欧洲自线| 韩国女主播成人在线| 免费一级片91| 在线观看欧美日本| 色婷婷久久综合| av午夜一区麻豆| 国产精品一区不卡| 国产一区二区在线看| 韩日欧美一区二区三区| 久久精品久久久精品美女| 蜜乳av一区二区| 九九**精品视频免费播放| 美女网站在线免费欧美精品| 麻豆精品视频在线观看视频| 日本欧美韩国一区三区| 老司机午夜精品| 久久国产综合精品| 九色综合国产一区二区三区| 久久黄色级2电影| 国产伦精品一区二区三区免费迷 | 国产视频在线观看一区二区三区 | 国产一区二区三区黄视频| 国产又黄又大久久| 国产成人在线视频播放| 国产乱码精品一品二品| 不卡的av在线播放| 国产欧美日韩视频一区二区| 国产精品麻豆欧美日韩ww| 中文字幕一区二区在线播放| 日韩毛片一二三区| 亚洲成人av中文| 老司机精品视频在线| 国产精品一二一区| 91网站在线播放| 欧美日韩国产片| 亚洲精品一区二区三区99| 国产婷婷色一区二区三区四区| 国产日韩三级在线| 亚洲精品成人在线| 美女视频第一区二区三区免费观看网站| 蜜臀久久99精品久久久画质超高清 | 亚洲精品伦理在线| 亚洲永久免费av| 男男视频亚洲欧美| 国产91综合一区在线观看| 91日韩一区二区三区| 91精品国产乱码| 欧美国产日韩a欧美在线观看 | 一区精品在线播放| 亚洲成a人在线观看| 黑人精品欧美一区二区蜜桃 | 3d动漫精品啪啪一区二区竹菊| 欧美成人一区二区三区| 国产精品久久久久影院亚瑟| 亚洲成av人影院| 国产激情一区二区三区| 一级特黄大欧美久久久| 日韩国产精品91| caoporen国产精品视频| 91麻豆精品国产自产在线观看一区 | 精品国产一区二区三区四区四| 中文在线资源观看网站视频免费不卡| 一区二区三区欧美激情| 极品瑜伽女神91| 色狠狠色狠狠综合| 久久免费看少妇高潮| 亚洲高清在线视频| 成人黄色av电影| 欧美一区二区免费视频| 依依成人综合视频| 国产成人av电影在线观看| 欧美高清激情brazzers| 国产精品久久久久久久久免费丝袜| 午夜精品久久久久久| 99久久精品国产麻豆演员表| 制服丝袜日韩国产| 一区二区三区在线免费观看| 国产91丝袜在线18| 欧美成人综合网站| 性做久久久久久久免费看| 91天堂素人约啪| 欧美极品少妇xxxxⅹ高跟鞋| 久久精品99国产精品日本| 欧美色图片你懂的| 成人免费小视频| 成人国产视频在线观看| 国产日韩在线不卡| 国产精品一区二区三区乱码| 日韩精品一区国产麻豆| 视频一区中文字幕国产| 91国产丝袜在线播放| 日韩美女啊v在线免费观看| 成人激情开心网| 国产欧美精品日韩区二区麻豆天美| 久久99久久精品| 欧美一区二区福利视频| 日韩精品电影在线| 欧美高清视频www夜色资源网| 亚洲国产综合色| 欧美日韩中文字幕精品| 亚洲国产成人porn| 欧洲精品在线观看| 一区二区三区小说| 色婷婷久久久亚洲一区二区三区| 国产精品蜜臀av| 成人免费高清在线观看| 国产精品麻豆久久久| 91网页版在线| 亚洲一区在线免费观看| 欧美日韩一区二区欧美激情| 亚洲v精品v日韩v欧美v专区| 欧美欧美欧美欧美| 日本强好片久久久久久aaa| 日韩一区二区精品| 韩国v欧美v亚洲v日本v| 久久婷婷国产综合精品青草| 加勒比av一区二区| 久久久不卡影院| 精品国产乱码久久久久久牛牛| 精品在线播放午夜| 国产欧美精品一区aⅴ影院 | av一本久道久久综合久久鬼色| 中文字幕在线不卡| 91国产精品成人| 欧美aa在线视频| 国产亚洲精品bt天堂精选| 99久久er热在这里只有精品15| 一区二区三区在线播放| 欧美一卡二卡三卡四卡| 国产成人一级电影| 亚洲色图一区二区三区| 欧美日本乱大交xxxxx| 精品一二线国产| 国产精品久久久爽爽爽麻豆色哟哟| 在线观看国产日韩| 免费观看91视频大全| 国产精品卡一卡二卡三| 欧美精品在线一区二区三区| 国模一区二区三区白浆|