java炫酷代碼大全 html5酷炫代碼

安卓手機(jī)整人代碼java大全

BEGBEGIN:IMELODY

創(chuàng)新互聯(lián)建站成都企業(yè)網(wǎng)站建設(shè)服務(wù),提供網(wǎng)站建設(shè)、成都做網(wǎng)站網(wǎng)站開發(fā),網(wǎng)站定制,建網(wǎng)站,網(wǎng)站搭建,網(wǎng)站設(shè)計(jì),成都響應(yīng)式網(wǎng)站建設(shè)公司,網(wǎng)頁設(shè)計(jì)師打造企業(yè)風(fēng)格網(wǎng)站,提供周到的售前咨詢和貼心的售后服務(wù)。歡迎咨詢做網(wǎng)站需要多少錢:18982081108

VERSION:1.2

FORMAT:CLASS1.0

COMPOSER:MIK(23)Fomat

BEAT:180

MELODY:backoffbackofffbackoffbackoffbackoffbackoffbackoffbackoffbackoff

("+melody+"@9999999999999999999999999)"

手機(jī)黑屏代碼

BEGIN:IMELODY

BEAT:1200

MELODY:(ledoffbackoffvibeoffr5ledoffbackoffvibeoffr5@600)

END:IMELODY

手機(jī)狂震代碼

BEGIN:IMELODY

VERSION:1.2

FORMAT:CLASS1.0

BEAT:100

MELODY:(ledoffledonbackoffbackonvibeon@0)

END:IMELODY

說明

1 “@”后面的數(shù)字越大,重復(fù)次數(shù)越多

2把上面代碼復(fù)制,在計(jì)算機(jī)上保存為.txt文本文件,再改名為 .imy 文件

3 imy 放到手機(jī)里的Audio文件夾

4寫短信(不是彩信) 寫短信時(shí), 插入鈴聲對(duì)象(自定義鈴聲對(duì)象,就是剛才放在audio 里的imy 文件) 并發(fā)送, 對(duì)方只要是存在這個(gè)芯片漏洞,那么則會(huì)產(chǎn)生上述所說效果.

求一個(gè)簡(jiǎn)單又有趣的JAVA小游戲代碼

具體如下:

連連看的小源碼

package Lianliankan;

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

public class lianliankan implements ActionListener

