1. <ul id="0c1fb"></ul>

      <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
      <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区

      RELATEED CONSULTING
      相關(guān)咨詢
      選擇下列產(chǎn)品馬上在線溝通
      服務時間:8:30-17:00
      你可能遇到了下面的問題
      關(guān)閉右側(cè)工具欄

      新聞中心

      這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
      java更改代碼顏色 java自定義顏色

      請問各位高手,在java中,如何實現(xiàn)輸入RGB值改變顏色?

      import?java.awt.BorderLayout;

      創(chuàng)新互聯(lián)-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價比介休網(wǎng)站開發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫,直接使用。一站式介休網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務覆蓋介休地區(qū)。費用合理售后完善,10余年實體公司更值得信賴。

      import?java.awt.FlowLayout;

      import?java.awt.event.ActionEvent;

      import?java.awt.event.ActionListener;

      import?java.awt.Color;

      import?javax.swing.JButton;

      import?javax.swing.JFrame;

      import?javax.swing.JLabel;

      import?javax.swing.JPanel;

      import?javax.swing.JTextField;

      public?class?RGB?extends?JFrame?implements?ActionListener{

      JTextField?t1,t2,t3;

      JLabel?b1,b2,b3;

      JButton?jb;

      JPanel?jp;

      public?RGB(){

      ??super("RGB");

      ??jp=new?JPanel();

      ??b1=new?JLabel("R");

      ??b2=new?JLabel("G");

      ??b3=new?JLabel("B");

      ??t1=new?JTextField(3);

      ??t2=new?JTextField(3);

      ??t3=new?JTextField(3);

      ??jb=new?JButton("確定");

      ??jb.addActionListener(this);

      ??jp.add(b1);

      ??jp.add(t1);

      ??jp.add(b2);

      ??jp.add(t2);

      ??jp.add(b3);

      ??jp.add(t3);

      ??jp.add(jb);

      ??jp.setLayout(new?FlowLayout());

      ??

      ??add(jp,BorderLayout.CENTER);

      ??setSize(200,200);

      ??

      ??setResizable(false);

      ??setDefaultCloseOperation(this.DISPOSE_ON_CLOSE);

      ??setVisible(true);

      }

      public?void?actionPerformed(ActionEvent?e){

      ?? if(e.getSource().getClass().getSimpleName().equals("JButton")){

      ?? int?r=Integer.parseInt(t1.getText());

      ?? int?g=Integer.parseInt(t2.getText());

      ?? int?b=Integer.parseInt(t3.getText());

      ?? if(r=0??r=255??g=0??g=255??b=0??b=255){

      ?? Color?c=new?Color(r,g,b);

      ?? jp.setBackground(c);

      ?? }else{

      ?? System.out.println("請輸入(0-255)的整數(shù)!");

      ?? }

      ?? }

      }

      public?static?void?main(String[]?args)?{

      new?RGB();

      }

      }

      請問java的寫代碼的面板的背景色怎么改?白色太刺眼

      不知道你說的是不是eclipse的編輯區(qū)域的背景,我估且認為是吧。

      打開菜單Windows-Preferences在彈出的界面中,選擇General-Editor-Text Editors,在右邊的界面中的Appearance color options中選擇Background color,取消勾選右邊的System Default,然后就可以選擇自己想要的顏色了。

      JAVA中怎么改變字體顏色?

      字體大小及顏色

      a:Java代碼區(qū)域的字體大小和顏色:

      window -- Preferences -- General -- Appearance -- Colors And Fonts -- Java修改 -- Java Edit Text Font

      b:控制臺

      window -- Preferences -- General -- Appearance -- Colors And Fonts -- Debug -- Console font

      c:其他文件

      window -- Preferences -- General -- Appearance -- Colors And Fonts -- Basic -- Text Font

      java 編程 背景顏色的改變

      **************************************************************

      新建一個類ChangeColor.java,代碼如下:

      **************************************************************

      import?java.awt.Color;

      import?java.awt.event.MouseEvent;

      import?java.awt.event.MouseMotionListener;

      import?javax.swing.JFrame;

      /**

      *?@author?Godwin

      *?@version?2010-05-16

      */

      public?class?ChangeColor?extends?JFrame?implements?MouseMotionListener?{

      public?ChangeColor()?{

      this.setTitle("Change?Color");

      this.setBounds(300,?200,?400,?300);

      this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      this.setVisible(true);

      this.getContentPane().setBackground(Color.GREEN);

      this.addMouseMotionListener(this);

      }

      public?void?mouseMoved(MouseEvent?e)?{

      if?(e.getX()??(this.getWidth()?/?2))?{

      this.getContentPane().setBackground(Color.RED);

      }?else?{

      this.getContentPane().setBackground(Color.BLUE);

      }

      }

      public?void?mouseDragged(MouseEvent?e)?{

      }

      public?static?void?main(String[]?args)?{

      new?ChangeColor();

      }

      }

      **************************************************************

      運行結(jié)果如下:

      **************************************************************


      網(wǎng)站題目:java更改代碼顏色 java自定義顏色
      轉(zhuǎn)載來源:http://www.ef60e0e.cn/article/ddjcjde.html
      99热在线精品一区二区三区_国产伦精品一区二区三区女破破_亚洲一区二区三区无码_精品国产欧美日韩另类一区
      1. <ul id="0c1fb"></ul>

        <noscript id="0c1fb"><video id="0c1fb"></video></noscript>
        <noscript id="0c1fb"><listing id="0c1fb"><thead id="0c1fb"></thead></listing></noscript>

        彭阳县| 沾化县| 北宁市| 同心县| 即墨市| 内乡县| 朝阳市| 安泽县| 温州市| 岚皋县| 禹州市| 邮箱| 合阳县| 徐闻县| 贡嘎县| 桃源县| 澳门| 宁远县| 峡江县| 塘沽区| 迁安市| 岚皋县| 姚安县| 克拉玛依市| 彰化市| 泰安市| 霞浦县| 万安县| 年辖:市辖区| 东明县| 河西区| 招远市| 肥城市| 砚山县| 宝应县| 云霄县| 高邑县| 宁陕县| 保德县| 大城县| 句容市|