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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? menucolor.java

?? JAVA程序設(shè)計(jì)與實(shí)踐.rar
?? JAVA
字號(hào):
/*
 * 文件名:MenuColor.java
 * 說(shuō)  明:實(shí)現(xiàn)文字顏色的編輯功能
 */
// 導(dǎo)入相關(guān)包
import java.awt.*;
import java.awt.event.*;

import javax.swing.*;
// 主類MenuColor
public class MenuColor extends JDialog
                       implements ItemListener,
                                  ActionListener,
                                  TextListener,
                                  AdjustmentListener {
  // AWT組件聲明
  CheckboxGroup gp;
  Checkbox fore, back;
  Scrollbar scrollbarRed, scrollbarGreen, scrollbarBlue;
  TextField textFieldRed, textFieldGreen, textFieldBlue;
  Button colorButtonOk, colorButtonCancel;
  Checkbox colorCheckbox;
  TextField colorTextField;
  // 改變標(biāo)記
  boolean changed = true;
  // 同步標(biāo)記
  boolean synchronism = false;
  // 顏色數(shù)組
  Color[] fbgc = new Color[2];
  Color[] fbgcOld = new Color[2];
  // 前景色標(biāo)記
  boolean isFore = true;

  // 構(gòu)造方法
  MenuColor(Frame frame, boolean modal) {
    super(frame, modal);
  }
  
  // myLayout方法,窗體布局
  public Color[] myLayout(Color fgc, Color bgc) {
    fbgc[0] = fgc;
    fbgc[1] = bgc;
    fbgcOld[0] = fgc;
    fbgcOld[1] = bgc;
    this.getContentPane().setLayout(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = 1;
    gbc.gridheight =1;
    gbc.weightx = 1;
    gbc.weighty = 1;
    gbc.fill = gbc.HORIZONTAL;
    gbc.anchor = gbc.CENTER;

    //CheckboxGroup for fore and back ground
    gp = new CheckboxGroup();
    fore = new Checkbox("Foreground", true, gp);
    back = new Checkbox("Background", false, gp);
    gbc.gridx = 1;
    gbc.gridy = 0;
    getContentPane().add(fore, gbc);
    gbc.gridx = 3;
    gbc.gridy = 0;
    getContentPane().add(back, gbc);
    fore.addItemListener(this);
    back.addItemListener(this);

    // 3 groups of Label + ScrollBar + TextField
    Label labelRed = new Label("Red");
    gbc.gridx = 0;
    gbc.gridy = 1;
    getContentPane().add(labelRed, gbc);
    scrollbarRed = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 256);
    scrollbarRed.setValue(fgc.getRed());
    gbc.gridx = 1;
    gbc.gridy = 1;
    getContentPane().add(scrollbarRed, gbc);
    scrollbarRed.addAdjustmentListener(this);
    textFieldRed = new TextField(3);
    textFieldRed.setText(scrollbarRed.getValue() + "");
    textFieldRed.addTextListener(this);
    //textFieldRed.setEditable(false);
    gbc.gridx = 2;
    gbc.gridy = 1;
    getContentPane().add(textFieldRed, gbc);

    Label labelGreen = new Label("Green");
    gbc.gridx = 0;
    gbc.gridy = 2;
    getContentPane().add(labelGreen, gbc);
    scrollbarGreen = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 256);
    scrollbarGreen.setValue(fgc.getGreen());
    gbc.gridx = 1;
    gbc.gridy = 2;
    getContentPane().add(scrollbarGreen, gbc);
    scrollbarGreen.addAdjustmentListener(this);
    textFieldGreen = new TextField(3);
    textFieldGreen.setText(scrollbarGreen.getValue() + "");
    //textFieldGreen.addTextListener(this);
    textFieldGreen.setEditable(false);
    gbc.gridx = 2;
    gbc.gridy = 2;
    getContentPane().add(textFieldGreen, gbc);

    Label labelBlue = new Label("Blue");
    gbc.gridx = 0;
    gbc.gridy = 3;
    getContentPane().add(labelBlue, gbc);
    scrollbarBlue = new Scrollbar(Scrollbar.HORIZONTAL, 0, 1, 0, 256);
    scrollbarBlue.setValue(fgc.getBlue());
    gbc.gridx = 1;
    gbc.gridy = 3;
    getContentPane().add(scrollbarBlue, gbc);
    scrollbarBlue.addAdjustmentListener(this);
    textFieldBlue = new TextField(3);
    textFieldBlue.setText(scrollbarBlue.getValue() + "");
    //textFieldBlue.addTextListener(this);
    textFieldBlue.setEditable(false);
    gbc.gridx = 2;
    gbc.gridy = 3;
    getContentPane().add(textFieldBlue, gbc);

    //2 Buttons: Ok and Cancel
    colorButtonOk = new Button("Ok");
    gbc.gridx = 4;
    gbc.gridy = 1;
    gbc.fill = gbc.NONE;
    getContentPane().add(colorButtonOk,gbc);
    colorButtonOk.addActionListener(this);

    colorButtonCancel = new Button("Cancel");
    gbc.gridx = 4;
    gbc.gridy = 2;
    getContentPane().add(colorButtonCancel,gbc);
    colorButtonCancel.addActionListener(this);

    //a Checkbox for locking RGB Scrollbar to synchronize
    colorCheckbox = new Checkbox("Lock RGB", false);
    gbc.gridx = 3;
    gbc.gridy = 3;
    getContentPane().add(colorCheckbox,gbc);
    colorCheckbox.addItemListener(this);

    //a TextField for demo the color
    colorTextField = new TextField("Java awt");
    //have to disable this because of 70% decrease in color when setEditable(false)
    //and color can't be corrected  by increasing 1/(70%) since >255
    //colorTextField.setEditable(false);
    colorTextField.setSize(90, 60);
    colorTextField.setForeground(fgc);
    colorTextField.setBackground(bgc);
    colorTextField.setFont(new Font("Courier", Font.BOLD + Font.ITALIC, 36));
    gbc.gridx = 3;
    gbc.gridy = 1;
    gbc.fill = gbc.BOTH;
    getContentPane().add(colorTextField, gbc);

    this.addWindowListener(new WindowAdapter() {
                             public void windowClosing(WindowEvent e) {
                               dispose();
                             }
                           });
    this.setLocation(120, 120);
    this.setResizable(false);
    this.setSize(480,160);
    this.setVisible(true);
    if(changed) {
      return fbgc;
    }
    else
      return fbgcOld;
  }//end of myLayout

  // 事件監(jiān)聽(tīng)方法
  public void actionPerformed(ActionEvent ae) {
    if(ae.getSource() == colorButtonOk) {
      changed = true;
      dispose();
    }
    else if(ae.getSource() == colorButtonCancel) {
      changed = false;
      dispose();
    }
  }//end of ActionListener

  // Item事件監(jiān)聽(tīng)方法
  public void itemStateChanged(ItemEvent ie) {
    if(ie.getSource() == fore) {
      isFore = true;
      scrollbarRed.setValue(fbgc[0].getRed());
      textFieldRed.setText(scrollbarRed.getValue() + "");
      scrollbarGreen.setValue(fbgc[0].getGreen());
      textFieldGreen.setText(scrollbarGreen.getValue() + "");
      scrollbarBlue.setValue(fbgc[0].getBlue());
      textFieldBlue.setText(scrollbarBlue.getValue() + "");
      colorTextField.setForeground(setColorVarSrollbar());
    }
    else if(ie.getSource() == back) {
      isFore = false;
      scrollbarRed.setValue(fbgc[1].getRed());
      textFieldRed.setText(scrollbarRed.getValue() + "");
      scrollbarGreen.setValue(fbgc[1].getGreen());
      textFieldGreen.setText(scrollbarGreen.getValue() + "");
      scrollbarBlue.setValue(fbgc[1].getBlue());
      textFieldBlue.setText(scrollbarBlue.getValue() + "");
      colorTextField.setBackground(setColorVarSrollbar());
    }
    else if(ie.getSource() == colorCheckbox) {
      if(colorCheckbox.getState()) {
        synchronism = true;
      }
      else {
        synchronism = false;
      }
    }
  }//end of ItemListener

  //數(shù)值調(diào)整監(jiān)聽(tīng)方法
  public void adjustmentValueChanged(AdjustmentEvent ade) {
    if(ade.getSource() == scrollbarRed) {
      if(synchronism) {
        textFieldRed.setText(scrollbarRed.getValue() + "");
        scrollbarGreen.setValue(scrollbarRed.getValue());
        textFieldGreen.setText(scrollbarRed.getValue() + "");
        scrollbarBlue.setValue(scrollbarRed.getValue());
        textFieldBlue.setText(scrollbarRed.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
      else {
        textFieldRed.setText(scrollbarRed.getValue()+"");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
    }
    else if(ade.getSource() == scrollbarGreen) {
      if(synchronism) {
        textFieldGreen.setText(scrollbarGreen.getValue() + "");
        scrollbarBlue.setValue(scrollbarGreen.getValue());
        textFieldBlue.setText(scrollbarGreen.getValue() + "");
        scrollbarRed.setValue(scrollbarGreen.getValue());
        textFieldRed.setText(scrollbarGreen.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
      else {
          textFieldGreen.setText(scrollbarGreen.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
    }
    else if(ade.getSource() == scrollbarBlue) {
      if(synchronism) {
        textFieldBlue.setText(scrollbarBlue.getValue() + "");
        scrollbarRed.setValue(scrollbarBlue.getValue());
        textFieldRed.setText(scrollbarBlue.getValue() + "");
        scrollbarGreen.setValue(scrollbarBlue.getValue());
        textFieldGreen.setText(scrollbarBlue.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
      else {
        textFieldBlue.setText(scrollbarBlue.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
    }
  }//end of AdjustmentListener

  //T文字改變監(jiān)聽(tīng)方法
  public void textValueChanged(TextEvent te) {
    if(te.getSource() == textFieldRed) {
      int i = 0;
      try {
        i = Integer.parseInt(textFieldRed.getText());
      } catch(NumberFormatException nfe) {
      }
      if(i < 0)
        i = 0;
      if(i > 255)
        i = 255;
      scrollbarRed.setValue(i);
      if(synchronism) {
        scrollbarGreen.setValue(scrollbarRed.getValue());
        textFieldGreen.setText(scrollbarRed.getValue() + "");
        scrollbarBlue.setValue(scrollbarRed.getValue());
        textFieldBlue.setText(scrollbarRed.getValue() + "");
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }
      else {
        if(isFore) {
          colorTextField.setForeground(setColorVarSrollbar());
          fbgc[0] = setColorVarSrollbar();
        }
        else {
          colorTextField.setBackground(setColorVarSrollbar());
          fbgc[1] = setColorVarSrollbar();
        }
      }

    }
    //else if(te.getSource() == textFieldGreen) {
    //} conflict with textFieldRed
    //else if(te.getSource() == textFieldBlue) {
    //}
  }//end of TextListener

  private Color setColorVarSrollbar() {
   return new Color(scrollbarRed.getValue(),
                    scrollbarGreen.getValue(),
                    scrollbarBlue.getValue());
  }

}//end of class MenuColor

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品亚洲二区| 久久久激情视频| 国产一区视频在线看| 一区二区三区日韩欧美| 久久你懂得1024| 欧美色视频一区| 播五月开心婷婷综合| 青娱乐精品视频| 一区二区三国产精华液| 久久综合久久综合亚洲| 欧美日韩aaa| 99精品视频一区| 国产精品资源在线| 奇米影视一区二区三区| 伊人开心综合网| 国产精品国产自产拍高清av | 国产精品萝li| 精品久久国产97色综合| 欧美丰满少妇xxxbbb| 日本伦理一区二区| 97久久精品人人爽人人爽蜜臀| 九九视频精品免费| 另类小说综合欧美亚洲| 日韩av一区二| 午夜国产不卡在线观看视频| 亚洲精品免费在线观看| 国产精品亲子乱子伦xxxx裸| 久久在线观看免费| 337p粉嫩大胆噜噜噜噜噜91av| 91精品国产乱码久久蜜臀| 日本韩国一区二区三区| 91免费视频网址| 91农村精品一区二区在线| 成人午夜视频在线观看| 国产91精品一区二区麻豆亚洲| 国产最新精品免费| 国产一区二区三区精品视频| 久久不见久久见免费视频1| 日本麻豆一区二区三区视频| 免费观看一级欧美片| 免费三级欧美电影| 美女脱光内衣内裤视频久久网站 | 亚洲午夜免费福利视频| 亚洲精品成人在线| 亚洲一区二区欧美| 亚洲成人动漫在线免费观看| 亚洲成人动漫在线观看| 五月婷婷久久丁香| 美女爽到高潮91| 国产一区二区成人久久免费影院| 经典一区二区三区| 国产成人在线看| 99精品视频在线播放观看| 91福利小视频| 欧美精品1区2区3区| 91精品久久久久久久99蜜桃| 欧美一级片在线| 久久看人人爽人人| 中文字幕日韩一区| 亚洲午夜在线视频| 日本aⅴ免费视频一区二区三区 | 亚洲精品久久久久久国产精华液 | 国产精品小仙女| k8久久久一区二区三区| 色哟哟国产精品| 欧美精品三级日韩久久| 久久五月婷婷丁香社区| 中文字幕精品三区| 亚洲一区电影777| 免费观看在线综合| 成人v精品蜜桃久久一区| 91国产视频在线观看| 日韩欧美一区二区免费| 久久久国际精品| 尤物av一区二区| 精品在线视频一区| 色婷婷综合久色| 欧美电视剧在线看免费| 国产精品福利一区二区| 天堂一区二区在线| 粉嫩av亚洲一区二区图片| 在线免费观看日本欧美| 久久综合九色综合97婷婷| 亚洲丝袜自拍清纯另类| 蜜臀99久久精品久久久久久软件| 成人黄动漫网站免费app| 欧美久久久久久久久中文字幕| 久久久久久综合| 性感美女久久精品| 丁香婷婷综合色啪| 宅男在线国产精品| 亚洲视频在线一区二区| 另类小说综合欧美亚洲| 色久优优欧美色久优优| 久久久久久久电影| 视频在线观看一区| 99精品久久只有精品| 精品福利一二区| 亚洲高清免费视频| 99精品国产99久久久久久白柏| 日韩视频国产视频| 亚洲一区免费在线观看| 成人综合在线观看| 欧美一级二级三级乱码| 一区二区三区不卡视频在线观看| 国产精品自拍在线| 日韩午夜电影av| 亚洲r级在线视频| 色综合色狠狠综合色| 久久九九国产精品| 久草中文综合在线| 欧美一区二区三区四区五区| 亚洲精品国产成人久久av盗摄 | 亚洲午夜免费电影| 99国产精品久久| 国产精品成人免费在线| 国产经典欧美精品| 久久久久久久久97黄色工厂| 九色综合国产一区二区三区| 91麻豆精品国产无毒不卡在线观看| 亚洲男同性视频| av电影在线观看一区| 国产精品乱子久久久久| 成人免费视频caoporn| 国产婷婷一区二区| 国产成人av一区| 国产亚洲美州欧州综合国| 精品一区二区国语对白| 日韩欧美电影一二三| 日韩成人精品视频| 欧美电影免费观看高清完整版 | 在线电影院国产精品| 亚洲国产精品久久久久婷婷884 | 欧美一二三区在线| 丝袜国产日韩另类美女| 欧美人妖巨大在线| 日韩激情av在线| 欧美一个色资源| 精品一区二区三区在线观看国产| 欧美tickle裸体挠脚心vk| 久久99精品国产91久久来源| 日韩精品专区在线影院观看| 久久99热99| 久久婷婷成人综合色| 国产成人免费视频网站| 久久精品亚洲乱码伦伦中文| 丁香天五香天堂综合| 中文字幕日韩一区| 欧美亚洲日本一区| 日韩精品一二三区| 久久久久久影视| 99热精品国产| 亚洲小说欧美激情另类| 91精品国产综合久久久久久| 日本视频一区二区三区| www激情久久| 国产91在线观看丝袜| 亚洲天天做日日做天天谢日日欢 | 午夜精品福利在线| 精品噜噜噜噜久久久久久久久试看| 国产精品影视在线观看| 国产精品天天看| 欧美视频在线一区二区三区| 日本成人在线网站| 国产视频一区不卡| 色视频欧美一区二区三区| 日韩成人伦理电影在线观看| 精品国产免费一区二区三区四区| 丰满放荡岳乱妇91ww| 亚洲福利视频一区| 久久日韩粉嫩一区二区三区| 99re这里只有精品6| 天天色天天操综合| 久久久久一区二区三区四区| 色哦色哦哦色天天综合| 久久精品国产网站| 综合色天天鬼久久鬼色| 正在播放亚洲一区| 99国产精品国产精品久久| 奇米精品一区二区三区四区| 国产午夜精品在线观看| 在线观看日韩一区| 国产精品一级片| 亚洲妇女屁股眼交7| 国产精品视频九色porn| 欧美精品自拍偷拍动漫精品| 成人免费的视频| 蜜桃精品在线观看| 亚洲美女在线国产| 久久理论电影网| 欧美精品久久99| 97se狠狠狠综合亚洲狠狠| 人人狠狠综合久久亚洲| 亚洲六月丁香色婷婷综合久久 | 亚洲一区二三区| 欧美韩国日本综合| 日韩欧美国产wwwww| 欧美三级中文字幕| av激情成人网| 国产精品资源在线|