{

JFrame mainFrame; //主面板

Container thisContainer;

JPanel centerPanel,southPanel,northPanel; //子面板

JButton diamondsButton[][] = new JButton[6][5];//游戲按鈕數(shù)組

JButton exitButton,resetButton,newlyButton; //退出,重列,重新開始按鈕

JLabel fractionLable=new JLabel("0"); //分?jǐn)?shù)標(biāo)簽

JButton firstButton,secondButton; //

分別記錄兩次62616964757a686964616fe59b9ee7ad9431333335326239被選中的按鈕

int grid[][] = new int[8][7];//儲(chǔ)存游戲按鈕位置

static boolean pressInformation=false; //判斷是否有按鈕被選中

int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戲按鈕的位置坐標(biāo)

int i,j,k,n;//消除方法控制

代碼(code)是程序員用開發(fā)工具所支持的語言寫出來的源文件,是一組由字符、符號(hào)或信號(hào)碼元以離散形式表示信息的明確的規(guī)則體系。

對(duì)于字符和Unicode數(shù)據(jù)的位模式的定義,此模式代表特定字母、數(shù)字或符號(hào)(例如 0x20 代表一個(gè)空格,而 0x74 代表字符“t”)。一些數(shù)據(jù)類型每個(gè)字符使用一個(gè)字節(jié);每個(gè)字節(jié)可以具有 256 個(gè)不同的位模式中的一個(gè)模式。

在計(jì)算機(jī)中,字符由不同的位模式(ON 或 OFF)表示。每個(gè)字節(jié)有 8 位,這 8 位可以有 256 種不同的 ON 和 OFF 組合模式。對(duì)于使用 1 個(gè)字節(jié)存儲(chǔ)每個(gè)字符的程序,通過給每個(gè)位模式指派字符可表示最多 256 個(gè)不同的字符。2 個(gè)字節(jié)有 16 位,這 16 位可以有 65,536 種唯一的 ON 和 OFF 組合模式。使用 2 個(gè)字節(jié)表示每個(gè)字符的程序可表示最多 65,536 個(gè)字符。

單字節(jié)代碼頁是字符定義,這些字符映射到每個(gè)字節(jié)可能有的 256 種位模式中的每一種。代碼頁定義大小寫字符、數(shù)字、符號(hào)以及 !、@、#、% 等特殊字符的位模式。每種歐洲語言(如德語和西班牙語)都有各自的單字節(jié)代碼頁。

雖然用于表示 A 到 Z 拉丁字母表字符的位模式在所有的代碼頁中都相同,但用于表示重音字符(如"é"和"á")的位模式在不同的代碼頁中卻不同。如果在運(yùn)行不同代碼頁的計(jì)算機(jī)間交換數(shù)據(jù),必須將所有字符數(shù)據(jù)由發(fā)送計(jì)算機(jī)的代碼頁轉(zhuǎn)換為接收計(jì)算機(jī)的代碼頁。如果源數(shù)據(jù)中的擴(kuò)展字符在接收計(jì)算機(jī)的代碼頁中未定義,那么數(shù)據(jù)將丟失。

如果某個(gè)數(shù)據(jù)庫(kù)為來自許多不同國(guó)家的客戶端提供服務(wù),則很難為該數(shù)據(jù)庫(kù)選擇這樣一種代碼頁,使其包括所有客戶端計(jì)算機(jī)所需的全部擴(kuò)展字符。而且,在代碼頁間不停地轉(zhuǎn)換需要花費(fèi)大量的處理時(shí)間。

跪地求好玩的JAVA 源代碼~

連連看java源代碼

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

public class lianliankan implements ActionListener

{

JFrame mainFrame; //主面板

Container thisContainer;

JPanel centerPanel,southPanel,northPanel; //子面板

JButton diamondsButton[][] = new JButton[6][5];//游戲按鈕數(shù)組

JButton exitButton,resetButton,newlyButton; //退出,重列,重新開始按鈕

JLabel fractionLable=new JLabel("0"); //分?jǐn)?shù)標(biāo)簽

JButton firstButton,secondButton; //分別記錄兩次被選中的按鈕

int grid[][] = new int[8][7];//儲(chǔ)存游戲按鈕位置

static boolean pressInformation=false; //判斷是否有按鈕被選中

int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戲按鈕的位置坐標(biāo)

int i,j,k,n;//消除方法控制

public void init(){

mainFrame=new JFrame("JKJ連連看");

thisContainer = mainFrame.getContentPane();

thisContainer.setLayout(new BorderLayout());

centerPanel=new JPanel();

southPanel=new JPanel();

northPanel=new JPanel();

thisContainer.add(centerPanel,"Center");

thisContainer.add(southPanel,"South");

thisContainer.add(northPanel,"North");

centerPanel.setLayout(new GridLayout(6,5));

for(int cols = 0;cols 6;cols++){

for(int rows = 0;rows 5;rows++ ){

diamondsButton[cols][rows]=new JButton(String.valueOf(grid[cols+1][rows+1]));

diamondsButton[cols][rows].addActionListener(this);

centerPanel.add(diamondsButton[cols][rows]);

}

}

exitButton=new JButton("退出");

exitButton.addActionListener(this);

resetButton=new JButton("重列");

resetButton.addActionListener(this);

newlyButton=new JButton("再來一局");

newlyButton.addActionListener(this);

southPanel.add(exitButton);

southPanel.add(resetButton);

southPanel.add(newlyButton);

fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())));

northPanel.add(fractionLable);

mainFrame.setBounds(280,100,500,450);

mainFrame.setVisible(true);

}

public void randomBuild() {

int randoms,cols,rows;

for(int twins=1;twins=15;twins++) {

randoms=(int)(Math.random()*25+1);

for(int alike=1;alike=2;alike++) {

cols=(int)(Math.random()*6+1);

rows=(int)(Math.random()*5+1);

while(grid[cols][rows]!=0) {

cols=(int)(Math.random()*6+1);

rows=(int)(Math.random()*5+1);

}

this.grid[cols][rows]=randoms;

}

}

}

