欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

java工具代碼,java代碼軟件

java用什么軟件編寫

JAVA編程常用的軟件:

東昌網(wǎng)站建設公司創(chuàng)新互聯(lián)公司,東昌網(wǎng)站設計制作,有大型網(wǎng)站制作公司豐富經(jīng)驗。已為東昌上千多家提供企業(yè)網(wǎng)站建設服務。企業(yè)網(wǎng)站搭建\外貿營銷網(wǎng)站建設要多少錢,請找那個售后服務好的東昌做網(wǎng)站的公司定做!

1、Intellij IDEA

Intellij IDEA是當前Java開發(fā)人員呼聲很高的一款IDE,具有美觀,高效等眾多特點,小編還是非常喜歡的,所以以往我都是在自己電腦安裝這款軟件的。

2、Eclipse

Eclipse是免費的,這點很重要,所以大多公司里依然是使用eclipse這款IDE,而且它良好的性能,也在市場占著不小的比重。

3、MyEclipse

MyEclipse是同eclipse一個公司的,在功能上增加了不少,相對于eclipse來說,myeclipse更像將eclipse中好多插件都集成起來了,當然,性能上面也有更好的考慮,不過這款IDE是收費的。

4、NetBeans

NetBeans是甲骨文公司生產的IDE,在其中也內置了許多功能,相對于idea和eclipse市場還是較少的。

5、JDK

JDK是Java語言必備的工具,我們代碼編寫、編譯、運行都是依靠jdk來幫助我們運作,jdk是編寫Java代碼的根基。

數(shù)據(jù)單位轉換工具java代碼

import?javax.swing.*;

import?javax.swing.event.*;

import?java.awt.*;

import?java.awt.event.*;