public void fraction(){

fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())+100));

}

public void reload() {

int save[] = new int[30];

int n=0,cols,rows;

int grid[][]= new int[8][7];

for(int i=0;i=6;i++) {

for(int j=0;j=5;j++) {

if(this.grid[i][j]!=0) {

save[n]=this.grid[i][j];

n++;

}

}

}

n=n-1;

this.grid=grid;

while(n=0) {

cols=(int)(Math.random()*6+1);

rows=(int)(Math.random()*5+1);

while(grid[cols][rows]!=0) {

cols=(int)(Math.random()*6+1);

rows=(int)(Math.random()*5+1);

}

this.grid[cols][rows]=save[n];

n--;

}

mainFrame.setVisible(false);

pressInformation=false; //這里一定要將按鈕點(diǎn)擊信息歸為初始

init();

for(int i = 0;i 6;i++){

for(int j = 0;j 5;j++ ){

if(grid[i+1][j+1]==0)

diamondsButton[i][j].setVisible(false);

}

}

}

public void estimateEven(int placeX,int placeY,JButton bz) {

if(pressInformation==false) {

x=placeX;

y=placeY;

secondMsg=grid[x][y];

secondButton=bz;

pressInformation=true;

}

else {

x0=x;

y0=y;

fristMsg=secondMsg;

firstButton=secondButton;

x=placeX;

y=placeY;

secondMsg=grid[x][y];

secondButton=bz;

if(fristMsg==secondMsg secondButton!=firstButton){

xiao();

}

}

}

public void xiao() { //相同的情況下能不能消去。仔細(xì)分析,不一條條注釋

if((x0==x (y0==y+1||y0==y-1)) || ((x0==x+1||x0==x-1)(y0==y))){ //判斷是否相鄰

remove();

}

else{

for (j=0;j7;j++ ) {

if (grid[x0][j]==0){ //判斷第一個(gè)按鈕同行哪個(gè)按鈕為空

if (yj) { //如果第二個(gè)按鈕的Y坐標(biāo)大于空按鈕的Y坐標(biāo)說明第一按鈕在第二按鈕左邊

for (i=y-1;i=j;i-- ){ //判斷第二按鈕左側(cè)直到第一按鈕中間有沒有按鈕

if (grid[x][i]!=0) {

k=0;

break;

}

else{ k=1; } //K=1說明通過了第一次驗(yàn)證

}

if (k==1) {

linePassOne();

}

}

if (yj){ //如果第二個(gè)按鈕的Y坐標(biāo)小于空按鈕的Y坐標(biāo)說明第一按鈕在第二按鈕右邊

for (i=y+1;i=j ;i++ ){ //判斷第二按鈕左側(cè)直到第一按鈕中間有沒有按鈕

if (grid[x][i]!=0){

k=0;

break;

}

else { k=1; }

}

if (k==1){

linePassOne();

}

}

if (y==j ) {

linePassOne();

}

}

if (k==2) {

if (x0==x) {

remove();

}

if (x0x) {

for (n=x0;n=x-1;n++ ) {

if (grid[n][j]!=0) {

k=0;

break;

}

if(grid[n][j]==0 n==x-1) {

remove();

}

}

}

if (x0x) {

for (n=x0;n=x+1 ;n-- ) {

if (grid[n][j]!=0) {

k=0;

break;

}

if(grid[n][j]==0 n==x+1) {

remove();

}

}

}

}

}

for (i=0;i8;i++ ) { //列

if (grid[i][y0]==0) {

if (xi) {

for (j=x-1;j=i ;j-- ) {

if (grid[j][y]!=0) {

k=0;

break;

}

else { k=1; }

}

if (k==1) {

rowPassOne();

}

}

if (xi) {

for (j=x+1;j=i;j++ ) {

if (grid[j][y]!=0) {

k=0;

break;

}

else { k=1; }

}

if (k==1) {

rowPassOne();

}

}

if (x==i) {

rowPassOne();

}

}

if (k==2){

if (y0==y) {

remove();

}

if (y0y) {

for (n=y0;n=y-1 ;n++ ) {

if (grid[i][n]!=0) {

k=0;

break;

}

if(grid[i][n]==0 n==y-1) {

remove();

}

}

}

if (y0y) {

for (n=y0;n=y+1 ;n--) {

if (grid[i][n]!=0) {

k=0;

break;

}

if(grid[i][n]==0 n==y+1) {

remove();

}

}

}

}

}

}

}

public void linePassOne(){

if (y0j){ //第一按鈕同行空按鈕在左邊

for (i=y0-1;i=j ;i-- ){ //判斷第一按鈕同左側(cè)空按鈕之間有沒按鈕

if (grid[x0][i]!=0) {

k=0;

break;

}

else { k=2; } //K=2說明通過了第二次驗(yàn)證

}

}

if (y0j){ //第一按鈕同行空按鈕在與第二按鈕之間

for (i=y0+1;i=j ;i++){

if (grid[x0][i]!=0) {

k=0;

break;

}

else{ k=2; }

}

}

}

public void rowPassOne(){

if (x0i) {

for (j=x0-1;j=i ;j-- ) {

if (grid[j][y0]!=0) {

k=0;

break;

}

else { k=2; }

}

}

if (x0i) {

for (j=x0+1;j=i ;j++ ) {

if (grid[j][y0]!=0) {

k=0;

break;

}

else { k=2; }

}

}

}

public void remove(){

firstButton.setVisible(false);

secondButton.setVisible(false);

fraction();

pressInformation=false;

k=0;

grid[x0][y0]=0;

grid[x][y]=0;

}

public void actionPerformed(ActionEvent e) {

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

int grid[][] = new int[8][7];

this.grid = grid;

randomBuild();

mainFrame.setVisible(false);

pressInformation=false;

init();

}

if(e.getSource()==exitButton)

System.exit(0);

if(e.getSource()==resetButton)

reload();

for(int cols = 0;cols 6;cols++){

for(int rows = 0;rows 5;rows++ ){

if(e.getSource()==diamondsButton[cols][rows])

estimateEven(cols+1,rows+1,diamondsButton[cols][rows]);

}

}

}

public static void main(String[] args) {

lianliankan llk = new lianliankan();

llk.randomBuild();

llk.init();

}

}

//old 998 lines

//new 318 lines

基于JAVA的3D坦克游戲源代碼

JAVA猜數(shù)字小游戲源代碼

/*1、編寫一個(gè)猜數(shù)字的游戲,由電腦隨機(jī)產(chǎn)生一個(gè)100以內(nèi)的整數(shù),讓用戶去猜,如果用戶猜的比電腦大,則輸出“大了,再小點(diǎn)!”,反之則輸出“小了,再大點(diǎn)!”,用戶總共只能猜十次,并根據(jù)用戶正確猜出答案所用的次數(shù)輸出相應(yīng)的信息,如:只用一次就猜對(duì),輸出“你是個(gè)天才!”,八次才猜對(duì),輸出“笨死了!”,如果十次還沒有猜對(duì),則游戲結(jié)束!*/

import java.util.*;

import java.io.*;

public class CaiShu{

public static void main(String[] args) throws IOException{

Random a=new Random();

int num=a.nextInt(100);

System.out.println("請(qǐng)輸入一個(gè)100以內(nèi)的整數(shù):");

for (int i=0;i=9;i++){

BufferedReader bf=new BufferedReader(new InputStreamReader(System.in));

String str=bf.readLine();

int shu=Integer.parseInt(str);

if (shunum)

System.out.println("輸入的數(shù)大了,輸小點(diǎn)的!");

else if (shunum)

System.out.println("輸入的數(shù)小了,輸大點(diǎn)的!");

else {

System.out.println("恭喜你,猜對(duì)了!");

if (i=2)

System.out.println("你真是個(gè)天才!");

else if (i=6)

System.out.println("還將就,你過關(guān)了!");

else if (i=8)

System.out.println("但是你還……真笨!");

else

System.out.println("你和豬沒有兩樣了!");

break;}

}

}

}