public?class?UnitTransfer?extends?JFrame{

private?final?int?WIDTH?=?400,?HEIGHT?=?300;//窗口默認的寬度、高度

private?JLabel?lblInUnit=new?JLabel("輸入單位");

private?JComboBox?cboIn=new?JComboBox(new?String[]{"",?""});

private?JLabel?lblIn=new?JLabel("輸入數(shù)值");

private?JTextField?txtIn=new?JTextField("10");

private?JLabel?lblOutUnit=new?JLabel("輸出單位");

private?JLabel?lblResult=new?JLabel("顯示結果");

private?JLabel?txtResult=new?JLabel("結果");

private?JComboBox?cboOut=new?JComboBox(new?String[]{"",?""});

private?JButton?btnTrans?=?new?JButton("轉換");

private?JButton?btnClear?=?new?JButton("清空");

private?JRadioButton?rdLeng?=?new?JRadioButton("長度");

private?JRadioButton?rdWeig?=?new?JRadioButton("時間");

private?String?[]?lengthUnit={"米",?"分米",?"厘米",?"毫米"};

private?String?[]?timeUnit={"天",?"時",?"分",?"秒"};

public?UnitTransfer(){

super("簡單的單位轉換器?Beta");

this.setSize(WIDTH,?HEIGHT);

this.setLayout(null);

this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

ButtonGroup?group?=?new?ButtonGroup();

group.add(rdLeng);

group.add(rdWeig);

this.getContentPane().add(rdLeng);

this.getContentPane().add(rdWeig);

this.getContentPane().add(btnTrans);

this.getContentPane().add(btnClear);

this.getContentPane().add(lblIn);

this.getContentPane().add(txtIn);

this.getContentPane().add(lblInUnit);

this.getContentPane().add(cboIn);

this.getContentPane().add(lblResult);

this.getContentPane().add(txtResult);

this.getContentPane().add(lblOutUnit);

this.getContentPane().add(cboOut);

this.setVisible(true);

this.doLayout();

btnTrans.addActionListener(new?ActionListener(){

public?void?actionPerformed(ActionEvent?e){

doConvert();

}

});

btnClear.addActionListener(new?ActionListener(){

public?void?actionPerformed(ActionEvent?e){

txtIn.setText("0");

txtResult.setText("0");

}

});

rdLeng.addActionListener(new?ActionListener(){

public?void?actionPerformed(ActionEvent?e){

cboIn.setModel(new?DefaultComboBoxModel(lengthUnit));

cboOut.setModel(new?DefaultComboBoxModel(lengthUnit));

}

});

rdWeig.addActionListener(new?ActionListener(){

public?void?actionPerformed(ActionEvent?e){

cboIn.setModel(new?DefaultComboBoxModel(timeUnit));

cboOut.setModel(new?DefaultComboBoxModel(timeUnit));

}

});

rdLeng.setSelected(true);

cboIn.setModel(new?DefaultComboBoxModel(lengthUnit));

cboOut.setModel(new?DefaultComboBoxModel(timeUnit));

}

final?int?offX=100;

public?void?doLayout(){

super.doLayout();

rdLeng.setBounds(offX,?15,?60,?20);

rdWeig.setBounds(rdLeng.getX()+rdLeng.getWidth()+5,?15,?60,?20);

lblInUnit.setBounds(offX,?rdLeng.getY()+rdLeng.getHeight()+20,?80,?20);

cboIn.setBounds(lblInUnit.getX()+lblInUnit.getWidth()+5,?lblInUnit.getY(),?80,?20);

lblIn.setBounds(offX,?lblInUnit.getY()+lblInUnit.getHeight()+5,?80,?20);

txtIn.setBounds(lblIn.getX()+lblIn.getWidth()+5,?lblIn.getY(),?80,?20);

lblOutUnit.setBounds(offX,?lblIn.getY()+lblIn.getHeight()+30,?80,?20);

cboOut.setBounds(lblOutUnit.getX()+lblOutUnit.getWidth()+5,?lblOutUnit.getY(),?80,?20);

lblResult.setBounds(offX,?cboOut.getY()+cboOut.getHeight()+5,?80,?20);

txtResult.setBounds(lblResult.getX()+lblResult.getWidth()+5,?lblResult.getY(),?100,?20);

int?w=getWidth?();

int?x=(w-70*2-5)/2;//水平居中

btnTrans.setBounds(x,?lblResult.getY()+lblResult.getHeight()+30,?70,?25);

btnClear.setBounds(btnTrans.getX()+btnTrans.getWidth()+3,?btnTrans.getY(),?70,?25);

}

public?void?doConvert(){

double?v=0;

try{

v=?Double.parseDouble(txtIn.getText());

}catch(Exception?ex){

txtIn.setText("0");

return;

}

//"米",?"分米",?"厘米",?"毫米"

if(rdLeng.isSelected()){

switch(cboIn.getSelectedIndex()){

case?0:

break;

case?1:

v=v/10;

break;

case?2:

v=v/100;

break;

case?3:

v=v/1000;

break;

default:

return;

}

//v?現(xiàn)在是標準單位:米

switch(cboOut.getSelectedIndex()){

case?0:

break;

case?1:

v=v*10;

break;

case?2:

v=v*100;

break;

case?3:

v=v*1000;

break;

default:

return;

}

if(v0.01){

txtResult.setText(String.format("%2.8f",?v));

}else{

txtResult.setText(String.format("%2.2f",?v));

}

}else{

//"天",?"時",?"分",?"秒"

switch(cboIn.getSelectedIndex()){

case?0:

v=v*24;

break;

case?1:

break;

case?2:

v=v/60;

break;

case?3:

v=v/3600;

break;

default:

return;

}

//v?現(xiàn)在是標準單位:小時

switch(cboOut.getSelectedIndex()){

case?0:

v=v/24;

break;

case?1:

break;

case?2:

v=v*60;

break;

case?3:

v=v*3600;

break;

default:

return;

}

if(v0.01){

txtResult.setText(String.format("%2.8f",?v));

}else{

txtResult.setText(String.format("%2.8f",?v));

}

}

}

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

EventQueue.invokeLater(new?Runnable()??{

public?void?run()???{

new?UnitTransfer();

}

});

}

}

//請參考,歡迎指正

北大青鳥java培訓:JavaScript代碼測試必備的12款工具?

1、JasmineJasmine是一個行為驅動的測試開發(fā)框架,用于對JavaScript代碼進行測試。

它不依賴其它任何JavaScript框架,也不需要DOM。