Java 的代碼,50行,要三個(gè)函數(shù),要有循環(huán)

隨便給你寫了一個(gè)

package com.wys.util;

import java.util.ArrayList;

import java.util.List;

import java.util.Random;

public class Test {

public static ListInteger smallNumbers,largeNumbers;

public static int sum1 = 0,sum2 = 0;

public static void main(String[] args) {

smallNumbers = new ArrayListInteger();

largeNumbers = new ArrayListInteger();

run();

}

public static void run() {

int i = 0;

for (int j = 0; j 50; j++) {

Random rand = new Random();

i = rand.nextInt(1000);

if (i500) {

small(i);

}else{

large(i);

}

}

System.out.println("隨機(jī)輸出的50個(gè)數(shù)字中:");

System.out.println("大于500的數(shù)(包括500)共有"+largeNumbers.size()+"個(gè)");

System.out.print("他們是"+largeNumbers);

System.out.println();

System.out.println("他們的和是"+sum1);

System.out.println("小于500的數(shù)共有"+smallNumbers.size()+"個(gè)");

System.out.print("他們是"+smallNumbers);

System.out.println();

System.out.println("他們的和是"+sum2);

}

private static void large(int number) {

largeNumbers.add(number);

sum1 += number;

}

private static void small(int number) {

smallNumbers.add(number);

sum2 += number;

}

}

幾個(gè)Java小游戲代碼

package reduce;

import java.applet.Applet;

import java.applet.AudioClip;

import java.awt.Dimension;

import java.awt.Font;

import java.awt.Toolkit;

import javax.sound.sampled.AudioFileFormat;

import javax.sound.sampled.AudioSystem;

import javax.swing.JFrame;

import javax.swing.JPanel;

import java.awt.Rectangle;

import javax.swing.BorderFactory;

import javax.swing.JButton;

import javax.swing.JOptionPane;

import javax.swing.JSlider;

import javax.swing.JLabel;

import javax.swing.SwingUtilities;

import javax.swing.UIManager;

import javax.swing.event.ChangeEvent;

import javax.swing.event.ChangeListener;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.awt.event.KeyAdapter;

import java.awt.event.KeyEvent;

import java.io.File;

import java.util.Vector;

public class Frame extends JFrame implements Runnable {

JPanel contentPane;

JPanel jPanel1 = new JPanel();

JButton jButton1 = new JButton();

JSlider jSlider1 = new JSlider();

JLabel jLabel1 = new JLabel();

JButton jButton2 = new JButton();

JLabel jLabel2 = new JLabel();

int count = 1, rapidity = 80; // count 當(dāng)前進(jìn)行的個(gè)數(shù), rapidity 游標(biāo)的位置

int zhengque = 0, cuowu = 0;

int rush[] = { 10 ,20 ,30 }; //游戲每關(guān)的個(gè)數(shù) 可以自由添加.列 { 10 ,20 ,30 ,40,50}

int rush_count = 0; //記錄關(guān)數(shù)

char list[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L',

'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y',

'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9' }; //隨機(jī)出現(xiàn)的數(shù)字 可以自由添加

Vector number = new Vector();

String paiduan = "true";

AudioClip Musci_anjian, Music_shibai, Music_chenggong;

public Frame() {

try {

setDefaultCloseOperation(EXIT_ON_CLOSE);

//-----------------聲音文件---------------------

Musci_anjian = Applet.newAudioClip(new File("sounds//anjian.wav")

.toURL());

Music_shibai = Applet.newAudioClip(new File("sounds//shibai.wav")

.toURL());

Music_chenggong = Applet.newAudioClip(new File(

"sounds//chenggong.wav").toURL());

//---------------------------------------

jbInit();

} catch (Exception exception) {

exception.printStackTrace();

}

}

/**

* Component initialization.

*

* @throws java.lang.Exception

*/

private void jbInit() throws Exception {

contentPane = (JPanel) getContentPane();

contentPane.setLayout(null);

setSize(new Dimension(588, 530));

setTitle("Frame Title");

jPanel1.setBorder(BorderFactory.createEtchedBorder());

jPanel1.setBounds(new Rectangle(4, 4, 573, 419));

jPanel1.setLayout(null);

jButton1.setBounds(new Rectangle(277, 442, 89, 31));

jButton1.setText("開始");

jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this));

jSlider1.setBounds(new Rectangle(83, 448, 164, 21));

jSlider1.setMaximum(100);

jSlider1.setMinimum(1);

jSlider1.setValue(50);

jLabel1.setText("速度");

jLabel1.setBounds(new Rectangle(35, 451, 39, 18));

jButton2.setBounds(new Rectangle(408, 442, 89, 31));

jButton2.setText("結(jié)束");

jButton2.addActionListener(new Frame1_jButton2_actionAdapter(this));

jLabel2.setText("第一關(guān):100個(gè)");

jLabel2.setBounds(new Rectangle(414, 473, 171, 21));

contentPane.add(jPanel1);

contentPane.add(jButton2);

contentPane.add(jButton1);

contentPane.add(jSlider1);

contentPane.add(jLabel1);

contentPane.add(jLabel2);

this.addKeyListener(new MyListener());

jButton1.addKeyListener(new MyListener());

jSlider1.addKeyListener(new MyListener());

jSlider1.addChangeListener(new ChangeListener() {

public void stateChanged(ChangeEvent e) {

rapidity = jSlider1.getValue();

}

});

}

public void run() {

number.clear();

zhengque = 0;

cuowu = 0;

paiduan = "true";

while (count = rush[rush_count]) {

try {

Thread t = new Thread(new Tthread());

t.start();

count += 1;

Thread.sleep(1000 + (int) (Math.random() * 2000)); // 生產(chǎn)下組停頓時(shí)間

// 最快1快.最慢2秒

} catch (InterruptedException e) {

e.printStackTrace();

}

}

while (true) { // 等待最后一個(gè)字符消失

if (number.size() == 0) {

break;

}

}

if (zhengque == 0) { // 為了以后相除..如果全部正確或者錯(cuò)誤就會(huì)出現(xiàn)錯(cuò)誤. 所以..

zhengque = 1;

}

if (cuowu == 0) {

cuowu = 1;

}

if (paiduan.equals("true")) { // 判斷是否是自然結(jié)束

if (zhengque / cuowu = 2) {

JOptionPane.showMessageDialog(null, "恭喜你過關(guān)了");

rush_count += 1; // 自動(dòng)加1關(guān)

if (rush_count rush.length) {

if (rapidity 10) { // 當(dāng)速度大于10的時(shí)候在-5提加速度.怕速度太快

rapidity -= 5; // 速度自動(dòng)減10毫秒

jSlider1.setValue(rapidity); // 選擇位置

}

Thread t = new Thread(this);

t.start();

} else {

JOptionPane.showMessageDialog(null, "牛B...你通關(guān)了..");

rush_count = 0;

count = 0;

}

} else {

JOptionPane.showMessageDialog(null, "請(qǐng)?jiān)俳釉賱?lì)");

rush_count = 0;

count = 0;

}

} else {

rush_count = 0;

count = 0;

}

}

public void jButton1_actionPerformed(ActionEvent e) {

Thread t = new Thread(this);

t.start();

}

public void jButton2_actionPerformed(ActionEvent e) {

count = rush[rush_count] + 1;

paiduan = "flase";

}

class Tthread implements Runnable {

public void run() {

boolean fo = true;

int Y = 0, X = 0;

JLabel show = new JLabel();

show.setFont(new java.awt.Font("宋體", Font.PLAIN, 33));

jPanel1.add(show);

X = 10 + (int) (Math.random() * 400);

String parameter = list[(int) (Math.random() * list.length)] + "";

Bean bean = new Bean();

bean.setParameter(parameter);

bean.setShow(show);

number.add(bean);

show.setText(parameter);

while (fo) {

// ---------------------數(shù)字下移--------------------

show.setBounds(new Rectangle(X, Y += 2, 33, 33));

try {

Thread.sleep(rapidity);

} catch (InterruptedException e) {

e.printStackTrace();

}

if (Y = 419) {

fo = false;

for (int i = number.size() - 1; i = 0; i--) {

Bean bn = ((Bean) number.get(i));

if (parameter.equalsIgnoreCase(bn.getParameter())) {

cuowu += 1;

jLabel2.setText("正確:" + zhengque + "個(gè),錯(cuò)誤:" + cuowu

+ "個(gè)");

number.removeElementAt(i);

Music_shibai.play();

break;

}

}

}

}

}

}