它的語法簡潔、明確,寫測試非常容易。

2、MochaMocha是一個功能豐富的JavaScript測試框架,既運行于Node.js環(huán)境中,也可以運行于瀏覽器環(huán)境中。

Mocha以串行方式運行測試,能做出靈活而準確的報告,也能將測試中未捕捉的異常映射到正確的測試用例。

3、ChaiChai是個支持BDD/TDD的庫,可用于node和瀏覽器,可配合任何JavaScript測試框架使用。

4、QUnitQUnit是個功能強大又易于使用的JavaScript單元測試框架。

jQuery、jQueryUI和jQueyMobile項目都使用這個框架,它能測試普通的JavaScript代碼。

5、SinonSinon.JS為JavaScript提供了獨立的spies、stubs和mocks[譯者注:Spy、Stub和Mock都是測試專用名詞,Stub常被翻譯為樁,spies是Spy的復數(shù)形式,是一種可以監(jiān)視方法、調用和參數(shù)的技術]。

它不依賴任何東西,可以配合任何單元測試框架工作。

6、KarmaKarma是針對連通瀏覽器的一個框架無關測試運行器。

每一個測試結果對應每個瀏覽器,它的測試和顯示都是通過命令行暴露給開發(fā)者的,這樣他們就可以看到瀏覽器測試的通過或失敗。

7、SeleniumSelenium有一個簡單的目標:就是自動化瀏覽器。

它主要用于自動化測試web應用程序,但是只是很簡單地考慮到了基于網(wǎng)絡的管理任務。

8、WebdriverIOWebdriverIO允許用戶僅添加幾行代碼就可以控制瀏覽器或移動應用程序,使測試代碼更簡單、簡潔、易讀。

集成的TestRunner同樣允許你以同步的方式調用異步命令,這樣你不需要關心如何處理Promise以避免競態(tài)條件。

此外,它取消了所有的繁瑣的設置工作,并且會為您管理的Selenium會話。

9、NightwatchNightwatch.js是一個易于使用的Node.js,它是為基于瀏覽器的app和網(wǎng)站設計的終端到終端(E2E)的測試方法。

它使用強大的W3CWebDriverAPI,用于在DOM元素上執(zhí)行命令和斷言。

10、PhantomCSSPhantomCSS獲得CasperJS捕獲的屏幕截圖,并使用Resemble.js將其與基準圖進行對比,以測試RGB像素差異。

java課程發(fā)現(xiàn)PhantomCSS然后生成圖像差異對比,用于幫助您找到原因。

11、PhantomFlowPhantomFlow使用決策樹提供UI測試方案。

針對PhantomJS,CasperJS和PhantomCSS的NodeJS包裝器——PhantomFlow能夠流暢地在代碼中描述用戶流程,同時生成用于可視化的結構化樹數(shù)據(jù)。

java開發(fā)工具中的代碼管理工具有那些?

Code Review中文應該譯作“代碼審查”或是“代碼評審”,這是一個流程,當開發(fā)人員寫好代碼后,需要讓別人來review一下他的代碼,這是一種有效發(fā)現(xiàn)BUG的方法。由此,我們可以審查代碼的風格、邏輯、思路……,找出問題,以及改進代碼。因為這是代碼剛剛出爐的時候,所以,這也是代碼重構,代碼調整,代碼修改的最佳時候。所以,Code Review是編碼實現(xiàn)中最最重要的一個環(huán)節(jié)。長時間以來,Code Review需要有一些有效的工具來支持,這樣我們就可以更容易,更有效率地來進行代碼審查工作。下面是5個開源的代碼審查工具,他們可以幫助你更容易地進行這項活動。1. Review board:

Review board 是一個 基于web 的工具,主要設計給 django 和python的用戶。 Review board 可以幫助我們追蹤待決代碼的改動,并可以讓Code-Review更為容易和簡練。盡管Review board 最初被設計在VMware項目中使用,但現(xiàn)在其足夠地通用。當前,其支持這些代碼版本管理軟件: SVN, CVS, Perforce, Git, Bazaar, 和Mercurial.Yahoo 是review-board的其中一個用戶。“Review board 已經(jīng)改變了代碼評審的方式,其可以強迫高質量的代碼標準和風格,并可以成為程序員編程的指導者。每一次,當你訪問search.yahoo.com 時,其代碼都是使用 Review board工具Review過的。 We’re great fans of your work!”– Yahoo! Web Search 2. Codestriker:

Codestriker 也是一個基于Web的應用,其主要使用 GCI-Perl 腳本支持在線的代碼審查。Codestriker 可以集成于CVS, Subversion, ClearCase, Perforce 和Visual SourceSafe。并有一些插件可以提供支持其它的源碼管理工具。David Sitsky 是 Codestriker 的作者,并也是最活躍的開發(fā)人員之一。 Jason Remillard 是另一個活路的開發(fā)者,并給這個項目提供了最深遠最有意義的貢獻。大量的程序員貢獻他們的代碼給 Codestriker 項目,導致了這個項目空前的繁榮。 3. Groogle:

Groogle 是一個基于WEB的代碼評審工具。 Groogle 支持和 Subversion 集成。它主要提供如下的功能:各式各樣語言的語法高亮。

支持整個版本樹的比較。

支持當個文件不同版本的diff功能,并有一個圖形的版本樹。

郵件通知所有的Reivew的人當前的狀態(tài)。

認證機制。 4. Rietveld:

Rietveld 由Guido van Rossum 開發(fā)(他是Python的創(chuàng)造者,現(xiàn)在是Google的員工),這個工具是基于Mondrian 工具,作者一開始是為了Google 開發(fā)的,并且,它在很多方面和Review board 很像。它也是一個基于Web的應用,并可以Google App Engine 當主機。它使用了目前最流行的Web開發(fā)框架 django 并支持 Subversion 。當前,任何一個使用 Google Code 的項目都可以使用 Rietveld 并且使用 python Subversion 服務器。當然,它同樣支持其它的Subversion服務器。 5. JCR

JCR 或者叫做 JCodeReview 也是一個基于WEB界面的最初設計給Reivew Java 語言的一個工具。當然,現(xiàn)在,它可以被用于其它的非Java的代碼。JCR 主要想?yún)f(xié)助:審查者。所有的代碼更改都會被高亮,以及大多數(shù)語言的語法高亮。Code extracts 可以顯示代碼評審意見。如果你正在Review Java的代碼,你可以點擊代碼中的類名來查看相關的類的聲明。

項目所有者。可以 輕松創(chuàng)建并配置需要Review的項目,并不需要集成任何的軟件配置管理系統(tǒng)(SCM)。

流程信仰者。 所有的評語都會被記錄在數(shù)據(jù)庫中,并且會有狀態(tài)報告,以及各種各樣的統(tǒng)計。

架構師和開發(fā)者。 這個系統(tǒng)也可以讓我們查看屬于單個文件的評語,這樣有利于我們重構代碼。

Java 有什么好的代碼行數(shù),注釋行數(shù)統(tǒng)計工具

package com.syl.demo.test;

import java.io.*;

/**

* java代碼行數(shù)統(tǒng)計工具類

* Created by 孫義朗 on 2017/11/17 0017.

*/