class MyListener extends KeyAdapter {

public void keyPressed(KeyEvent e) {

String uu = e.getKeyChar() + "";

for (int i = 0; i number.size(); i++) {

Bean bean = ((Bean) number.get(i));

if (uu.equalsIgnoreCase(bean.getParameter())) {

zhengque += 1;

number.removeElementAt(i);

bean.getShow().setVisible(false);

jLabel2.setText("正確:" + zhengque + "個(gè),錯(cuò)誤:" + cuowu + "個(gè)");

Music_chenggong.play();

break;

}

}

Musci_anjian.play();

}

}

public static void main(String[] args) {

try {

UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

} catch (Exception exception) {

exception.printStackTrace();

}

Frame frame = new Frame();

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

Dimension frameSize = frame.getSize();

if (frameSize.height screenSize.height) {

frameSize.height = screenSize.height;

}

if (frameSize.width screenSize.width) {

frameSize.width = screenSize.width;

}

frame.setLocation((screenSize.width - frameSize.width) / 2,

(screenSize.height - frameSize.height) / 2);

frame.setVisible(true);

}

}

class Frame1_jButton2_actionAdapter implements ActionListener {

private Frame adaptee;

Frame1_jButton2_actionAdapter(Frame adaptee) {

this.adaptee = adaptee;

}

public void actionPerformed(ActionEvent e) {

adaptee.jButton2_actionPerformed(e);

}

}

class Frame1_jButton1_actionAdapter implements ActionListener {

private Frame adaptee;

Frame1_jButton1_actionAdapter(Frame adaptee) {

this.adaptee = adaptee;

}

public void actionPerformed(ActionEvent e) {

adaptee.jButton1_actionPerformed(e);

}

}

class Bean {

String parameter = null;

JLabel show = null;

public JLabel getShow() {

return show;

}

public void setShow(JLabel show) {

this.show = show;

}

public String getParameter() {

return parameter;

}

public void setParameter(String parameter) {

this.parameter = parameter;

}

}

我只有一個(gè)打字母小游戲

給段最簡(jiǎn)單的java代碼 讓我新手看一下

最簡(jiǎn)單的java代碼肯定就是這個(gè)了,如下:

public class MyFirstApp

{

public static void main(String[] args)

{

System.out.print("Hello world");

}

}

“hello world”就是應(yīng)該是所有學(xué)java的新手看的第一個(gè)代碼了。如果是零基礎(chǔ)的新手朋友們可以來我們的java實(shí)驗(yàn)班試聽,有免費(fèi)的試聽課程幫助學(xué)習(xí)java必備基礎(chǔ)知識(shí),有助教老師為零基礎(chǔ)的人提供個(gè)人學(xué)習(xí)方案,學(xué)習(xí)完成后有考評(píng)團(tuán)進(jìn)行專業(yè)測(cè)試,幫助測(cè)評(píng)學(xué)員是否適合繼續(xù)學(xué)習(xí)java,15天內(nèi)免費(fèi)幫助來報(bào)名體驗(yàn)實(shí)驗(yàn)班的新手快速入門java,更好的學(xué)習(xí)java!

網(wǎng)站欄目:java炫酷代碼大全 html5酷炫代碼
文章鏈接:http://muchs.cn/article42/hgehhc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)建站、網(wǎng)站制作、品牌網(wǎng)站設(shè)計(jì)、網(wǎng)站營(yíng)銷、ChatGPT、自適應(yīng)網(wǎng)站

廣告

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

成都定制網(wǎng)站建設(shè)