public class CountCodeLineUtil {

private static int normalLines = 0; //有效程序行數(shù)

private static int whiteLines = 0; //空白行數(shù)

private static int commentLines = 0; //注釋行數(shù)

public static void countCodeLine(File file) {

System.out.println("代碼行數(shù)統(tǒng)計:" + file.getAbsolutePath());

if (file.exists()) {

try {

scanFile(file);

} catch (IOException e) {

e.printStackTrace();

}

} else {

System.out.println("文件不存在!");

System.exit(0);

}

System.out.println(file.getAbsolutePath() + " ,java文件統(tǒng)計:" +

"總有效代碼行數(shù): " + normalLines +

" ,總空白行數(shù):" + whiteLines +

" ,總注釋行數(shù):" + commentLines +

" ,總行數(shù):" + (normalLines + whiteLines + commentLines));

}

private static void scanFile(File file) throws IOException {

if (file.isDirectory()) {

File[] files = file.listFiles();

for (int i = 0; i files.length; i++) {

scanFile(files[i]);

}

}

if (file.isFile()) {

if (file.getName().endsWith(".java")) {

count(file);

}

}

}

private static void count(File file) {

BufferedReader br = null;

// 判斷此行是否為注釋行

boolean comment = false;

int temp_whiteLines = 0;

int temp_commentLines = 0;

int temp_normalLines = 0;

try {

br = new BufferedReader(new FileReader(file));

String line = "";

while ((line = br.readLine()) != null) {

line = line.trim();

if (line.matches("^[//s[^//n]]*$")) {

// 空行

whiteLines++;

temp_whiteLines++;

} else if (line.startsWith("/*") !line.endsWith("*/")) {

// 判斷此行為"/*"開頭的注釋行

commentLines++;

comment = true;

} else if (comment == true !line.endsWith("*/")) {

// 為多行注釋中的一行(不是開頭和結尾)

commentLines++;

temp_commentLines++;

} else if (comment == true line.endsWith("*/")) {

// 為多行注釋的結束行

commentLines++;

temp_commentLines++;

comment = false;

} else if (line.startsWith("http://")) {

// 單行注釋行

commentLines++;

temp_commentLines++;

} else {

// 正常代碼行

normalLines++;

temp_normalLines++;

}

}

System.out.println(file.getName() +

" ,有效行數(shù)" + temp_normalLines +

" ,空白行數(shù)" + temp_whiteLines +

" ,注釋行數(shù)" + temp_commentLines +

" ,總行數(shù)" + (temp_normalLines + temp_whiteLines + temp_commentLines));

} catch (FileNotFoundException e) {

e.printStackTrace();

} catch (IOException e) {

e.printStackTrace();

} finally {

if (br != null) {

try {

br.close();

br = null;

} catch (IOException e) {

e.printStackTrace();

}

}

}

}

//測試

public static void main(String[] args) {

File file = new File("F:\\myweb");

countCodeLine(file);

}

}

用java編寫繪圖工具的代碼

import java.applet.*;

import java.awt.*;

import java.awt.event.*;

public class ResponseToMouse extends Applet implements ActionListener,MouseListener,MouseMotionListener

{

int xPos,yPos,k=0;

Button btnDraw,btnClean,btnErase;

public void init()

{

btnDraw = new Button("畫圖");

btnClean = new Button("清屏");

btnErase = new Button("擦除");

add(btnDraw);

add(btnClean);

add(btnErase);

btnDraw.addActionListener(this);

btnClean.addActionListener(this);

btnErase.addActionListener(this);

addMouseListener(this);

addMouseMotionListener(this);

}

public void paint(Graphics g)

{

if(k==1)

{

g.setColor(Color.red);

g.fillOval(xPos-5,yPos-5,10,10);

}

if(k==2)

{

super.update(g);

}

if(k==3)

{

g.setColor(Color.white);

g.fillOval(xPos-5,yPos-5,10,10);

}

}

public void actionPerformed(ActionEvent e){

if (e.getSource()==btnDraw)

k=1;

if(e.getSource()==btnClean){

k=2;

repaint();

}

if(e.getSource()==btnErase)

k=3;

}

public void mouseClicked(MouseEvent e)

{

}

public void mousePressed(MouseEvent e)

{

showStatus("鼠標鍵按下");

}

public void mouseReleased(MouseEvent e)

{

showStatus("鼠標鍵釋放");

}

public void mouseEntered(MouseEvent e)

{

showStatus("鼠標進入");

}

public void mouseExited(MouseEvent e)

{

showStatus("鼠標移出");

}

public void mouseDragged(MouseEvent e)

{

xPos=e.getX();

yPos=e.getY();

repaint();

}

public void mouseMoved(MouseEvent e)

{

showStatus("鼠標移動");

}

public void update(Graphics g){

paint(g);

}

}

分享名稱:java工具代碼,java代碼軟件
轉載來于:http://chinadenli.net/article38/dsipjpp.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供靜態(tài)網(wǎng)站外貿建站微信公眾號品牌網(wǎng)站設計手機網(wǎng)站建設網(wǎng)站策劃

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設計